mirror of https://github.com/abpframework/abp.git
25 changed files with 138 additions and 78 deletions
@ -1,8 +0,0 @@ |
|||||
using Volo.Abp.AspNetCore.Mvc.UI.Bundling; |
|
||||
|
|
||||
namespace DashboardDemo.Pages.widgets |
|
||||
{ |
|
||||
public class DemoStatisticsStyleContributor : BundleContributor |
|
||||
{ |
|
||||
} |
|
||||
} |
|
||||
@ -1,6 +0,0 @@ |
|||||
@page |
|
||||
@model DashboardDemo.Pages.widgets.DemoStatisticsViewComponent |
|
||||
@{ |
|
||||
} |
|
||||
|
|
||||
Demo statistics |
|
||||
@ -1,17 +0,0 @@ |
|||||
using Microsoft.AspNetCore.Mvc; |
|
||||
|
|
||||
namespace DashboardDemo.Pages.widgets |
|
||||
{ |
|
||||
[ViewComponent] |
|
||||
public class DemoStatisticsViewComponent : ViewComponent |
|
||||
{ |
|
||||
public const string WidgetName = "DemoStatistics"; |
|
||||
|
|
||||
public const string DisplayName = "DemoStatisticss"; |
|
||||
|
|
||||
public IViewComponentResult Invoke() |
|
||||
{ |
|
||||
return View("/Pages/widgets/DemoStatisticsViewComponent.cshtml", new DemoStatisticsViewComponent()); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1 +0,0 @@ |
|||||
|
|
||||
@ -1,6 +0,0 @@ |
|||||
@page |
|
||||
@model DashboardDemo.Pages.widgets.MyWidgetViewComponent |
|
||||
@{ |
|
||||
} |
|
||||
|
|
||||
Hiiiiiii |
|
||||
@ -1,17 +0,0 @@ |
|||||
using Microsoft.AspNetCore.Mvc; |
|
||||
|
|
||||
namespace DashboardDemo.Pages.widgets |
|
||||
{ |
|
||||
[ViewComponent] |
|
||||
public class MyWidgetViewComponent : ViewComponent |
|
||||
{ |
|
||||
public const string WidgetName = "MyWidget"; |
|
||||
|
|
||||
public const string DisplayName = "MyWidgett"; |
|
||||
|
|
||||
public IViewComponentResult Invoke() |
|
||||
{ |
|
||||
return View("/Pages/widgets/MyWidgetViewComponent.cshtml", new MyWidgetViewComponent()); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -0,0 +1,14 @@ |
|||||
|
(function ($) { |
||||
|
var $container = $('#RoleListWidgetContainer'); |
||||
|
|
||||
|
var _identityUserAppService = volo.abp.identity.identityRole; |
||||
|
|
||||
|
_identityUserAppService.getList({}).then(function (result) { |
||||
|
var html = ''; |
||||
|
for (var i = 0; i < result.items.length; i++) { |
||||
|
html += '<li>'+ result.items[i].name+'</li>'; |
||||
|
} |
||||
|
|
||||
|
$container.find('#RoleList').html(html); |
||||
|
}); |
||||
|
})(jQuery); |
||||
@ -0,0 +1,12 @@ |
|||||
|
using Volo.Abp.AspNetCore.Mvc.UI.Bundling; |
||||
|
|
||||
|
namespace DashboardDemo.Pages.widgets |
||||
|
{ |
||||
|
public class RoleListWidgetStyleContributor : BundleContributor |
||||
|
{ |
||||
|
public override void ConfigureBundle(BundleConfigurationContext context) |
||||
|
{ |
||||
|
context.Files.Add("/Pages/widgets/RoleListWidget.css"); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,15 @@ |
|||||
|
@page |
||||
|
@model DashboardDemo.Pages.widgets.RoleListWidgetViewComponent |
||||
|
@{ |
||||
|
} |
||||
|
<div id="RoleListWidgetContainer"> |
||||
|
<abp-card background="Secondary"> |
||||
|
<abp-card-header> Roles in application :</abp-card-header> |
||||
|
<abp-card-body> |
||||
|
<ul id="RoleList"> |
||||
|
|
||||
|
</ul> |
||||
|
</abp-card-body> |
||||
|
</abp-card> |
||||
|
</div> |
||||
|
|
||||
@ -0,0 +1,17 @@ |
|||||
|
using Microsoft.AspNetCore.Mvc; |
||||
|
|
||||
|
namespace DashboardDemo.Pages.widgets |
||||
|
{ |
||||
|
[ViewComponent] |
||||
|
public class RoleListWidgetViewComponent : ViewComponent |
||||
|
{ |
||||
|
public const string WidgetName = "RoleListWidget"; |
||||
|
|
||||
|
public const string DisplayName = "RoleListWidgets"; |
||||
|
|
||||
|
public IViewComponentResult Invoke() |
||||
|
{ |
||||
|
return View("/Pages/widgets/RoleListWidgetViewComponent.cshtml", new RoleListWidgetViewComponent()); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,3 @@ |
|||||
|
body { |
||||
|
margin: 0; |
||||
|
} |
||||
@ -0,0 +1,10 @@ |
|||||
|
(function ($) { |
||||
|
|
||||
|
var $container = $('#UserCountWidgetContainer'); |
||||
|
|
||||
|
var _identityUserAppService = volo.abp.identity.identityUser; |
||||
|
|
||||
|
_identityUserAppService.getList({}).then(function(result) { |
||||
|
$container.find('#UserCount').text(result.items.length); |
||||
|
}); |
||||
|
})(jQuery); |
||||
@ -0,0 +1,12 @@ |
|||||
|
@page |
||||
|
@model DashboardDemo.Pages.widgets.UserCountWidgetViewComponent |
||||
|
@{ |
||||
|
} |
||||
|
<div id="UserCountWidgetContainer"> |
||||
|
<abp-card background="Info"> |
||||
|
<abp-card-header>User Count :</abp-card-header> |
||||
|
<abp-card-body> |
||||
|
<h1 id="UserCount"></h1> |
||||
|
</abp-card-body> |
||||
|
</abp-card> |
||||
|
</div> |
||||
@ -0,0 +1,17 @@ |
|||||
|
using Microsoft.AspNetCore.Mvc; |
||||
|
using Volo.Abp.AspNetCore.Mvc; |
||||
|
|
||||
|
namespace DashboardDemo.Pages.widgets |
||||
|
{ |
||||
|
public class UserCountWidgetViewComponent : AbpViewComponent |
||||
|
{ |
||||
|
public const string WidgetName = "UserCountWidget"; |
||||
|
|
||||
|
public const string DisplayName = "UserCountWidgett"; |
||||
|
|
||||
|
public IViewComponentResult Invoke() |
||||
|
{ |
||||
|
return View("/Pages/widgets/UserCountWidgetViewComponent.cshtml", new UserCountWidgetViewComponent()); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue