mirror of https://github.com/abpframework/abp.git
8 changed files with 88 additions and 50 deletions
@ -0,0 +1,17 @@ |
|||||
|
using System; |
||||
|
using Microsoft.AspNetCore.Mvc; |
||||
|
using Volo.Abp.AspNetCore.Mvc; |
||||
|
|
||||
|
namespace DashboardDemo.Web.Pages.Shared.Components.CountersWidget |
||||
|
{ |
||||
|
[Route("Widgets")] |
||||
|
public class CountersWidgetController : AbpController |
||||
|
{ |
||||
|
[HttpGet] |
||||
|
[Route("Counters")] |
||||
|
public IActionResult Counters(DateTime startDate, DateTime endDate) |
||||
|
{ |
||||
|
return ViewComponent("CountersWidget", new {startDate, endDate}); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -1,26 +0,0 @@ |
|||||
abp.widgets = abp.widgets || {}; //TODO: Remove later
|
|
||||
(function () { |
|
||||
abp.widgets.CountersWidget = function ($wrapper) { |
|
||||
|
|
||||
var refresh = function (filters) { |
|
||||
dashboardDemo.dashboard.getCountersWidget({ |
|
||||
startDate: filters.startDate, |
|
||||
endDate: filters.endDate |
|
||||
}).then(function (result) { |
|
||||
$wrapper.find('.new-user-count').text(result.newUsers); |
|
||||
$wrapper.find('.active-user-count').text(result.activeUsers); |
|
||||
$wrapper.find('.total-income').text('$' + result.totalIncome.toFixed(2)); |
|
||||
$wrapper.find('.total-profit').text('$' + result.totalProfit.toFixed(2)); |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
var init = function (filters) { |
|
||||
// there is no initial process for this widget.
|
|
||||
}; |
|
||||
|
|
||||
return { |
|
||||
init: init, |
|
||||
refresh: refresh |
|
||||
}; |
|
||||
}; |
|
||||
})(); |
|
||||
Loading…
Reference in new issue