diff --git a/src/blazor/admin/BootstrapAdmin.Web/Components/AdminTable.razor b/src/blazor/admin/BootstrapAdmin.Web/Components/AdminTable.razor index a28c1749..3413080b 100644 --- a/src/blazor/admin/BootstrapAdmin.Web/Components/AdminTable.razor +++ b/src/blazor/admin/BootstrapAdmin.Web/Components/AdminTable.razor @@ -4,7 +4,7 @@ IsPagination="IsPagination" PageItemsSource="PageItemsSource" IsFixedHeader="IsFixedHeader" IsTree="IsTree" OnTreeExpand="OnTreeExpand!" TreeIcon="fa-chevron-circle-right" ShowDefaultButtons="ShowDefaultButtons" ShowAdvancedSearch="ShowAdvancedSearch" - ShowEmpty="ShowEmpty" EmptyText="暂无数据" EmptyImage="images/empty.svg" SortList="SortList" + ShowEmpty="ShowEmpty" EmptyText="暂无数据" EmptyImage="images/empty.svg" SortString="@SortString" OnQueryAsync="OnQueryAsync!" OnDeleteAsync="OnDeleteAsync!" OnSaveAsync="OnSaveAsync!" ShowSkeleton="true" ShowLoading="ShowLoading" ShowSearch="ShowSearch" ShowToolbar="ShowToolbar" ShowExtendButtons="ShowExtendButtons" ShowAddButton="@AuthorizeButton("add")" diff --git a/src/blazor/admin/BootstrapAdmin.Web/Components/AdminTable.razor.cs b/src/blazor/admin/BootstrapAdmin.Web/Components/AdminTable.razor.cs index 56224867..41850af7 100644 --- a/src/blazor/admin/BootstrapAdmin.Web/Components/AdminTable.razor.cs +++ b/src/blazor/admin/BootstrapAdmin.Web/Components/AdminTable.razor.cs @@ -26,7 +26,7 @@ namespace BootstrapAdmin.Web.Components /// /// [Parameter] - public List? SortList { get; set; } + public string? SortString { get; set; } /// /// diff --git a/src/blazor/admin/BootstrapAdmin.Web/Pages/Admin/Dicts.razor b/src/blazor/admin/BootstrapAdmin.Web/Pages/Admin/Dicts.razor index b7e57e56..d7741323 100644 --- a/src/blazor/admin/BootstrapAdmin.Web/Pages/Admin/Dicts.razor +++ b/src/blazor/admin/BootstrapAdmin.Web/Pages/Admin/Dicts.razor @@ -1,6 +1,6 @@ @page "/Admin/Dicts" - + diff --git a/src/blazor/admin/BootstrapAdmin.Web/Pages/Admin/Dicts.razor.cs b/src/blazor/admin/BootstrapAdmin.Web/Pages/Admin/Dicts.razor.cs index 675da304..f3892b4d 100644 --- a/src/blazor/admin/BootstrapAdmin.Web/Pages/Admin/Dicts.razor.cs +++ b/src/blazor/admin/BootstrapAdmin.Web/Pages/Admin/Dicts.razor.cs @@ -7,8 +7,6 @@ namespace BootstrapAdmin.Web.Pages.Admin /// public partial class Dicts { - private ITableSearchModel DictsSearchModel { get; set; } = new DictsSearchModel(); - - private List SortList { get; } = new List { "Define", "Category", "Name" }; + private ITableSearchModel DictsSearchModel { get; } = new DictsSearchModel(); } } diff --git a/src/blazor/admin/BootstrapAdmin.Web/Pages/Admin/Logins.razor b/src/blazor/admin/BootstrapAdmin.Web/Pages/Admin/Logins.razor index 6f18811d..2ba166d4 100644 --- a/src/blazor/admin/BootstrapAdmin.Web/Pages/Admin/Logins.razor +++ b/src/blazor/admin/BootstrapAdmin.Web/Pages/Admin/Logins.razor @@ -1,6 +1,6 @@ @page "/admin/logins" - diff --git a/src/blazor/admin/BootstrapAdmin.Web/Pages/Admin/Logins.razor.cs b/src/blazor/admin/BootstrapAdmin.Web/Pages/Admin/Logins.razor.cs index 459842e4..2fc89aac 100644 --- a/src/blazor/admin/BootstrapAdmin.Web/Pages/Admin/Logins.razor.cs +++ b/src/blazor/admin/BootstrapAdmin.Web/Pages/Admin/Logins.razor.cs @@ -10,7 +10,5 @@ public partial class Logins /// /// /// - public ITableSearchModel TableSearchModel { get; set; } = new LoginLogModel(); - - private List SortList { get; set; } = new List() { "LoginTime desc" }; + public ITableSearchModel TableSearchModel { get; } = new LoginLogModel(); } diff --git a/src/blazor/admin/BootstrapAdmin.Web/Pages/Admin/Tasks.razor b/src/blazor/admin/BootstrapAdmin.Web/Pages/Admin/Tasks.razor index b5b4630f..4ea16953 100644 --- a/src/blazor/admin/BootstrapAdmin.Web/Pages/Admin/Tasks.razor +++ b/src/blazor/admin/BootstrapAdmin.Web/Pages/Admin/Tasks.razor @@ -31,10 +31,10 @@ - + diff --git a/src/blazor/admin/BootstrapAdmin.Web/Pages/Admin/Tasks.razor.cs b/src/blazor/admin/BootstrapAdmin.Web/Pages/Admin/Tasks.razor.cs index 26976012..21c70a68 100644 --- a/src/blazor/admin/BootstrapAdmin.Web/Pages/Admin/Tasks.razor.cs +++ b/src/blazor/admin/BootstrapAdmin.Web/Pages/Admin/Tasks.razor.cs @@ -30,8 +30,6 @@ public partial class Tasks private bool IsDemo { get; set; } - private List SortList { get; } = new List() { "Name", "LastRuntime desc" }; - /// /// /// @@ -45,6 +43,10 @@ public partial class Tasks private Task> OnQueryAsync(QueryPageOptions options) { var tasks = TaskServicesManager.ToList().ToTasksModelList(); + if (options.SortList != null && options.SortList.Any()) + { + tasks = tasks.Sort(options.SortList).ToList(); + } var model = tasks.FirstOrDefault(i => i.Name == SelectedRows.FirstOrDefault()?.Name); SelectedRows.Clear(); if (model != null) @@ -83,7 +85,7 @@ public partial class Tasks return Task.FromResult(true); } - private bool OnShowButtonCallback(TasksModel model) => !IsDemo || !Jobs.Any(i => i == model.Name); + private bool OnShowButtonCallback(TasksModel model) => !IsDemo && !Jobs.Any(i => i == model.Name); private static Color GetResultColor(TriggerResult result) => result switch { @@ -122,7 +124,8 @@ public partial class Tasks private static string GetStatusIcon(SchedulerStatus status) => status switch { SchedulerStatus.Running => "fa fa-play-circle", - SchedulerStatus.Ready => "fa fa-times-circle", + SchedulerStatus.Ready => "fa fa-stop-circle", + SchedulerStatus.Disabled => "fa fa-times-circle", _ => "未知状态" }; diff --git a/src/blazor/admin/BootstrapAdmin.Web/Pages/Admin/Traces.razor b/src/blazor/admin/BootstrapAdmin.Web/Pages/Admin/Traces.razor index 860f1fb6..967af7cf 100644 --- a/src/blazor/admin/BootstrapAdmin.Web/Pages/Admin/Traces.razor +++ b/src/blazor/admin/BootstrapAdmin.Web/Pages/Admin/Traces.razor @@ -1,6 +1,6 @@ @page "/admin/traces" - diff --git a/src/blazor/admin/BootstrapAdmin.Web/Pages/Admin/Traces.razor.cs b/src/blazor/admin/BootstrapAdmin.Web/Pages/Admin/Traces.razor.cs index 4e7e59f1..93cf1d34 100644 --- a/src/blazor/admin/BootstrapAdmin.Web/Pages/Admin/Traces.razor.cs +++ b/src/blazor/admin/BootstrapAdmin.Web/Pages/Admin/Traces.razor.cs @@ -11,9 +11,7 @@ public partial class Traces { private List PageItemsSource { get; } = new List { 20, 40, 80, 100, 200 }; - private TraceSearchModel TraceSearchModel { get; set; } = new(); - - private List SortList { get; } = new() { "LogTime desc" }; + private TraceSearchModel TraceSearchModel { get; } = new(); [Inject] [NotNull]