mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-23 14:40:36 +01:00
* 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>
32 lines
817 B
C#
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);
|
|
}
|
|
}
|