diff --git a/src/admin/Bootstrap.Admin/Pages/Components/TableBase.cs b/src/admin/Bootstrap.Admin/Pages/Components/TableBase.cs index 840a8066..1b2ffd0e 100644 --- a/src/admin/Bootstrap.Admin/Pages/Components/TableBase.cs +++ b/src/admin/Bootstrap.Admin/Pages/Components/TableBase.cs @@ -161,12 +161,6 @@ namespace Bootstrap.Admin.Pages.Components [Parameter] public Func>? OnQuery { get; set; } - /// - /// 点击翻页回调方法 - /// - [Parameter] - public Func>? OnDataSourceQuery { get; set; } - /// /// 新建按钮回调方法 /// @@ -280,10 +274,6 @@ namespace Bootstrap.Admin.Pages.Components Query(); }); if (EditModel == null && OnAdd != null) EditModel = OnAdd.Invoke(); - if (OnDataSourceQuery != null) - { - Items = OnDataSourceQuery(); - } if (OnQuery != null) { var queryData = OnQuery(new QueryPageOptions() { PageItems = DefaultPageItems, SearchText = SearchText, SortName = SortName, SortOrder = SortOrder }); diff --git a/src/admin/Bootstrap.Admin/Pages/Views/Admin/Online.razor b/src/admin/Bootstrap.Admin/Pages/Views/Admin/Online.razor index 960e0faf..9e77df29 100644 --- a/src/admin/Bootstrap.Admin/Pages/Views/Admin/Online.razor +++ b/src/admin/Bootstrap.Admin/Pages/Views/Admin/Online.razor @@ -7,7 +7,7 @@
- +
diff --git a/src/admin/Bootstrap.Admin/Pages/Views/Admin/Settings.razor b/src/admin/Bootstrap.Admin/Pages/Views/Admin/Settings.razor index 6215898a..eeca6023 100644 --- a/src/admin/Bootstrap.Admin/Pages/Views/Admin/Settings.razor +++ b/src/admin/Bootstrap.Admin/Pages/Views/Admin/Settings.razor @@ -193,7 +193,7 @@ 网站缓存
-
+
diff --git a/src/admin/Bootstrap.Admin/Pages/Views/Components/OnlineBase.cs b/src/admin/Bootstrap.Admin/Pages/Views/Components/OnlineBase.cs index 2d35ce0b..6c51dfd2 100644 --- a/src/admin/Bootstrap.Admin/Pages/Views/Components/OnlineBase.cs +++ b/src/admin/Bootstrap.Admin/Pages/Views/Components/OnlineBase.cs @@ -1,6 +1,6 @@ -using Longbow.Web; +using Bootstrap.Admin.Pages.Components; +using Longbow.Web; using Microsoft.AspNetCore.Components; -using System.Collections.Generic; using System.Linq; namespace Bootstrap.Admin.Pages.Views.Admin.Components @@ -24,6 +24,14 @@ namespace Bootstrap.Admin.Pages.Views.Admin.Components /// /// QueryData 方法 /// - protected IEnumerable QueryData() => (OnlineUSers?.OnlineUsers ?? new OnlineUser[0]).OrderByDescending(u => u.LastAccessTime); + protected QueryData QueryData(QueryPageOptions options) + { + var data = OnlineUSers?.OnlineUsers ?? new OnlineUser[0]; + return new QueryData() + { + Items = data, + TotalCount = data.Count() + }; + } } } diff --git a/src/admin/Bootstrap.Admin/Pages/Views/Components/SettingsBase.cs b/src/admin/Bootstrap.Admin/Pages/Views/Components/SettingsBase.cs index 9ec80b04..7ca6ae51 100644 --- a/src/admin/Bootstrap.Admin/Pages/Views/Components/SettingsBase.cs +++ b/src/admin/Bootstrap.Admin/Pages/Views/Components/SettingsBase.cs @@ -1,13 +1,12 @@ using Bootstrap.Admin.Pages.Components; -using Bootstrap.Admin.Pages.Extensions; using Bootstrap.Admin.Pages.Shared; using Bootstrap.DataAccess; using Bootstrap.Security; using Longbow.Cache; using Microsoft.AspNetCore.Components; using Microsoft.JSInterop; -using System; using System.Collections.Generic; +using System.Linq; namespace Bootstrap.Admin.Pages.Views.Admin.Components { @@ -72,7 +71,15 @@ namespace Bootstrap.Admin.Pages.Views.Admin.Components /// /// QueryData 方法 /// - protected IEnumerable QueryData() => CacheManager.ToList(); + protected QueryData QueryData(QueryPageOptions options) + { + var data = CacheManager.ToList(); + return new QueryData() + { + Items = data, + TotalCount = data.Count() + }; + } /// /// 清除指定键值的方法