btcpayserver/BTCPayServer/Components/AppTopItems/AppTopItems.cs
d11n 7ec978fcdb
Dashboard (#3530)
* Add dashboard and chart basics

* More widgets

* Make widgets responsive

* Layout dashboard

* Prepare ExplorerClient

* Switch to Chartist

* Dynamic data for store numbers and recent transactions tiles

* Dynamic data for recent invoices tile

* Improvements

* Plug NBXPlorer DB

* Properly filter by code

* Reorder cheat mode button

* AJAX update for graph data

* Fix create invoice button

* Retry connection on transient issues

* App Top Items stats

* Design updates

* App Sales stats

* Add points for weekly histogram, set last point to current balance

Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
2022-04-12 16:55:10 +09:00

32 lines
817 B
C#

using System.Threading.Tasks;
using BTCPayServer.Data;
using BTCPayServer.Services.Apps;
using BTCPayServer.Services.Stores;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
namespace BTCPayServer.Components.AppTopItems;
public class AppTopItems : ViewComponent
{
private readonly AppService _appService;
private readonly StoreRepository _storeRepo;
public AppTopItems(AppService appService, StoreRepository storeRepo)
{
_appService = appService;
_storeRepo = storeRepo;
}
public async Task<IViewComponentResult> InvokeAsync(AppData app)
{
var entries = await _appService.GetPerkStats(app);
var vm = new AppTopItemsViewModel
{
App = app,
Entries = entries
};
return View(vm);
}
}