Browse Source

dashboard demo improvements

pull/1486/head
Yunus Emre Kalkan 7 years ago
parent
commit
0ad7b0c034
  1. 2
      samples/DashboardDemo/src/DashboardDemo.Web/Dashboards/DashboardDefinitionProvider.cs
  2. 5
      samples/DashboardDemo/src/DashboardDemo.Web/Pages/MyDashboard.cshtml
  3. 19
      samples/DashboardDemo/src/DashboardDemo.Web/Pages/MyDashboard.cshtml.cs
  4. 1
      samples/DashboardDemo/src/DashboardDemo.Web/Pages/widgets/MonthlyProfitWidget/MonthlyProfitWidgetScriptBundleContributor.cs
  5. 1
      samples/DashboardDemo/src/DashboardDemo.Web/Pages/widgets/MonthlyProfitWidget/MonthlyProfitWidgetStyleBundleContributor.cs

2
samples/DashboardDemo/src/DashboardDemo.Web/Dashboards/DashboardDefinitionProvider.cs

@ -16,8 +16,8 @@ namespace DashboardDemo.Dashboards
LocalizableString.Create<DashboardDemoResource>("MyDashboard") LocalizableString.Create<DashboardDemoResource>("MyDashboard")
) )
.WithWidget(UserCountWidgetViewComponent.Name) .WithWidget(UserCountWidgetViewComponent.Name)
.WithWidget(RoleListWidgetViewComponent.Name)
.WithWidget(MonthlyProfitWidgetViewComponent.Name) .WithWidget(MonthlyProfitWidgetViewComponent.Name)
.WithWidget(RoleListWidgetViewComponent.Name)
.WithGlobalFilter(DateRangeGlobalFilterViewComponent.Name); .WithGlobalFilter(DateRangeGlobalFilterViewComponent.Name);
return new List<DashboardDefinition> return new List<DashboardDefinition>

5
samples/DashboardDemo/src/DashboardDemo.Web/Pages/MyDashboard.cshtml

@ -16,4 +16,7 @@
<abp-script-bundle name="@DashboardNames.MyDashboard" /> <abp-script-bundle name="@DashboardNames.MyDashboard" />
} }
@await DashboardRenderer.RenderAsync(Component, new { dashboardName = DashboardNames.MyDashboard }) <abp-card-body style="background: rgb(240,240,240)" class="p-4">
@await DashboardRenderer.RenderAsync(Component, new { dashboardName = DashboardNames.MyDashboard })
</abp-card-body>

19
samples/DashboardDemo/src/DashboardDemo.Web/Pages/MyDashboard.cshtml.cs

@ -8,25 +8,6 @@ namespace DashboardDemo.Pages
{ {
public class MyDashboardModel : DashboardDemoPageModelBase public class MyDashboardModel : DashboardDemoPageModelBase
{ {
public DashboardDefinition Dashboard { get; set; }
public readonly DashboardOptions _dashboardOptions;
public readonly WidgetOptions _widgetOptions;
public MyDashboardModel(IOptions<DashboardOptions> dashboardOptions, IOptions<WidgetOptions> widgetOptions)
{
_dashboardOptions = dashboardOptions.Value;
_widgetOptions = widgetOptions.Value;
}
public void OnGet()
{
Dashboard = _dashboardOptions.Dashboards.Single(d => d.Name.Equals(DashboardNames.MyDashboard));
}
public WidgetDefinition GetWidget(string name)
{
return _widgetOptions.Widgets.Single(d => d.Name.Equals(name));
}
} }
} }

1
samples/DashboardDemo/src/DashboardDemo.Web/Pages/widgets/MonthlyProfitWidget/MonthlyProfitWidgetScriptBundleContributor.cs

@ -8,7 +8,6 @@ using Volo.Abp.Modularity;
namespace DashboardDemo.Pages.widgets namespace DashboardDemo.Pages.widgets
{ {
[DependsOn(typeof(JQueryScriptContributor))] [DependsOn(typeof(JQueryScriptContributor))]
[DependsOn(typeof(ClipboardScriptBundleContributor))]
[DependsOn(typeof(ChartjsScriptContributor))] [DependsOn(typeof(ChartjsScriptContributor))]
public class MonthlyProfitWidgetScriptBundleContributor : BundleContributor public class MonthlyProfitWidgetScriptBundleContributor : BundleContributor
{ {

1
samples/DashboardDemo/src/DashboardDemo.Web/Pages/widgets/MonthlyProfitWidget/MonthlyProfitWidgetStyleBundleContributor.cs

@ -8,7 +8,6 @@ using Volo.Abp.Modularity;
namespace DashboardDemo.Pages.widgets namespace DashboardDemo.Pages.widgets
{ {
[DependsOn(typeof(BootstrapStyleContributor))] [DependsOn(typeof(BootstrapStyleContributor))]
[DependsOn(typeof(HighlightJsStyleContributor))]
[DependsOn(typeof(ChartjsStyleContributor))] [DependsOn(typeof(ChartjsStyleContributor))]
public class MonthlyProfitWidgetStyleBundleContributor : BundleContributor public class MonthlyProfitWidgetStyleBundleContributor : BundleContributor
{ {

Loading…
Cancel
Save