mirror of https://github.com/abpframework/abp
parent
c9503db0a6
commit
46eb5b380b
@ -0,0 +1,29 @@
|
||||
@model DashboardDemo.Web.Pages.Components.CountersWidget.CountersWidgetViewModel
|
||||
<div class="counters-widget">
|
||||
<abp-row>
|
||||
<abp-column size-md="_3">
|
||||
<div class="counters-widget-item">
|
||||
<div class="counters-widget-count">@Model.NewUsers</div>
|
||||
<div class="counters-widget-count-name">New Users</div>
|
||||
</div>
|
||||
</abp-column>
|
||||
<abp-column size-md="_3">
|
||||
<div class="counters-widget-item">
|
||||
<div class="counters-widget-count">@Model.ActiveUsers</div>
|
||||
<div class="counters-widget-count-name">Active Users</div>
|
||||
</div>
|
||||
</abp-column>
|
||||
<abp-column size-md="_3">
|
||||
<div class="counters-widget-item">
|
||||
<div class="counters-widget-count">@Model.TotalIncome.ToString("C")</div>
|
||||
<div class="counters-widget-count-name">Total Income</div>
|
||||
</div>
|
||||
</abp-column>
|
||||
<abp-column size-md="_3">
|
||||
<div class="counters-widget-item">
|
||||
<div class="counters-widget-count">@Model.TotalProfit.ToString("C")</div>
|
||||
<div class="counters-widget-count-name">Total Profit</div>
|
||||
</div>
|
||||
</abp-column>
|
||||
</abp-row>
|
||||
</div>
|
@ -0,0 +1,26 @@
|
||||
@page
|
||||
@model DashboardDemo.Web.Pages.MyDashboardModel
|
||||
|
||||
@section styles {
|
||||
<abp-style src="/Pages/MyDashboard.css" />
|
||||
}
|
||||
|
||||
<form method="get" id="MyDashboardFilterForm">
|
||||
<abp-row class="mb-3">
|
||||
<abp-column size-md="_5">
|
||||
<abp-input asp-for="StartDate" />
|
||||
</abp-column>
|
||||
<abp-column size-md="_5">
|
||||
<abp-input asp-for="EndDate" />
|
||||
</abp-column>
|
||||
<abp-column size-md="_2">
|
||||
<abp-button button-type="Primary" icon="refresh" size="Block_Large" type="Submit" text="Refresh" />
|
||||
</abp-column>
|
||||
</abp-row>
|
||||
</form>
|
||||
|
||||
@await Component.InvokeAsync("CountersWidget", new
|
||||
{
|
||||
startDate = @Model.StartDate,
|
||||
endDate = @Model.EndDate
|
||||
})
|
@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
|
||||
namespace DashboardDemo.Web.Pages
|
||||
{
|
||||
public class MyDashboardModel : PageModel
|
||||
{
|
||||
[BindProperty(SupportsGet = true)]
|
||||
public DateTime? StartDate { get; set; }
|
||||
|
||||
[BindProperty(SupportsGet = true)]
|
||||
public DateTime? EndDate { get; set; }
|
||||
|
||||
public void OnGet()
|
||||
{
|
||||
if (StartDate == null)
|
||||
{
|
||||
StartDate = DateTime.Now.Subtract(TimeSpan.FromDays(6)).ClearTime();
|
||||
}
|
||||
|
||||
if (EndDate == null)
|
||||
{
|
||||
EndDate = DateTime.Now.AddDays(1).ClearTime();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in new issue