diff --git a/src/Hangfire.Core/Dashboard/Content/css/hangfire.css b/src/Hangfire.Core/Dashboard/Content/css/hangfire.css index d23e3621d..df14d5e99 100644 --- a/src/Hangfire.Core/Dashboard/Content/css/hangfire.css +++ b/src/Hangfire.Core/Dashboard/Content/css/hangfire.css @@ -531,3 +531,25 @@ div.metric-null { width: 262.5px; } } + +.ellipsis { + width: 220px; + overflow: hidden; + text-overflow: ellipsis; + display: inline-block; + cursor: pointer; +} + +.ellipsis-wrap { + white-space: nowrap; +} + +@media (min-width: 1200px) { + .ellipsis { + width: 420px; + } +} + +#paginator-filter { + width: 320px; +} \ No newline at end of file diff --git a/src/Hangfire.Core/Dashboard/Content/js/hangfire.js b/src/Hangfire.Core/Dashboard/Content/js/hangfire.js index 59a9c5734..f0f405ac6 100644 --- a/src/Hangfire.Core/Dashboard/Content/js/hangfire.js +++ b/src/Hangfire.Core/Dashboard/Content/js/hangfire.js @@ -361,6 +361,18 @@ e.preventDefault(); }); + $(document).on('change', '#paginator-filter', function(e) { + var filter = $("#paginator-filter").val(); + var url = $(this).data('href') + filter; + window.location = url; + e.preventDefault(); + }); + + $(document).on('click', '.toggle-ellipsis', function (e) { + $(this).closest('td').first().toggleClass('ellipsis-wrap'); + }); + + $(document).on('click', '.expander', function (e) { var $expander = $(this), $expandable = $expander.closest('tr').next().find('.expandable'); diff --git a/src/Hangfire.Core/Dashboard/Content/resx/Strings.Designer.cs b/src/Hangfire.Core/Dashboard/Content/resx/Strings.Designer.cs index 8b1d990dd..479620946 100644 --- a/src/Hangfire.Core/Dashboard/Content/resx/Strings.Designer.cs +++ b/src/Hangfire.Core/Dashboard/Content/resx/Strings.Designer.cs @@ -10,6 +10,7 @@ using System.Reflection; + namespace Hangfire.Dashboard.Resources { using System; @@ -116,6 +117,15 @@ public static string AwaitingJobsPage_Title { } } + /// + /// Looks up a localized string similar to Arguments. + /// + public static string Common_Arguments { + get { + return ResourceManager.GetString("Common_Arguments", resourceCulture); + } + } + /// /// Looks up a localized string similar to Can not find the target method.. /// @@ -882,6 +892,15 @@ public static string Paginator_TotalItems { } } + /// + /// Looks up a localized string similar to All. + /// + public static string PerPageSelector_All { + get { + return ResourceManager.GetString("PerPageSelector_All", resourceCulture); + } + } + /// /// Looks up a localized string similar to Items per page. /// @@ -955,7 +974,7 @@ public static string QueuesPage_Table_Length { } /// - /// Looks up a localized string similar to Nexts jobs. + /// Looks up a localized string similar to Next jobs. /// public static string QueuesPage_Table_NextsJobs { get { diff --git a/src/Hangfire.Core/Dashboard/Content/resx/Strings.resx b/src/Hangfire.Core/Dashboard/Content/resx/Strings.resx index cba4bd5a0..d3c0fac9d 100644 --- a/src/Hangfire.Core/Dashboard/Content/resx/Strings.resx +++ b/src/Hangfire.Core/Dashboard/Content/resx/Strings.resx @@ -523,4 +523,10 @@ Succeeded - + + Arguments + + + All + + \ No newline at end of file diff --git a/src/Hangfire.Core/Dashboard/HtmlHelper.cs b/src/Hangfire.Core/Dashboard/HtmlHelper.cs index 5fb88b9e4..4b48b4fba 100644 --- a/src/Hangfire.Core/Dashboard/HtmlHelper.cs +++ b/src/Hangfire.Core/Dashboard/HtmlHelper.cs @@ -26,6 +26,7 @@ using Hangfire.Annotations; using Hangfire.Dashboard.Pages; using Hangfire.Dashboard.Resources; +using Newtonsoft.Json; namespace Hangfire.Dashboard { @@ -80,6 +81,12 @@ public NonEscapedString PerPageSelector([NotNull] Pager pager) return RenderPartial(new PerPageSelector(pager)); } + public NonEscapedString Filter([NotNull] Pager pager) + { + if (pager == null) throw new ArgumentNullException(nameof(pager)); + return RenderPartial(new Filter(pager)); + } + public NonEscapedString RenderPartial(RazorPage partialPage) { partialPage.Assign(_page); @@ -144,6 +151,11 @@ public NonEscapedString JobNameLink(string jobId, Job job) return Raw($"{HtmlEncode(JobName(job))}"); } + public NonEscapedString JobArguments(Job job) + { + var serialized = JsonConvert.SerializeObject(job?.Args, Formatting.Indented); + return Raw($"{HtmlEncode(serialized)}"); + } public NonEscapedString RelativeTime(DateTime value) { return Raw($"{value}"); diff --git a/src/Hangfire.Core/Dashboard/Pager.cs b/src/Hangfire.Core/Dashboard/Pager.cs index 09995f551..76fcf1822 100644 --- a/src/Hangfire.Core/Dashboard/Pager.cs +++ b/src/Hangfire.Core/Dashboard/Pager.cs @@ -27,12 +27,13 @@ public class Pager private int _startPageIndex = 1; private int _endPageIndex = 1; - public Pager(int from, int perPage, long total) + public Pager(int from, int perPage, long total, string filter, int defaultRecordsPerPage) { FromRecord = from >= 0 ? from : 0; - RecordsPerPage = perPage > 0 ? perPage : DefaultRecordsPerPage; + RecordsPerPage = perPage > 0 ? perPage : (defaultRecordsPerPage > 0 ? defaultRecordsPerPage : DefaultRecordsPerPage); TotalRecordCount = total; CurrentPage = FromRecord / RecordsPerPage + 1; + Filter = filter; TotalPageCount = (int)Math.Ceiling((double)TotalRecordCount / RecordsPerPage); PagerItems = GenerateItems(); @@ -43,6 +44,7 @@ public Pager(int from, int perPage, long total) public int FromRecord { get; } public int RecordsPerPage { get; } public int CurrentPage { get; } + public string Filter { get; } public int TotalPageCount { get; } public long TotalRecordCount { get; } @@ -53,13 +55,18 @@ public string PageUrl(int page) { if (page < 1 || page > TotalPageCount) return "#"; - return BasePageUrl + "?from=" + (page - 1) * RecordsPerPage + "&count=" + RecordsPerPage; + return BasePageUrl + "?from=" + (page - 1) * RecordsPerPage + "&count=" + RecordsPerPage + "&filter=" + Filter; } public string RecordsPerPageUrl(int perPage) { if (perPage <= 0) return "#"; - return BasePageUrl + "?from=0&count=" + perPage; + return BasePageUrl + "?from=0&count=" + perPage + "&filter=" + Filter; + } + + public string FilterUrl() + { + return BasePageUrl + "?from=0&count=" + RecordsPerPage + "&filter="; } private ICollection GenerateItems() diff --git a/src/Hangfire.Core/Dashboard/Pages/AwaitingJobsPage.cshtml b/src/Hangfire.Core/Dashboard/Pages/AwaitingJobsPage.cshtml index d3f5e5629..cc64405ef 100644 --- a/src/Hangfire.Core/Dashboard/Pages/AwaitingJobsPage.cshtml +++ b/src/Hangfire.Core/Dashboard/Pages/AwaitingJobsPage.cshtml @@ -11,6 +11,7 @@ Layout = new LayoutPage(Strings.AwaitingJobsPage_Title); int from, perPage; + var filter = Query("filter"); int.TryParse(Query("from"), out from); int.TryParse(Query("count"), out perPage); @@ -24,7 +25,7 @@ if (storageConnection != null) { - pager = new Pager(from, perPage, storageConnection.GetSetCount("awaiting")); + pager = new Pager(from, perPage, storageConnection.GetSetCount("awaiting"), null, DefaultRecordsPerPage); jobIds = storageConnection.GetRangeFromSet("awaiting", pager.FromRecord, pager.FromRecord + pager.RecordsPerPage - 1); } } @@ -63,7 +64,6 @@ @Strings.Common_DeleteSelected - @Html.PerPageSelector(pager)
@@ -75,6 +75,10 @@ @Strings.Common_Id @Strings.Common_Job + @if (DisplayArgumentsInLists) + { + @Strings.Common_Arguments + } @Strings.AwaitingJobsPage_Table_Options @Strings.AwaitingJobsPage_Table_Parent @Strings.Common_Created @@ -107,13 +111,19 @@ @if (jobData == null) { - @Strings.Common_JobExpired + @Strings.Common_JobExpired } else { @Html.JobNameLink(jobId, jobData.Job) + @if (DisplayArgumentsInLists) + { + + @Html.JobArguments(jobData.Job) + + } @if (stateData != null && stateData.Data.ContainsKey("Options") && !String.IsNullOrWhiteSpace(stateData.Data["Options"])) { @@ -147,7 +157,11 @@
- @Html.Paginator(pager) +
+ @Html.Paginator(pager) + + @Html.PerPageSelector(pager) +
} else diff --git a/src/Hangfire.Core/Dashboard/Pages/AwaitingJobsPage.generated.cs b/src/Hangfire.Core/Dashboard/Pages/AwaitingJobsPage.generated.cs index 3fb61637a..431dbfd31 100644 --- a/src/Hangfire.Core/Dashboard/Pages/AwaitingJobsPage.generated.cs +++ b/src/Hangfire.Core/Dashboard/Pages/AwaitingJobsPage.generated.cs @@ -82,6 +82,7 @@ public override void Execute() Layout = new LayoutPage(Strings.AwaitingJobsPage_Title); int from, perPage; + var filter = Query("filter"); int.TryParse(Query("from"), out from); int.TryParse(Query("count"), out perPage); @@ -95,7 +96,7 @@ public override void Execute() if (storageConnection != null) { - pager = new Pager(from, perPage, storageConnection.GetSetCount("awaiting")); + pager = new Pager(from, perPage, storageConnection.GetSetCount("awaiting"), null, DefaultRecordsPerPage); jobIds = storageConnection.GetRangeFromSet("awaiting", pager.FromRecord, pager.FromRecord + pager.RecordsPerPage - 1); } } @@ -108,7 +109,7 @@ public override void Execute() - #line 35 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" + #line 36 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" Write(Html.JobsSidebar()); @@ -118,7 +119,7 @@ public override void Execute() - #line 38 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" + #line 39 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" Write(Strings.AwaitingJobsPage_Title); @@ -128,7 +129,7 @@ public override void Execute() - #line 40 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" + #line 41 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" if (jobIds == null) { @@ -139,7 +140,7 @@ public override void Execute() - #line 43 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" + #line 44 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" Write(Strings.AwaitingJobsPage_ContinuationsWarning_Title); @@ -149,7 +150,7 @@ public override void Execute() - #line 44 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" + #line 45 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" Write(Strings.AwaitingJobsPage_ContinuationsWarning_Text); @@ -159,7 +160,7 @@ public override void Execute() - #line 46 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" + #line 47 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" } else if (jobIds.Count > 0) { @@ -173,7 +174,7 @@ public override void Execute() - #line 52 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" + #line 53 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" Write(Url.To("/jobs/awaiting/enqueue")); @@ -183,7 +184,7 @@ public override void Execute() - #line 53 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" + #line 54 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" Write(Strings.Common_Enqueueing); @@ -194,7 +195,7 @@ public override void Execute() - #line 55 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" + #line 56 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" Write(Strings.Common_EnqueueButton_Text); @@ -205,7 +206,7 @@ public override void Execute() - #line 59 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" + #line 60 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" Write(Url.To("/jobs/awaiting/delete")); @@ -215,7 +216,7 @@ public override void Execute() - #line 60 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" + #line 61 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" Write(Strings.Common_Deleting); @@ -225,7 +226,7 @@ public override void Execute() - #line 61 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" + #line 62 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" Write(Strings.Common_DeleteConfirm); @@ -236,23 +237,15 @@ public override void Execute() - #line 63 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" + #line 64 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" Write(Strings.Common_DeleteSelected); - #line default - #line hidden -WriteLiteral("\r\n \r\n\r\n "); - - - - #line 66 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" - Write(Html.PerPageSelector(pager)); - - #line default #line hidden WriteLiteral(@" + +
@@ -282,11 +275,42 @@ public override void Execute() #line default #line hidden -WriteLiteral("\r\n "); +WriteLiteral("\r\n"); #line 78 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" + if (DisplayArgumentsInLists) + { + + + #line default + #line hidden +WriteLiteral(" "); + + + + #line 80 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" + Write(Strings.Common_Arguments); + + + #line default + #line hidden +WriteLiteral("\r\n"); + + + + #line 81 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" + } + + + #line default + #line hidden +WriteLiteral(" "); + + + + #line 82 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" Write(Strings.AwaitingJobsPage_Table_Options); @@ -296,7 +320,7 @@ public override void Execute() - #line 79 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" + #line 83 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" Write(Strings.AwaitingJobsPage_Table_Parent); @@ -306,7 +330,7 @@ public override void Execute() - #line 80 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" + #line 84 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" Write(Strings.Common_Created); @@ -317,7 +341,7 @@ public override void Execute() - #line 84 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" + #line 88 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" foreach (var jobId in jobIds) { JobData jobData; @@ -343,7 +367,7 @@ public override void Execute() - #line 101 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" + #line 105 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" Write(jobData != null ? "hover" : null); @@ -354,7 +378,7 @@ public override void Execute() - #line 103 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" + #line 107 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" Write(jobId); @@ -365,7 +389,7 @@ public override void Execute() - #line 106 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" + #line 110 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" Write(Html.JobIdLink(jobId)); @@ -375,19 +399,29 @@ public override void Execute() - #line 108 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" + #line 112 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" if (jobData == null) { #line default #line hidden -WriteLiteral(" "); +WriteLiteral(" "); + + + + #line 114 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" + Write(Strings.Common_JobExpired); #line default @@ -396,7 +430,7 @@ public override void Execute() - #line 111 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" + #line 115 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" } else { @@ -409,7 +443,7 @@ public override void Execute() - #line 115 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" + #line 119 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" Write(Html.JobNameLink(jobId, jobData.Job)); @@ -418,12 +452,52 @@ public override void Execute() WriteLiteral("\r\n \r\n"); + + #line 121 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" + + + #line default + #line hidden + + #line 121 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" + if (DisplayArgumentsInLists) + { + + + #line default + #line hidden +WriteLiteral(" \r\n" + +" "); + + + + #line 124 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" + Write(Html.JobArguments(jobData.Job)); + + + #line default + #line hidden +WriteLiteral("\r\n \r\n"); + + + + #line 126 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" + } + + #line default + #line hidden + + #line 126 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" + + + #line default + #line hidden WriteLiteral(" \r\n"); - #line 118 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" + #line 128 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" if (stateData != null && stateData.Data.ContainsKey("Options") && !String.IsNullOrWhiteSpace(stateData.Data["Options"])) { @@ -434,7 +508,7 @@ public override void Execute() - #line 120 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" + #line 130 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" Write(stateData.Data["Options"]); @@ -444,7 +518,7 @@ public override void Execute() - #line 121 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" + #line 131 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" } else { @@ -456,7 +530,7 @@ public override void Execute() - #line 124 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" + #line 134 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" Write(Strings.Common_NotAvailable); @@ -466,7 +540,7 @@ public override void Execute() - #line 125 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" + #line 135 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" } @@ -480,7 +554,7 @@ public override void Execute() - #line 128 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" + #line 138 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" if (parentStateData != null) { @@ -491,7 +565,7 @@ public override void Execute() - #line 130 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" + #line 140 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" Write(Url.JobDetails(stateData.Data["ParentId"])); @@ -502,7 +576,7 @@ public override void Execute() - #line 131 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" + #line 141 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" Write($"background-color: {JobHistoryRenderer.GetForegroundStateColor(parentStateData.Name)};"); @@ -512,7 +586,7 @@ public override void Execute() - #line 132 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" + #line 142 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" Write(parentStateData.Name); @@ -523,7 +597,7 @@ public override void Execute() - #line 135 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" + #line 145 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" } else { @@ -535,7 +609,7 @@ public override void Execute() - #line 138 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" + #line 148 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" Write(Strings.Common_NotAvailable); @@ -545,7 +619,7 @@ public override void Execute() - #line 139 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" + #line 149 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" } @@ -560,7 +634,7 @@ public override void Execute() - #line 142 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" + #line 152 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" Write(Html.RelativeTime(jobData.CreatedAt)); @@ -570,7 +644,7 @@ public override void Execute() - #line 144 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" + #line 154 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" } @@ -580,28 +654,38 @@ public override void Execute() - #line 146 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" + #line 156 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" } #line default #line hidden WriteLiteral(" \r\n \r\n <" + -"/div>\r\n "); +"/div>\r\n
\r\n "); - #line 150 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" - Write(Html.Paginator(pager)); + #line 161 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" + Write(Html.Paginator(pager)); #line default #line hidden -WriteLiteral("\r\n
\r\n"); +WriteLiteral("\r\n\r\n "); - #line 152 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" + #line 163 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" + Write(Html.PerPageSelector(pager)); + + + #line default + #line hidden +WriteLiteral("\r\n
\r\n \r\n"); + + + + #line 166 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" } else { @@ -613,7 +697,7 @@ public override void Execute() - #line 156 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" + #line 170 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" Write(Strings.AwaitingJobsPage_NoJobs); @@ -623,7 +707,7 @@ public override void Execute() - #line 158 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" + #line 172 "..\..\Dashboard\Pages\AwaitingJobsPage.cshtml" } diff --git a/src/Hangfire.Core/Dashboard/Pages/DeletedJobsPage.cshtml b/src/Hangfire.Core/Dashboard/Pages/DeletedJobsPage.cshtml index 9d847030c..77f5414e8 100644 --- a/src/Hangfire.Core/Dashboard/Pages/DeletedJobsPage.cshtml +++ b/src/Hangfire.Core/Dashboard/Pages/DeletedJobsPage.cshtml @@ -7,13 +7,14 @@ Layout = new LayoutPage(Strings.DeletedJobsPage_Title); int from, perPage; + var filter = Query("filter"); int.TryParse(Query("from"), out from); int.TryParse(Query("count"), out perPage); var monitor = Storage.GetMonitoringApi(); - var pager = new Pager(from, perPage, monitor.DeletedListCount()); - var jobs = monitor.DeletedJobs(pager.FromRecord, pager.RecordsPerPage); + var pager = new Pager(from, perPage, monitor.DeletedListCount(filter), filter, DefaultRecordsPerPage); + var jobs = monitor.DeletedJobs(pager.FromRecord, pager.RecordsPerPage, filter); }
@@ -40,7 +41,11 @@ @Strings.Common_RequeueJobs - @Html.PerPageSelector(pager) + + @if (EnableJobFilters) + { + @Html.Filter(pager) + }
@@ -51,6 +56,10 @@ + @if (DisplayArgumentsInLists) + { + + } @@ -74,13 +83,19 @@ @if (job.Value == null) { - + } else { + @if (DisplayArgumentsInLists) + { + + }
@Strings.Common_Id @Strings.Common_Job@Strings.Common_Arguments@Strings.DeletedJobsPage_Table_Deleted
@Strings.Common_JobExpired@Strings.Common_JobExpired @Html.JobNameLink(job.Key, job.Value.Job) + @Html.JobArguments(job.Value.Job) + @if (job.Value.DeletedAt.HasValue) { @@ -94,7 +109,11 @@
- @Html.Paginator(pager) +
+ @Html.Paginator(pager) + + @Html.PerPageSelector(pager) +
} diff --git a/src/Hangfire.Core/Dashboard/Pages/DeletedJobsPage.generated.cs b/src/Hangfire.Core/Dashboard/Pages/DeletedJobsPage.generated.cs index ead5476d6..f276fa1dc 100644 --- a/src/Hangfire.Core/Dashboard/Pages/DeletedJobsPage.generated.cs +++ b/src/Hangfire.Core/Dashboard/Pages/DeletedJobsPage.generated.cs @@ -56,13 +56,14 @@ public override void Execute() Layout = new LayoutPage(Strings.DeletedJobsPage_Title); int from, perPage; + var filter = Query("filter"); int.TryParse(Query("from"), out from); int.TryParse(Query("count"), out perPage); var monitor = Storage.GetMonitoringApi(); - var pager = new Pager(from, perPage, monitor.DeletedListCount()); - var jobs = monitor.DeletedJobs(pager.FromRecord, pager.RecordsPerPage); + var pager = new Pager(from, perPage, monitor.DeletedListCount(filter), filter, DefaultRecordsPerPage); + var jobs = monitor.DeletedJobs(pager.FromRecord, pager.RecordsPerPage, filter); @@ -72,7 +73,7 @@ public override void Execute() - #line 21 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" + #line 22 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" Write(Html.JobsSidebar()); @@ -82,7 +83,7 @@ public override void Execute() - #line 24 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" + #line 25 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" Write(Strings.DeletedJobsPage_Title); @@ -92,7 +93,7 @@ public override void Execute() - #line 26 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" + #line 27 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" if (pager.TotalPageCount == 0) { @@ -103,7 +104,7 @@ public override void Execute() - #line 29 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" + #line 30 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" Write(Strings.DeletedJobsPage_NoJobs); @@ -113,7 +114,7 @@ public override void Execute() - #line 31 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" + #line 32 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" } else { @@ -127,7 +128,7 @@ public override void Execute() - #line 37 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" + #line 38 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" Write(Url.To("/jobs/deleted/requeue")); @@ -137,7 +138,7 @@ public override void Execute() - #line 38 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" + #line 39 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" Write(Strings.Common_Enqueueing); @@ -148,24 +149,39 @@ public override void Execute() - #line 41 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" + #line 42 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" Write(Strings.Common_RequeueJobs); #line default #line hidden -WriteLiteral("\r\n \r\n "); +WriteLiteral("\r\n \r\n\r\n"); - #line 43 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" - Write(Html.PerPageSelector(pager)); + #line 45 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" + if (EnableJobFilters) + { + + + #line default + #line hidden + + #line 47 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" + Write(Html.Filter(pager)); + + + #line default + #line hidden + + #line 47 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" + + } #line default #line hidden -WriteLiteral(@" - +WriteLiteral(@"
@@ -177,7 +193,7 @@ public override void Execute() - #line 52 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" + #line 57 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" Write(Strings.Common_Id); @@ -187,17 +203,48 @@ public override void Execute() - #line 53 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" + #line 58 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" Write(Strings.Common_Job); #line default #line hidden -WriteLiteral("\r\n \r\n"); + + + + #line 59 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" + if (DisplayArgumentsInLists) + { + + + #line default + #line hidden +WriteLiteral(" \r\n"); + + + + #line 62 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" + } + + + #line default + #line hidden +WriteLiteral(" \r\n"); + + #line 93 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" + + + #line default + #line hidden + + #line 93 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" + if (DisplayArgumentsInLists) + { + + + #line default + #line hidden +WriteLiteral(" \r\n"); + + + + #line 98 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" + } + + #line default + #line hidden + + #line 98 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" + + + #line default + #line hidden WriteLiteral("
"); +WriteLiteral(""); + + + #line 61 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" + Write(Strings.Common_Arguments); - #line 54 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" + #line default + #line hidden +WriteLiteral(""); + + + + #line 63 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" Write(Strings.DeletedJobsPage_Table_Deleted); @@ -208,7 +255,7 @@ public override void Execute() - #line 58 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" + #line 67 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" foreach (var job in jobs) { @@ -219,7 +266,7 @@ public override void Execute() - #line 60 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" + #line 69 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" Write(job.Value == null || !job.Value.InDeletedState ? "obsolete-data" : null); @@ -229,7 +276,7 @@ public override void Execute() - #line 60 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" + #line 69 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" Write(job.Value != null && job.Value.InDeletedState && job.Value != null ? "hover" : null); @@ -239,7 +286,7 @@ public override void Execute() - #line 62 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" + #line 71 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" if (job.Value == null || job.Value.InDeletedState) { @@ -251,7 +298,7 @@ public override void Execute() - #line 64 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" + #line 73 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" Write(job.Key); @@ -261,7 +308,7 @@ public override void Execute() - #line 65 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" + #line 74 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" } @@ -272,7 +319,7 @@ public override void Execute() - #line 68 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" + #line 77 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" Write(Html.JobIdLink(job.Key)); @@ -282,7 +329,7 @@ public override void Execute() - #line 69 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" + #line 78 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" if (job.Value != null && !job.Value.InDeletedState) { @@ -293,7 +340,7 @@ public override void Execute() - #line 71 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" + #line 80 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" Write(Strings.Common_JobStateChanged_Text); @@ -303,7 +350,7 @@ public override void Execute() - #line 72 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" + #line 81 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" } @@ -313,19 +360,29 @@ public override void Execute() - #line 75 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" + #line 84 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" if (job.Value == null) { #line default #line hidden -WriteLiteral(" "); +WriteLiteral(" \r\n" + +" "); + + + + #line 96 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" + Write(Html.JobArguments(job.Value.Job)); + + + #line default + #line hidden +WriteLiteral("\r\n \r\n"); - #line 85 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" + #line 100 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" if (job.Value.DeletedAt.HasValue) { @@ -369,14 +466,14 @@ public override void Execute() #line default #line hidden - #line 87 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" + #line 102 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" Write(Html.RelativeTime(job.Value.DeletedAt.Value)); #line default #line hidden - #line 87 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" + #line 102 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" } @@ -387,7 +484,7 @@ public override void Execute() - #line 90 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" + #line 105 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" } @@ -397,28 +494,38 @@ public override void Execute() - #line 92 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" + #line 107 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" } #line default #line hidden WriteLiteral(" \r\n
\r\n <" + -"/div>\r\n\r\n "); +"/div>\r\n\r\n
\r\n "); - #line 97 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" - Write(Html.Paginator(pager)); + #line 113 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" + Write(Html.Paginator(pager)); #line default #line hidden -WriteLiteral("\r\n
\r\n"); +WriteLiteral("\r\n\r\n "); + + + + #line 115 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" + Write(Html.PerPageSelector(pager)); + + + #line default + #line hidden +WriteLiteral("\r\n
\r\n \r\n"); - #line 99 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" + #line 118 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" } diff --git a/src/Hangfire.Core/Dashboard/Pages/EnqueuedJobsPage.cshtml b/src/Hangfire.Core/Dashboard/Pages/EnqueuedJobsPage.cshtml index b426e9c4d..9d9d71b2c 100644 --- a/src/Hangfire.Core/Dashboard/Pages/EnqueuedJobsPage.cshtml +++ b/src/Hangfire.Core/Dashboard/Pages/EnqueuedJobsPage.cshtml @@ -9,13 +9,14 @@ Layout = new LayoutPage(Queue.ToUpperInvariant()); int from, perPage; + var filter = Query("filter"); int.TryParse(Query("from"), out from); int.TryParse(Query("count"), out perPage); var monitor = Storage.GetMonitoringApi(); - var pager = new Pager(from, perPage, monitor.EnqueuedCount(Queue)); - var enqueuedJobs = monitor.EnqueuedJobs(Queue, pager.FromRecord, pager.RecordsPerPage); + var pager = new Pager(from, perPage, monitor.EnqueuedCount(Queue, filter), filter, DefaultRecordsPerPage); + var enqueuedJobs = monitor.EnqueuedJobs(Queue, pager.FromRecord, pager.RecordsPerPage, filter); }
@@ -49,7 +50,10 @@ @Strings.Common_DeleteSelected - @Html.PerPageSelector(pager) + @if (EnableJobFilters) + { + @Html.Filter(pager) + }
@@ -62,6 +66,10 @@ @Strings.Common_Id @Strings.Common_State @Strings.Common_Job + @if (DisplayArgumentsInLists) + { + @Strings.Common_Arguments + } @Strings.Common_Enqueued @@ -84,7 +92,7 @@ @if (job.Value == null) { - @Strings.Common_JobExpired + @Strings.Common_JobExpired } else { @@ -94,6 +102,12 @@ @Html.JobNameLink(job.Key, job.Value.Job) + @if (DisplayArgumentsInLists) + { + + @Html.JobArguments(job.Value.Job) + + } @if (job.Value.EnqueuedAt.HasValue) { @@ -111,7 +125,11 @@
- @Html.Paginator(pager) +
+ @Html.Paginator(pager) + + @Html.PerPageSelector(pager) +
} diff --git a/src/Hangfire.Core/Dashboard/Pages/EnqueuedJobsPage.generated.cs b/src/Hangfire.Core/Dashboard/Pages/EnqueuedJobsPage.generated.cs index fcb10dade..7beb12e03 100644 --- a/src/Hangfire.Core/Dashboard/Pages/EnqueuedJobsPage.generated.cs +++ b/src/Hangfire.Core/Dashboard/Pages/EnqueuedJobsPage.generated.cs @@ -69,13 +69,14 @@ public override void Execute() Layout = new LayoutPage(Queue.ToUpperInvariant()); int from, perPage; + var filter = Query("filter"); int.TryParse(Query("from"), out from); int.TryParse(Query("count"), out perPage); var monitor = Storage.GetMonitoringApi(); - var pager = new Pager(from, perPage, monitor.EnqueuedCount(Queue)); - var enqueuedJobs = monitor.EnqueuedJobs(Queue, pager.FromRecord, pager.RecordsPerPage); + var pager = new Pager(from, perPage, monitor.EnqueuedCount(Queue, filter), filter, DefaultRecordsPerPage); + var enqueuedJobs = monitor.EnqueuedJobs(Queue, pager.FromRecord, pager.RecordsPerPage, filter); @@ -85,7 +86,7 @@ public override void Execute() - #line 23 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" + #line 24 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" Write(Html.JobsSidebar()); @@ -95,7 +96,7 @@ public override void Execute() - #line 26 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" + #line 27 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" Write(Html.Breadcrumbs(Queue.ToUpperInvariant(), new Dictionary { { "Queues", Url.LinkToQueues() } @@ -108,7 +109,7 @@ public override void Execute() - #line 31 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" + #line 32 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" Write(Queue.ToUpperInvariant()); @@ -118,7 +119,7 @@ public override void Execute() - #line 31 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" + #line 32 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" Write(Strings.EnqueuedJobsPage_Title); @@ -128,7 +129,7 @@ public override void Execute() - #line 33 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" + #line 34 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" if (pager.TotalPageCount == 0) { @@ -139,7 +140,7 @@ public override void Execute() - #line 36 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" + #line 37 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" Write(Strings.EnqueuedJobsPage_NoJobs); @@ -149,7 +150,7 @@ public override void Execute() - #line 38 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" + #line 39 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" } else { @@ -163,7 +164,7 @@ public override void Execute() - #line 44 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" + #line 45 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" Write(Url.To("/jobs/enqueued/delete")); @@ -173,7 +174,7 @@ public override void Execute() - #line 45 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" + #line 46 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" Write(Strings.Common_Deleting); @@ -183,7 +184,7 @@ public override void Execute() - #line 46 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" + #line 47 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" Write(Strings.Common_DeleteConfirm); @@ -194,24 +195,39 @@ public override void Execute() - #line 49 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" + #line 50 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" Write(Strings.Common_DeleteSelected); #line default #line hidden -WriteLiteral("\r\n \r\n\r\n "); +WriteLiteral("\r\n \r\n\r\n"); - #line 52 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" - Write(Html.PerPageSelector(pager)); + #line 53 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" + if (EnableJobFilters) + { + + + #line default + #line hidden + + #line 55 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" + Write(Html.Filter(pager)); + + + #line default + #line hidden + + #line 55 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" + + } #line default #line hidden -WriteLiteral(@" - +WriteLiteral(@"
@@ -224,7 +240,7 @@ public override void Execute() - #line 62 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" + #line 66 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" Write(Strings.Common_Id); @@ -234,7 +250,7 @@ public override void Execute() - #line 63 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" + #line 67 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" Write(Strings.Common_State); @@ -244,17 +260,48 @@ public override void Execute() - #line 64 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" + #line 68 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" Write(Strings.Common_Job); #line default #line hidden -WriteLiteral("\r\n \r\n"); + + + + #line 69 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" + if (DisplayArgumentsInLists) + { + + + #line default + #line hidden +WriteLiteral(" \r\n"); - #line 65 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" + #line 72 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" + } + + + #line default + #line hidden +WriteLiteral(" \r\n"); + + #line 105 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" + + + #line default + #line hidden + + #line 105 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" + if (DisplayArgumentsInLists) + { + + + #line default + #line hidden +WriteLiteral(" \r\n"); + + + #line 110 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" + } + + #line default + #line hidden + + #line 110 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" + + + + #line default + #line hidden WriteLiteral(" \r\n
"); +WriteLiteral(""); + + + + #line 71 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" + Write(Strings.Common_Arguments); + + + #line default + #line hidden +WriteLiteral(""); + + + + #line 73 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" Write(Strings.Common_Enqueued); @@ -265,7 +312,7 @@ public override void Execute() - #line 69 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" + #line 77 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" foreach (var job in enqueuedJobs) { @@ -276,7 +323,7 @@ public override void Execute() - #line 71 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" + #line 79 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" Write(job.Value == null || !job.Value.InEnqueuedState ? "obsolete-data" : null); @@ -286,7 +333,7 @@ public override void Execute() - #line 73 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" + #line 81 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" if (job.Value != null) { @@ -298,7 +345,7 @@ public override void Execute() - #line 75 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" + #line 83 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" Write(job.Key); @@ -308,7 +355,7 @@ public override void Execute() - #line 76 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" + #line 84 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" } @@ -319,7 +366,7 @@ public override void Execute() - #line 79 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" + #line 87 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" Write(Html.JobIdLink(job.Key)); @@ -329,7 +376,7 @@ public override void Execute() - #line 80 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" + #line 88 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" if (job.Value != null && !job.Value.InEnqueuedState) { @@ -340,7 +387,7 @@ public override void Execute() - #line 82 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" + #line 90 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" Write(Strings.Common_JobStateChanged_Text); @@ -350,7 +397,7 @@ public override void Execute() - #line 83 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" + #line 91 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" } @@ -360,19 +407,29 @@ public override void Execute() - #line 85 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" + #line 93 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" if (job.Value == null) { #line default #line hidden -WriteLiteral(" "); +WriteLiteral(" \r\n " + +" "); + + + + #line 108 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" + Write(Html.JobArguments(job.Value.Job)); + + + #line default + #line hidden +WriteLiteral("\r\n \r\n"); - #line 98 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" + #line 112 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" if (job.Value.EnqueuedAt.HasValue) { @@ -431,14 +528,14 @@ public override void Execute() #line default #line hidden - #line 100 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" + #line 114 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" Write(Html.RelativeTime(job.Value.EnqueuedAt.Value)); #line default #line hidden - #line 100 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" + #line 114 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" } else @@ -451,7 +548,7 @@ public override void Execute() - #line 104 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" + #line 118 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" Write(Strings.Common_NotAvailable); @@ -461,7 +558,7 @@ public override void Execute() - #line 105 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" + #line 119 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" } @@ -471,7 +568,7 @@ public override void Execute() - #line 107 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" + #line 121 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" } @@ -481,28 +578,38 @@ public override void Execute() - #line 109 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" + #line 123 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" } #line default #line hidden WriteLiteral("
\r\n <" + -"/div>\r\n\r\n "); +"/div>\r\n\r\n
\r\n "); - #line 114 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" - Write(Html.Paginator(pager)); + #line 129 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" + Write(Html.Paginator(pager)); #line default #line hidden -WriteLiteral("\r\n
\r\n"); +WriteLiteral("\r\n\r\n "); + + + + #line 131 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" + Write(Html.PerPageSelector(pager)); + + + #line default + #line hidden +WriteLiteral("\r\n
\r\n \r\n"); - #line 116 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" + #line 134 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" } diff --git a/src/Hangfire.Core/Dashboard/Pages/FailedJobsPage.cshtml b/src/Hangfire.Core/Dashboard/Pages/FailedJobsPage.cshtml index 67cc7cf19..a22a0ba7e 100644 --- a/src/Hangfire.Core/Dashboard/Pages/FailedJobsPage.cshtml +++ b/src/Hangfire.Core/Dashboard/Pages/FailedJobsPage.cshtml @@ -8,13 +8,14 @@ Layout = new LayoutPage(Strings.FailedJobsPage_Title); int from, perPage; + var filter = Query("filter"); int.TryParse(Query("from"), out from); int.TryParse(Query("count"), out perPage); var monitor = Storage.GetMonitoringApi(); - var pager = new Pager(from, perPage, monitor.FailedCount()); - var failedJobs = monitor.FailedJobs(pager.FromRecord, pager.RecordsPerPage); + var pager = new Pager(from, perPage, monitor.FailedCount(filter), filter, DefaultRecordsPerPage); + var failedJobs = monitor.FailedJobs(pager.FromRecord, pager.RecordsPerPage, filter); }
@@ -54,7 +55,10 @@ @Strings.Common_DeleteSelected - @Html.PerPageSelector(pager) + @if (EnableJobFilters) + { + @Html.Filter(pager) + }
@@ -67,6 +71,10 @@ @Strings.Common_Id @Strings.FailedJobsPage_Table_Failed @Strings.Common_Job + @if (DisplayArgumentsInLists) + { + @Strings.Common_Arguments + } @@ -104,11 +112,17 @@
} + @if (DisplayArgumentsInLists) + { + + @Html.JobArguments(job.Value.Job) + + } if (job.Value.InFailedState) { - + - @Html.Paginator(pager) +
+ @Html.Paginator(pager) + + @Html.PerPageSelector(pager) +
} diff --git a/src/Hangfire.Core/Dashboard/Pages/FailedJobsPage.generated.cs b/src/Hangfire.Core/Dashboard/Pages/FailedJobsPage.generated.cs index e5e2feacc..ba159ab0c 100644 --- a/src/Hangfire.Core/Dashboard/Pages/FailedJobsPage.generated.cs +++ b/src/Hangfire.Core/Dashboard/Pages/FailedJobsPage.generated.cs @@ -62,13 +62,14 @@ public override void Execute() Layout = new LayoutPage(Strings.FailedJobsPage_Title); int from, perPage; + var filter = Query("filter"); int.TryParse(Query("from"), out from); int.TryParse(Query("count"), out perPage); var monitor = Storage.GetMonitoringApi(); - var pager = new Pager(from, perPage, monitor.FailedCount()); - var failedJobs = monitor.FailedJobs(pager.FromRecord, pager.RecordsPerPage); + var pager = new Pager(from, perPage, monitor.FailedCount(filter), filter, DefaultRecordsPerPage); + var failedJobs = monitor.FailedJobs(pager.FromRecord, pager.RecordsPerPage, filter); @@ -78,7 +79,7 @@ public override void Execute() - #line 22 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" + #line 23 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" Write(Html.JobsSidebar()); @@ -88,7 +89,7 @@ public override void Execute() - #line 25 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" + #line 26 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" Write(Strings.FailedJobsPage_Title); @@ -98,7 +99,7 @@ public override void Execute() - #line 27 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" + #line 28 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" if (pager.TotalPageCount == 0) { @@ -109,7 +110,7 @@ public override void Execute() - #line 30 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" + #line 31 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" Write(Strings.FailedJobsPage_NoJobs); @@ -119,7 +120,7 @@ public override void Execute() - #line 32 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" + #line 33 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" } else { @@ -131,7 +132,7 @@ public override void Execute() - #line 36 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" + #line 37 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" Write(Html.Raw(Strings.FailedJobsPage_FailedJobsNotExpire_Warning_Html)); @@ -141,7 +142,7 @@ public override void Execute() - #line 38 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" + #line 39 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" @@ -153,7 +154,7 @@ public override void Execute() - #line 42 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" + #line 43 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" Write(Url.To("/jobs/failed/requeue")); @@ -163,7 +164,7 @@ public override void Execute() - #line 43 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" + #line 44 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" Write(Strings.Common_Enqueueing); @@ -174,7 +175,7 @@ public override void Execute() - #line 46 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" + #line 47 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" Write(Strings.Common_RequeueJobs); @@ -185,7 +186,7 @@ public override void Execute() - #line 50 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" + #line 51 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" Write(Url.To("/jobs/failed/delete")); @@ -195,7 +196,7 @@ public override void Execute() - #line 51 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" + #line 52 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" Write(Strings.Common_Deleting); @@ -205,7 +206,7 @@ public override void Execute() - #line 52 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" + #line 53 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" Write(Strings.Common_DeleteConfirm); @@ -216,24 +217,39 @@ public override void Execute() - #line 54 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" + #line 55 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" Write(Strings.Common_DeleteSelected); #line default #line hidden -WriteLiteral("\r\n \r\n\r\n "); +WriteLiteral("\r\n \r\n\r\n"); - #line 57 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" - Write(Html.PerPageSelector(pager)); + #line 58 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" + if (EnableJobFilters) + { + + + #line default + #line hidden + + #line 60 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" + Write(Html.Filter(pager)); + + + #line default + #line hidden + + #line 60 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" + + } #line default #line hidden -WriteLiteral(@" - +WriteLiteral(@"
@@ -246,7 +262,7 @@ public override void Execute() - #line 67 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" + #line 71 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" Write(Strings.Common_Id); @@ -256,7 +272,7 @@ public override void Execute() - #line 68 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" + #line 72 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" Write(Strings.FailedJobsPage_Table_Failed); @@ -266,18 +282,49 @@ public override void Execute() - #line 69 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" + #line 73 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" Write(Strings.Common_Job); #line default #line hidden -WriteLiteral("\r\n \r\n \r\n " + -" \r\n"); +WriteLiteral("\r\n"); - #line 73 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" + #line 74 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" + if (DisplayArgumentsInLists) + { + + + #line default + #line hidden +WriteLiteral(" \r\n"); + + + + #line 77 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" + } + + + #line default + #line hidden +WriteLiteral(" \r\n \r\n " + +" \r\n"); + + + + #line 81 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" var index = 0; @@ -285,7 +332,7 @@ public override void Execute() #line hidden - #line 74 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" + #line 82 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" foreach (var job in failedJobs) { @@ -296,7 +343,7 @@ public override void Execute() - #line 76 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" + #line 84 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" Write(!job.Value.InFailedState ? "obsolete-data" : null); @@ -306,7 +353,7 @@ public override void Execute() - #line 76 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" + #line 84 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" Write(job.Value.InFailedState ? "hover" : null); @@ -316,7 +363,7 @@ public override void Execute() - #line 77 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" + #line 85 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" Write(job.Value.InFailedState ? "2" : "1"); @@ -326,7 +373,7 @@ public override void Execute() - #line 78 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" + #line 86 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" if (job.Value.InFailedState) { @@ -338,7 +385,7 @@ public override void Execute() - #line 80 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" + #line 88 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" Write(job.Key); @@ -348,7 +395,7 @@ public override void Execute() - #line 81 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" + #line 89 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" } @@ -359,7 +406,7 @@ public override void Execute() - #line 83 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" + #line 91 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" Write(job.Value.InFailedState ? "2" : "1"); @@ -369,7 +416,7 @@ public override void Execute() - #line 84 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" + #line 92 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" Write(Html.JobIdLink(job.Key)); @@ -379,7 +426,7 @@ public override void Execute() - #line 85 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" + #line 93 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" if (!job.Value.InFailedState) { @@ -390,7 +437,7 @@ public override void Execute() - #line 87 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" + #line 95 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" Write(Strings.Common_JobStateChanged_Text); @@ -400,7 +447,7 @@ public override void Execute() - #line 88 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" + #line 96 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" } @@ -411,7 +458,7 @@ public override void Execute() - #line 91 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" + #line 99 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" if (job.Value.FailedAt.HasValue) { @@ -419,14 +466,14 @@ public override void Execute() #line default #line hidden - #line 93 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" + #line 101 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" Write(Html.RelativeTime(job.Value.FailedAt.Value)); #line default #line hidden - #line 93 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" + #line 101 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" } @@ -439,7 +486,7 @@ public override void Execute() - #line 98 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" + #line 106 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" Write(Html.JobNameLink(job.Key, job.Value.Job)); @@ -449,7 +496,7 @@ public override void Execute() - #line 100 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" + #line 108 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" if (!String.IsNullOrEmpty(job.Value.ExceptionMessage)) { @@ -461,7 +508,7 @@ public override void Execute() - #line 103 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" + #line 111 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" Write(job.Value.Reason); @@ -471,7 +518,7 @@ public override void Execute() - #line 103 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" + #line 111 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" Write(index == 0 ? Strings.Common_LessDetails : Strings.Common_MoreDetails); @@ -481,18 +528,49 @@ public override void Execute() - #line 105 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" + #line 113 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" } #line default #line hidden -WriteLiteral(" \r\n \r" + -"\n"); +WriteLiteral(" \r\n"); - #line 108 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" + #line 115 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" + if (DisplayArgumentsInLists) + { + + + #line default + #line hidden +WriteLiteral(" \r\n"); + + + + #line 120 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" + } + + + #line default + #line hidden +WriteLiteral(" \r\n"); + + + + #line 122 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" if (job.Value.InFailedState) { @@ -500,12 +578,22 @@ public override void Execute() #line default #line hidden WriteLiteral(" \r\n " + -"
"); + + + + #line 76 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" + Write(Strings.Common_Arguments); + + + #line default + #line hidden +WriteLiteral("
\r\n " + +" "); + + + + #line 118 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" + Write(Html.JobArguments(job.Value.Job)); + + + #line default + #line hidden +WriteLiteral("\r\n
\r\n " + -"
\r\n <" + -"/div>\r\n\r\n "); +"/div>\r\n\r\n
\r\n "); - #line 131 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" - Write(Html.Paginator(pager)); + #line 146 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" + Write(Html.Paginator(pager)); #line default #line hidden -WriteLiteral("\r\n
\r\n"); +WriteLiteral("\r\n\r\n "); + + + + #line 148 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" + Write(Html.PerPageSelector(pager)); + + + #line default + #line hidden +WriteLiteral("\r\n
\r\n \r\n"); - #line 133 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" + #line 151 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" } diff --git a/src/Hangfire.Core/Dashboard/Pages/FetchedJobsPage.cshtml b/src/Hangfire.Core/Dashboard/Pages/FetchedJobsPage.cshtml index f29a551ca..1820d8682 100644 --- a/src/Hangfire.Core/Dashboard/Pages/FetchedJobsPage.cshtml +++ b/src/Hangfire.Core/Dashboard/Pages/FetchedJobsPage.cshtml @@ -9,13 +9,14 @@ Layout = new LayoutPage(Queue.ToUpperInvariant()); int from, perPage; + var filter = Query("filter"); int.TryParse(Query("from"), out from); int.TryParse(Query("count"), out perPage); var monitor = Storage.GetMonitoringApi(); - var pager = new Pager(from, perPage, monitor.FetchedCount(Queue)); - var fetchedJobs = monitor.FetchedJobs(Queue, pager.FromRecord, pager.RecordsPerPage); + var pager = new Pager(from, perPage, monitor.FetchedCount(Queue, filter), filter, DefaultRecordsPerPage); + var fetchedJobs = monitor.FetchedJobs(Queue, pager.FromRecord, pager.RecordsPerPage, filter); }
@@ -59,8 +60,11 @@ @Strings.Common_DeleteSelected - - @Html.PerPageSelector(pager) + + @if (EnableJobFilters) + { + @Html.Filter(pager) + }
@@ -73,6 +77,10 @@ @Strings.Common_Id @Strings.Common_State @Strings.Common_Job + @if (DisplayArgumentsInLists) + { + @Strings.Common_Arguments + } @Strings.Common_Fetched @@ -91,7 +99,7 @@ @if (job.Value == null) { - @Strings.Common_JobExpired + @Strings.Common_JobExpired } else { @@ -101,6 +109,12 @@ @Html.JobNameLink(job.Key, job.Value.Job) + @if (DisplayArgumentsInLists) + { + + @Html.JobArguments(job.Value.Job) + + } @if (job.Value.FetchedAt.HasValue) { @@ -114,7 +128,11 @@
- @Html.Paginator(pager) +
+ @Html.Paginator(pager) + + @Html.PerPageSelector(pager) +
} diff --git a/src/Hangfire.Core/Dashboard/Pages/FetchedJobsPage.generated.cs b/src/Hangfire.Core/Dashboard/Pages/FetchedJobsPage.generated.cs index 06b71f082..4ee278b4e 100644 --- a/src/Hangfire.Core/Dashboard/Pages/FetchedJobsPage.generated.cs +++ b/src/Hangfire.Core/Dashboard/Pages/FetchedJobsPage.generated.cs @@ -69,13 +69,14 @@ public override void Execute() Layout = new LayoutPage(Queue.ToUpperInvariant()); int from, perPage; + var filter = Query("filter"); int.TryParse(Query("from"), out from); int.TryParse(Query("count"), out perPage); var monitor = Storage.GetMonitoringApi(); - var pager = new Pager(from, perPage, monitor.FetchedCount(Queue)); - var fetchedJobs = monitor.FetchedJobs(Queue, pager.FromRecord, pager.RecordsPerPage); + var pager = new Pager(from, perPage, monitor.FetchedCount(Queue, filter), filter, DefaultRecordsPerPage); + var fetchedJobs = monitor.FetchedJobs(Queue, pager.FromRecord, pager.RecordsPerPage, filter); @@ -85,7 +86,7 @@ public override void Execute() - #line 23 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" + #line 24 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" Write(Html.JobsSidebar()); @@ -95,7 +96,7 @@ public override void Execute() - #line 26 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" + #line 27 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" Write(Html.Breadcrumbs(Strings.FetchedJobsPage_Title, new Dictionary { { "Queues", Url.LinkToQueues() }, @@ -109,7 +110,7 @@ public override void Execute() - #line 33 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" + #line 34 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" Write(Queue.ToUpperInvariant()); @@ -119,7 +120,7 @@ public override void Execute() - #line 33 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" + #line 34 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" Write(Strings.FetchedJobsPage_Title); @@ -129,7 +130,7 @@ public override void Execute() - #line 36 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" + #line 37 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" if (pager.TotalPageCount == 0) { @@ -140,7 +141,7 @@ public override void Execute() - #line 39 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" + #line 40 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" Write(Strings.FetchedJobsPage_NoJobs); @@ -150,7 +151,7 @@ public override void Execute() - #line 41 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" + #line 42 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" } else { @@ -164,7 +165,7 @@ public override void Execute() - #line 47 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" + #line 48 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" Write(Url.To("/jobs/enqueued/requeue")); @@ -174,7 +175,7 @@ public override void Execute() - #line 48 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" + #line 49 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" Write(Strings.Common_Enqueueing); @@ -185,7 +186,7 @@ public override void Execute() - #line 51 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" + #line 52 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" Write(Strings.Common_RequeueJobs); @@ -196,7 +197,7 @@ public override void Execute() - #line 55 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" + #line 56 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" Write(Url.To("/jobs/enqueued/delete")); @@ -206,7 +207,7 @@ public override void Execute() - #line 56 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" + #line 57 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" Write(Strings.Common_Deleting); @@ -216,7 +217,7 @@ public override void Execute() - #line 57 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" + #line 58 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" Write(Strings.Common_DeleteConfirm); @@ -227,24 +228,39 @@ public override void Execute() - #line 60 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" + #line 61 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" Write(Strings.Common_DeleteSelected); #line default #line hidden -WriteLiteral("\r\n \r\n\r\n "); +WriteLiteral("\r\n \r\n \r\n"); - #line 63 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" - Write(Html.PerPageSelector(pager)); + #line 64 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" + if (EnableJobFilters) + { + + + #line default + #line hidden + + #line 66 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" + Write(Html.Filter(pager)); + + + #line default + #line hidden + + #line 66 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" + + } #line default #line hidden -WriteLiteral(@" - +WriteLiteral(@"
@@ -257,7 +273,7 @@ public override void Execute() - #line 73 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" + #line 77 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" Write(Strings.Common_Id); @@ -267,7 +283,7 @@ public override void Execute() - #line 74 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" + #line 78 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" Write(Strings.Common_State); @@ -277,17 +293,48 @@ public override void Execute() - #line 75 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" + #line 79 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" Write(Strings.Common_Job); #line default #line hidden -WriteLiteral("\r\n \r\n"); + + + + #line 80 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" + if (DisplayArgumentsInLists) + { + + + #line default + #line hidden +WriteLiteral(" \r\n"); + + + + #line 83 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" + } + + + #line default + #line hidden +WriteLiteral(" \r\n"); + + #line 112 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" + + + #line default + #line hidden + + #line 112 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" + if (DisplayArgumentsInLists) + { + + + #line default + #line hidden +WriteLiteral(" \r\n"); + + + + #line 117 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" + } + + #line default + #line hidden + + #line 117 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" + + + #line default + #line hidden WriteLiteral(" \r\n
"); +WriteLiteral(""); - #line 76 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" + #line 82 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" + Write(Strings.Common_Arguments); + + + #line default + #line hidden +WriteLiteral(""); + + + + #line 84 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" Write(Strings.Common_Fetched); @@ -298,7 +345,7 @@ public override void Execute() - #line 80 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" + #line 88 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" foreach (var job in fetchedJobs) { @@ -309,7 +356,7 @@ public override void Execute() - #line 82 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" + #line 90 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" Write(job.Value == null ? "obsolete-data" : null); @@ -319,7 +366,7 @@ public override void Execute() - #line 84 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" + #line 92 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" if (job.Value != null) { @@ -331,7 +378,7 @@ public override void Execute() - #line 86 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" + #line 94 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" Write(job.Key); @@ -341,7 +388,7 @@ public override void Execute() - #line 87 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" + #line 95 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" } @@ -352,7 +399,7 @@ public override void Execute() - #line 90 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" + #line 98 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" Write(Html.JobIdLink(job.Key)); @@ -362,19 +409,29 @@ public override void Execute() - #line 92 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" + #line 100 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" if (job.Value == null) { #line default #line hidden -WriteLiteral(" "); +WriteLiteral(" \r\n " + +" "); + + + + #line 115 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" + Write(Html.JobArguments(job.Value.Job)); + + + #line default + #line hidden +WriteLiteral("\r\n \r\n"); - #line 105 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" + #line 119 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" if (job.Value.FetchedAt.HasValue) { @@ -433,14 +530,14 @@ public override void Execute() #line default #line hidden - #line 107 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" + #line 121 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" Write(Html.RelativeTime(job.Value.FetchedAt.Value)); #line default #line hidden - #line 107 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" + #line 121 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" } @@ -451,7 +548,7 @@ public override void Execute() - #line 110 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" + #line 124 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" } @@ -461,28 +558,38 @@ public override void Execute() - #line 112 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" + #line 126 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" } #line default #line hidden WriteLiteral("
\r\n
\r\n\r\n " + -" "); +"
\r\n "); - #line 117 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" - Write(Html.Paginator(pager)); + #line 132 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" + Write(Html.Paginator(pager)); #line default #line hidden -WriteLiteral("\r\n
\r\n"); +WriteLiteral("\r\n \r\n "); - #line 119 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" + #line 134 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" + Write(Html.PerPageSelector(pager)); + + + #line default + #line hidden +WriteLiteral("\r\n \r\n \r\n"); + + + + #line 137 "..\..\Dashboard\Pages\FetchedJobsPage.cshtml" } diff --git a/src/Hangfire.Core/Dashboard/Pages/Filter.cs b/src/Hangfire.Core/Dashboard/Pages/Filter.cs new file mode 100644 index 000000000..bce9db424 --- /dev/null +++ b/src/Hangfire.Core/Dashboard/Pages/Filter.cs @@ -0,0 +1,12 @@ +namespace Hangfire.Dashboard.Pages +{ + partial class Filter + { + private readonly Pager _pager; + + public Filter(Pager pager) + { + _pager = pager; + } + } +} diff --git a/src/Hangfire.Core/Dashboard/Pages/LayoutPage.cshtml b/src/Hangfire.Core/Dashboard/Pages/LayoutPage.cshtml index 4338c878c..219856697 100644 --- a/src/Hangfire.Core/Dashboard/Pages/LayoutPage.cshtml +++ b/src/Hangfire.Core/Dashboard/Pages/LayoutPage.cshtml @@ -22,7 +22,7 @@ \r\n \r\n"); - #line 140 "..\..\Dashboard\Pages\RetriesPage.cshtml" + #line 152 "..\..\Dashboard\Pages\RetriesPage.cshtml" } @@ -543,7 +625,7 @@ public override void Execute() - #line 143 "..\..\Dashboard\Pages\RetriesPage.cshtml" + #line 155 "..\..\Dashboard\Pages\RetriesPage.cshtml" } #line default diff --git a/src/Hangfire.Core/Dashboard/Pages/ScheduledJobsPage.cshtml b/src/Hangfire.Core/Dashboard/Pages/ScheduledJobsPage.cshtml index 720c9023c..255e6fd7a 100644 --- a/src/Hangfire.Core/Dashboard/Pages/ScheduledJobsPage.cshtml +++ b/src/Hangfire.Core/Dashboard/Pages/ScheduledJobsPage.cshtml @@ -7,13 +7,14 @@ Layout = new LayoutPage(Strings.ScheduledJobsPage_Title); int from, perPage; + var filter = Query("filter"); int.TryParse(Query("from"), out from); int.TryParse(Query("count"), out perPage); var monitor = Storage.GetMonitoringApi(); - var pager = new Pager(from, perPage, monitor.ScheduledCount()); - var scheduledJobs = monitor.ScheduledJobs(pager.FromRecord, pager.RecordsPerPage); + var pager = new Pager(from, perPage, monitor.ScheduledCount(filter), filter, DefaultRecordsPerPage); + var scheduledJobs = monitor.ScheduledJobs(pager.FromRecord, pager.RecordsPerPage, filter); }
@@ -50,7 +51,10 @@ @Strings.Common_DeleteSelected - @Html.PerPageSelector(pager) + @if (EnableJobFilters) + { + @Html.Filter(pager) + }
@@ -63,6 +67,10 @@ @Strings.Common_Id @Strings.ScheduledJobsPage_Table_Enqueue @Strings.Common_Job + @if (DisplayArgumentsInLists) + { + @Strings.Common_Arguments + } @Strings.ScheduledJobsPage_Table_Scheduled @@ -88,6 +96,12 @@ @Html.JobNameLink(job.Key, job.Value.Job) + @if (DisplayArgumentsInLists) + { + + @Html.JobArguments(job.Value.Job) + + } @if (job.Value.ScheduledAt.HasValue) { @@ -99,7 +113,11 @@
- @Html.Paginator(pager) +
+ @Html.Paginator(pager) + + @Html.PerPageSelector(pager) +
} diff --git a/src/Hangfire.Core/Dashboard/Pages/ScheduledJobsPage.generated.cs b/src/Hangfire.Core/Dashboard/Pages/ScheduledJobsPage.generated.cs index 2cb8f14ca..fb02ed5c6 100644 --- a/src/Hangfire.Core/Dashboard/Pages/ScheduledJobsPage.generated.cs +++ b/src/Hangfire.Core/Dashboard/Pages/ScheduledJobsPage.generated.cs @@ -56,13 +56,14 @@ public override void Execute() Layout = new LayoutPage(Strings.ScheduledJobsPage_Title); int from, perPage; + var filter = Query("filter"); int.TryParse(Query("from"), out from); int.TryParse(Query("count"), out perPage); var monitor = Storage.GetMonitoringApi(); - var pager = new Pager(from, perPage, monitor.ScheduledCount()); - var scheduledJobs = monitor.ScheduledJobs(pager.FromRecord, pager.RecordsPerPage); + var pager = new Pager(from, perPage, monitor.ScheduledCount(filter), filter, DefaultRecordsPerPage); + var scheduledJobs = monitor.ScheduledJobs(pager.FromRecord, pager.RecordsPerPage, filter); @@ -72,7 +73,7 @@ public override void Execute() - #line 21 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" + #line 22 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" Write(Html.JobsSidebar()); @@ -82,7 +83,7 @@ public override void Execute() - #line 24 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" + #line 25 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" Write(Strings.ScheduledJobsPage_Title); @@ -92,7 +93,7 @@ public override void Execute() - #line 26 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" + #line 27 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" if (pager.TotalPageCount == 0) { @@ -103,7 +104,7 @@ public override void Execute() - #line 29 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" + #line 30 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" Write(Strings.ScheduledJobsPage_NoJobs); @@ -113,7 +114,7 @@ public override void Execute() - #line 31 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" + #line 32 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" } else { @@ -127,7 +128,7 @@ public override void Execute() - #line 37 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" + #line 38 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" Write(Url.To("/jobs/scheduled/enqueue")); @@ -137,7 +138,7 @@ public override void Execute() - #line 38 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" + #line 39 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" Write(Strings.Common_Enqueueing); @@ -148,7 +149,7 @@ public override void Execute() - #line 41 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" + #line 42 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" Write(Strings.ScheduledJobsPage_EnqueueNow); @@ -159,7 +160,7 @@ public override void Execute() - #line 45 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" + #line 46 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" Write(Url.To("/jobs/scheduled/delete")); @@ -169,7 +170,7 @@ public override void Execute() - #line 46 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" + #line 47 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" Write(Strings.Common_Deleting); @@ -179,7 +180,7 @@ public override void Execute() - #line 47 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" + #line 48 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" Write(Strings.Common_DeleteConfirm); @@ -190,24 +191,39 @@ public override void Execute() - #line 50 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" + #line 51 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" Write(Strings.Common_DeleteSelected); #line default #line hidden -WriteLiteral("\r\n \r\n\r\n "); +WriteLiteral("\r\n \r\n\r\n"); - #line 53 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" - Write(Html.PerPageSelector(pager)); + #line 54 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" + if (EnableJobFilters) + { + + + #line default + #line hidden + + #line 56 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" + Write(Html.Filter(pager)); #line default #line hidden -WriteLiteral(@" - + + #line 56 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" + + } + + + #line default + #line hidden +WriteLiteral(@"
@@ -220,7 +236,7 @@ public override void Execute() - #line 63 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" + #line 67 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" Write(Strings.Common_Id); @@ -230,7 +246,7 @@ public override void Execute() - #line 64 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" + #line 68 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" Write(Strings.ScheduledJobsPage_Table_Enqueue); @@ -240,17 +256,48 @@ public override void Execute() - #line 65 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" + #line 69 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" Write(Strings.Common_Job); #line default #line hidden -WriteLiteral("\r\n \r\n"); + + + + #line 70 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" + if (DisplayArgumentsInLists) + { + + + #line default + #line hidden +WriteLiteral(" \r\n"); + + + + #line 73 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" + } + + + #line default + #line hidden +WriteLiteral(" \r\n"); + + + + #line 99 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" + if (DisplayArgumentsInLists) + { + + + #line default + #line hidden +WriteLiteral(" \r\n"); - #line 92 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" + #line 104 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" + } + + + #line default + #line hidden +WriteLiteral("
"); +WriteLiteral(""); - #line 66 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" + #line 72 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" + Write(Strings.Common_Arguments); + + + #line default + #line hidden +WriteLiteral(""); + + + + #line 74 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" Write(Strings.ScheduledJobsPage_Table_Scheduled); @@ -260,7 +307,7 @@ public override void Execute() - #line 69 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" + #line 77 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" foreach (var job in scheduledJobs) { @@ -271,7 +318,7 @@ public override void Execute() - #line 71 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" + #line 79 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" Write(!job.Value.InScheduledState ? "obsolete-data" : null); @@ -281,7 +328,7 @@ public override void Execute() - #line 71 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" + #line 79 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" Write(job.Value.InScheduledState ? "hover" : null); @@ -291,7 +338,7 @@ public override void Execute() - #line 73 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" + #line 81 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" if (job.Value.InScheduledState) { @@ -303,7 +350,7 @@ public override void Execute() - #line 75 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" + #line 83 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" Write(job.Key); @@ -313,7 +360,7 @@ public override void Execute() - #line 76 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" + #line 84 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" } @@ -324,7 +371,7 @@ public override void Execute() - #line 79 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" + #line 87 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" Write(Html.JobIdLink(job.Key)); @@ -334,7 +381,7 @@ public override void Execute() - #line 80 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" + #line 88 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" if (!job.Value.InScheduledState) { @@ -345,7 +392,7 @@ public override void Execute() - #line 82 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" + #line 90 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" Write(Strings.Common_JobStateChanged_Text); @@ -355,7 +402,7 @@ public override void Execute() - #line 83 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" + #line 91 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" } @@ -366,7 +413,7 @@ public override void Execute() - #line 86 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" + #line 94 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" Write(Html.RelativeTime(job.Value.EnqueueAt)); @@ -377,18 +424,49 @@ public override void Execute() - #line 89 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" + #line 97 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" Write(Html.JobNameLink(job.Key, job.Value.Job)); #line default #line hidden -WriteLiteral("\r\n \r\n \r\n"); +WriteLiteral("\r\n \r\n " + +" "); + + + + #line 102 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" + Write(Html.JobArguments(job.Value.Job)); + + + #line default + #line hidden +WriteLiteral("\r\n \r\n"); + + + + #line 106 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" if (job.Value.ScheduledAt.HasValue) { @@ -396,14 +474,14 @@ public override void Execute() #line default #line hidden - #line 94 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" + #line 108 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" Write(Html.RelativeTime(job.Value.ScheduledAt.Value)); #line default #line hidden - #line 94 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" + #line 108 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" } @@ -414,27 +492,38 @@ public override void Execute() - #line 98 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" + #line 112 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" } #line default #line hidden -WriteLiteral("
\r\n
\r\n\r\n "); +WriteLiteral(" \r\n \r\n\r\n
\r\n "); - #line 102 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" - Write(Html.Paginator(pager)); + #line 117 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" + Write(Html.Paginator(pager)); #line default #line hidden -WriteLiteral("\r\n
\r\n"); +WriteLiteral("\r\n\r\n "); - #line 104 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" + #line 119 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" + Write(Html.PerPageSelector(pager)); + + + #line default + #line hidden +WriteLiteral("\r\n \r\n \r\n"); + + + + #line 122 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml" } diff --git a/src/Hangfire.Core/Dashboard/Pages/SucceededJobs.cshtml b/src/Hangfire.Core/Dashboard/Pages/SucceededJobs.cshtml index 05d68a386..7ce7ac10f 100644 --- a/src/Hangfire.Core/Dashboard/Pages/SucceededJobs.cshtml +++ b/src/Hangfire.Core/Dashboard/Pages/SucceededJobs.cshtml @@ -8,13 +8,14 @@ Layout = new LayoutPage(Strings.SucceededJobsPage_Title); int from, perPage; + var filter = Query("filter"); int.TryParse(Query("from"), out from); int.TryParse(Query("count"), out perPage); var monitor = Storage.GetMonitoringApi(); - var pager = new Pager(from, perPage, monitor.SucceededListCount()); - var succeededJobs = monitor.SucceededJobs(pager.FromRecord, pager.RecordsPerPage); + var pager = new Pager(from, perPage, monitor.SucceededListCount(filter), filter, DefaultRecordsPerPage); + var succeededJobs = monitor.SucceededJobs(pager.FromRecord, pager.RecordsPerPage, filter); }
@@ -42,7 +43,10 @@ @Strings.Common_RequeueJobs - @Html.PerPageSelector(pager) + @if (EnableJobFilters) + { + @Html.Filter(pager) + }
@@ -54,6 +58,10 @@ @Strings.Common_Id @Strings.Common_Job + @if (DisplayArgumentsInLists) + { + @Strings.Common_Arguments + } @Strings.SucceededJobsPage_Table_TotalDuration @Strings.SucceededJobsPage_Table_Succeeded @@ -78,7 +86,7 @@ @if (job.Value == null) { - + @Strings.Common_JobExpired } @@ -87,6 +95,12 @@ @Html.JobNameLink(job.Key, job.Value.Job) + @if (DisplayArgumentsInLists) + { + + @Html.JobArguments(job.Value.Job) + + } @if (job.Value.TotalDuration.HasValue) { @@ -106,7 +120,12 @@
- @Html.Paginator(pager) +
+ @Html.Paginator(pager) + + @Html.PerPageSelector(pager) +
+ } diff --git a/src/Hangfire.Core/Dashboard/Pages/SucceededJobs1.generated.cs b/src/Hangfire.Core/Dashboard/Pages/SucceededJobs1.generated.cs index cee9c280a..743a771f3 100644 --- a/src/Hangfire.Core/Dashboard/Pages/SucceededJobs1.generated.cs +++ b/src/Hangfire.Core/Dashboard/Pages/SucceededJobs1.generated.cs @@ -62,13 +62,14 @@ public override void Execute() Layout = new LayoutPage(Strings.SucceededJobsPage_Title); int from, perPage; + var filter = Query("filter"); int.TryParse(Query("from"), out from); int.TryParse(Query("count"), out perPage); var monitor = Storage.GetMonitoringApi(); - var pager = new Pager(from, perPage, monitor.SucceededListCount()); - var succeededJobs = monitor.SucceededJobs(pager.FromRecord, pager.RecordsPerPage); + var pager = new Pager(from, perPage, monitor.SucceededListCount(filter), filter, DefaultRecordsPerPage); + var succeededJobs = monitor.SucceededJobs(pager.FromRecord, pager.RecordsPerPage, filter); @@ -78,7 +79,7 @@ public override void Execute() - #line 22 "..\..\Dashboard\Pages\SucceededJobs.cshtml" + #line 23 "..\..\Dashboard\Pages\SucceededJobs.cshtml" Write(Html.JobsSidebar()); @@ -88,7 +89,7 @@ public override void Execute() - #line 25 "..\..\Dashboard\Pages\SucceededJobs.cshtml" + #line 26 "..\..\Dashboard\Pages\SucceededJobs.cshtml" Write(Strings.SucceededJobsPage_Title); @@ -98,7 +99,7 @@ public override void Execute() - #line 27 "..\..\Dashboard\Pages\SucceededJobs.cshtml" + #line 28 "..\..\Dashboard\Pages\SucceededJobs.cshtml" if (pager.TotalPageCount == 0) { @@ -109,7 +110,7 @@ public override void Execute() - #line 30 "..\..\Dashboard\Pages\SucceededJobs.cshtml" + #line 31 "..\..\Dashboard\Pages\SucceededJobs.cshtml" Write(Strings.SucceededJobsPage_NoJobs); @@ -119,7 +120,7 @@ public override void Execute() - #line 32 "..\..\Dashboard\Pages\SucceededJobs.cshtml" + #line 33 "..\..\Dashboard\Pages\SucceededJobs.cshtml" } else { @@ -133,7 +134,7 @@ public override void Execute() - #line 38 "..\..\Dashboard\Pages\SucceededJobs.cshtml" + #line 39 "..\..\Dashboard\Pages\SucceededJobs.cshtml" Write(Url.To("/jobs/succeeded/requeue")); @@ -143,7 +144,7 @@ public override void Execute() - #line 39 "..\..\Dashboard\Pages\SucceededJobs.cshtml" + #line 40 "..\..\Dashboard\Pages\SucceededJobs.cshtml" Write(Strings.Common_Enqueueing); @@ -154,24 +155,39 @@ public override void Execute() - #line 42 "..\..\Dashboard\Pages\SucceededJobs.cshtml" + #line 43 "..\..\Dashboard\Pages\SucceededJobs.cshtml" Write(Strings.Common_RequeueJobs); #line default #line hidden -WriteLiteral("\r\n \r\n\r\n "); +WriteLiteral("\r\n \r\n\r\n"); - #line 45 "..\..\Dashboard\Pages\SucceededJobs.cshtml" - Write(Html.PerPageSelector(pager)); + #line 46 "..\..\Dashboard\Pages\SucceededJobs.cshtml" + if (EnableJobFilters) + { + + + #line default + #line hidden + + #line 48 "..\..\Dashboard\Pages\SucceededJobs.cshtml" + Write(Html.Filter(pager)); + + + #line default + #line hidden + + #line 48 "..\..\Dashboard\Pages\SucceededJobs.cshtml" + + } #line default #line hidden -WriteLiteral(@" - +WriteLiteral(@"
@@ -184,7 +200,7 @@ public override void Execute() - #line 55 "..\..\Dashboard\Pages\SucceededJobs.cshtml" + #line 59 "..\..\Dashboard\Pages\SucceededJobs.cshtml" Write(Strings.Common_Id); @@ -194,17 +210,48 @@ public override void Execute() - #line 56 "..\..\Dashboard\Pages\SucceededJobs.cshtml" + #line 60 "..\..\Dashboard\Pages\SucceededJobs.cshtml" Write(Strings.Common_Job); #line default #line hidden -WriteLiteral("\r\n \r\n"); + + + + #line 61 "..\..\Dashboard\Pages\SucceededJobs.cshtml" + if (DisplayArgumentsInLists) + { + + + #line default + #line hidden +WriteLiteral(" \r\n"); + + + + #line 64 "..\..\Dashboard\Pages\SucceededJobs.cshtml" + } + + + #line default + #line hidden +WriteLiteral(" \r\n"); + + #line 98 "..\..\Dashboard\Pages\SucceededJobs.cshtml" + + + #line default + #line hidden + + #line 98 "..\..\Dashboard\Pages\SucceededJobs.cshtml" + if (DisplayArgumentsInLists) + { + + + #line default + #line hidden +WriteLiteral(" \r\n"); + + + #line 103 "..\..\Dashboard\Pages\SucceededJobs.cshtml" + } + + #line default + #line hidden + + #line 103 "..\..\Dashboard\Pages\SucceededJobs.cshtml" + + + + #line default + #line hidden WriteLiteral(" \r\n
"); +WriteLiteral(""); + + + + #line 63 "..\..\Dashboard\Pages\SucceededJobs.cshtml" + Write(Strings.Common_Arguments); + + + #line default + #line hidden +WriteLiteral(""); - #line 57 "..\..\Dashboard\Pages\SucceededJobs.cshtml" + #line 65 "..\..\Dashboard\Pages\SucceededJobs.cshtml" Write(Strings.SucceededJobsPage_Table_TotalDuration); @@ -214,7 +261,7 @@ public override void Execute() - #line 58 "..\..\Dashboard\Pages\SucceededJobs.cshtml" + #line 66 "..\..\Dashboard\Pages\SucceededJobs.cshtml" Write(Strings.SucceededJobsPage_Table_Succeeded); @@ -225,7 +272,7 @@ public override void Execute() - #line 62 "..\..\Dashboard\Pages\SucceededJobs.cshtml" + #line 70 "..\..\Dashboard\Pages\SucceededJobs.cshtml" foreach (var job in succeededJobs) { @@ -236,7 +283,7 @@ public override void Execute() - #line 64 "..\..\Dashboard\Pages\SucceededJobs.cshtml" + #line 72 "..\..\Dashboard\Pages\SucceededJobs.cshtml" Write(job.Value == null || !job.Value.InSucceededState ? "obsolete-data" : null); @@ -246,7 +293,7 @@ public override void Execute() - #line 64 "..\..\Dashboard\Pages\SucceededJobs.cshtml" + #line 72 "..\..\Dashboard\Pages\SucceededJobs.cshtml" Write(job.Value != null && job.Value.InSucceededState ? "hover" : null); @@ -256,7 +303,7 @@ public override void Execute() - #line 66 "..\..\Dashboard\Pages\SucceededJobs.cshtml" + #line 74 "..\..\Dashboard\Pages\SucceededJobs.cshtml" if (job.Value == null || job.Value.InSucceededState) { @@ -268,7 +315,7 @@ public override void Execute() - #line 68 "..\..\Dashboard\Pages\SucceededJobs.cshtml" + #line 76 "..\..\Dashboard\Pages\SucceededJobs.cshtml" Write(job.Key); @@ -278,7 +325,7 @@ public override void Execute() - #line 69 "..\..\Dashboard\Pages\SucceededJobs.cshtml" + #line 77 "..\..\Dashboard\Pages\SucceededJobs.cshtml" } @@ -289,7 +336,7 @@ public override void Execute() - #line 72 "..\..\Dashboard\Pages\SucceededJobs.cshtml" + #line 80 "..\..\Dashboard\Pages\SucceededJobs.cshtml" Write(Html.JobIdLink(job.Key)); @@ -299,7 +346,7 @@ public override void Execute() - #line 73 "..\..\Dashboard\Pages\SucceededJobs.cshtml" + #line 81 "..\..\Dashboard\Pages\SucceededJobs.cshtml" if (job.Value != null && !job.Value.InSucceededState) { @@ -310,7 +357,7 @@ public override void Execute() - #line 75 "..\..\Dashboard\Pages\SucceededJobs.cshtml" + #line 83 "..\..\Dashboard\Pages\SucceededJobs.cshtml" Write(Strings.Common_JobStateChanged_Text); @@ -320,7 +367,7 @@ public override void Execute() - #line 76 "..\..\Dashboard\Pages\SucceededJobs.cshtml" + #line 84 "..\..\Dashboard\Pages\SucceededJobs.cshtml" } @@ -330,19 +377,28 @@ public override void Execute() - #line 79 "..\..\Dashboard\Pages\SucceededJobs.cshtml" + #line 87 "..\..\Dashboard\Pages\SucceededJobs.cshtml" if (job.Value == null) { #line default #line hidden -WriteLiteral(" \r\n " + -" "); +WriteLiteral(" \r\n" + +" "); + + + + #line 101 "..\..\Dashboard\Pages\SucceededJobs.cshtml" + Write(Html.JobArguments(job.Value.Job)); + + + #line default + #line hidden +WriteLiteral("\r\n \r\n"); - #line 91 "..\..\Dashboard\Pages\SucceededJobs.cshtml" + #line 105 "..\..\Dashboard\Pages\SucceededJobs.cshtml" if (job.Value.TotalDuration.HasValue) { @@ -387,14 +483,14 @@ public override void Execute() #line default #line hidden - #line 93 "..\..\Dashboard\Pages\SucceededJobs.cshtml" + #line 107 "..\..\Dashboard\Pages\SucceededJobs.cshtml" Write(Html.ToHumanDuration(TimeSpan.FromMilliseconds(job.Value.TotalDuration.Value), false)); #line default #line hidden - #line 93 "..\..\Dashboard\Pages\SucceededJobs.cshtml" + #line 107 "..\..\Dashboard\Pages\SucceededJobs.cshtml" } @@ -409,7 +505,7 @@ public override void Execute() - #line 97 "..\..\Dashboard\Pages\SucceededJobs.cshtml" + #line 111 "..\..\Dashboard\Pages\SucceededJobs.cshtml" if (job.Value.SucceededAt.HasValue) { @@ -417,14 +513,14 @@ public override void Execute() #line default #line hidden - #line 99 "..\..\Dashboard\Pages\SucceededJobs.cshtml" + #line 113 "..\..\Dashboard\Pages\SucceededJobs.cshtml" Write(Html.RelativeTime(job.Value.SucceededAt.Value)); #line default #line hidden - #line 99 "..\..\Dashboard\Pages\SucceededJobs.cshtml" + #line 113 "..\..\Dashboard\Pages\SucceededJobs.cshtml" } @@ -435,7 +531,7 @@ public override void Execute() - #line 102 "..\..\Dashboard\Pages\SucceededJobs.cshtml" + #line 116 "..\..\Dashboard\Pages\SucceededJobs.cshtml" } @@ -445,28 +541,38 @@ public override void Execute() - #line 104 "..\..\Dashboard\Pages\SucceededJobs.cshtml" + #line 118 "..\..\Dashboard\Pages\SucceededJobs.cshtml" } #line default #line hidden WriteLiteral("
\r\n <" + -"/div>\r\n\r\n "); +"/div>\r\n\r\n
\r\n "); - #line 109 "..\..\Dashboard\Pages\SucceededJobs.cshtml" - Write(Html.Paginator(pager)); + #line 124 "..\..\Dashboard\Pages\SucceededJobs.cshtml" + Write(Html.Paginator(pager)); #line default #line hidden -WriteLiteral("\r\n
\r\n"); +WriteLiteral("\r\n \r\n "); - #line 111 "..\..\Dashboard\Pages\SucceededJobs.cshtml" + #line 126 "..\..\Dashboard\Pages\SucceededJobs.cshtml" + Write(Html.PerPageSelector(pager)); + + + #line default + #line hidden +WriteLiteral("\r\n
\r\n\r\n \r\n"); + + + + #line 130 "..\..\Dashboard\Pages\SucceededJobs.cshtml" } diff --git a/src/Hangfire.Core/Dashboard/Pages/_Filter.cshtml b/src/Hangfire.Core/Dashboard/Pages/_Filter.cshtml new file mode 100644 index 000000000..3a163b322 --- /dev/null +++ b/src/Hangfire.Core/Dashboard/Pages/_Filter.cshtml @@ -0,0 +1,8 @@ +@* Generator: Template TypeVisibility: Internal GeneratePrettyNames: True TrimLeadingUnderscores : true *@ +@using Hangfire.Dashboard.Resources; +@inherits Hangfire.Dashboard.RazorPage + +
+ +
+ diff --git a/src/Hangfire.Core/Dashboard/Pages/_Filter.generated.cs b/src/Hangfire.Core/Dashboard/Pages/_Filter.generated.cs new file mode 100644 index 000000000..b56022cb3 --- /dev/null +++ b/src/Hangfire.Core/Dashboard/Pages/_Filter.generated.cs @@ -0,0 +1,65 @@ +#pragma warning disable 1591 +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Hangfire.Dashboard.Pages +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Text; + + #line 2 "..\..\Dashboard\Pages\_Filter.cshtml" + using Hangfire.Dashboard.Resources; + + #line default + #line hidden + + [System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")] + internal partial class Filter : Hangfire.Dashboard.RazorPage + { +#line hidden + + public override void Execute() + { + + +WriteLiteral("\r\n"); + + + +WriteLiteral("\r\n
\r\n \r\n
\r\n\r\n"); + + + } + } +} +#pragma warning restore 1591 diff --git a/src/Hangfire.Core/Dashboard/Pages/_Paginator.cshtml b/src/Hangfire.Core/Dashboard/Pages/_Paginator.cshtml index 19d055c47..10536eb4e 100644 --- a/src/Hangfire.Core/Dashboard/Pages/_Paginator.cshtml +++ b/src/Hangfire.Core/Dashboard/Pages/_Paginator.cshtml @@ -3,7 +3,6 @@ @using Hangfire.Dashboard.Resources; @inherits RazorPage -
@if (_pager.TotalPageCount > 1) {
@@ -40,4 +39,3 @@
@Strings.Paginator_TotalItems: @_pager.TotalRecordCount
-
diff --git a/src/Hangfire.Core/Dashboard/Pages/_Paginator.generated.cs b/src/Hangfire.Core/Dashboard/Pages/_Paginator.generated.cs index 78a9e1aba..01e5946ee 100644 --- a/src/Hangfire.Core/Dashboard/Pages/_Paginator.generated.cs +++ b/src/Hangfire.Core/Dashboard/Pages/_Paginator.generated.cs @@ -44,11 +44,9 @@ public override void Execute() WriteLiteral("\r\n"); -WriteLiteral("
\r\n"); - - #line 7 "..\..\Dashboard\Pages\_Paginator.cshtml" + #line 6 "..\..\Dashboard\Pages\_Paginator.cshtml" if (_pager.TotalPageCount > 1) { @@ -59,7 +57,7 @@ public override void Execute() - #line 10 "..\..\Dashboard\Pages\_Paginator.cshtml" + #line 9 "..\..\Dashboard\Pages\_Paginator.cshtml" foreach (var page in _pager.PagerItems) { switch (page.Type) @@ -73,7 +71,7 @@ public override void Execute() - #line 15 "..\..\Dashboard\Pages\_Paginator.cshtml" + #line 14 "..\..\Dashboard\Pages\_Paginator.cshtml" Write(_pager.PageUrl(page.PageIndex)); @@ -83,7 +81,7 @@ public override void Execute() - #line 15 "..\..\Dashboard\Pages\_Paginator.cshtml" + #line 14 "..\..\Dashboard\Pages\_Paginator.cshtml" Write(_pager.CurrentPage == page.PageIndex ? "active" : null); @@ -93,7 +91,7 @@ public override void Execute() - #line 16 "..\..\Dashboard\Pages\_Paginator.cshtml" + #line 15 "..\..\Dashboard\Pages\_Paginator.cshtml" Write(page.PageIndex); @@ -103,7 +101,7 @@ public override void Execute() - #line 18 "..\..\Dashboard\Pages\_Paginator.cshtml" + #line 17 "..\..\Dashboard\Pages\_Paginator.cshtml" break; case Pager.ItemType.NextPage: @@ -114,7 +112,7 @@ public override void Execute() - #line 20 "..\..\Dashboard\Pages\_Paginator.cshtml" + #line 19 "..\..\Dashboard\Pages\_Paginator.cshtml" Write(_pager.PageUrl(page.PageIndex)); @@ -124,7 +122,7 @@ public override void Execute() - #line 20 "..\..\Dashboard\Pages\_Paginator.cshtml" + #line 19 "..\..\Dashboard\Pages\_Paginator.cshtml" Write(page.Disabled ? "disabled" : null); @@ -134,7 +132,7 @@ public override void Execute() - #line 21 "..\..\Dashboard\Pages\_Paginator.cshtml" + #line 20 "..\..\Dashboard\Pages\_Paginator.cshtml" Write(Strings.Paginator_Next); @@ -144,7 +142,7 @@ public override void Execute() - #line 23 "..\..\Dashboard\Pages\_Paginator.cshtml" + #line 22 "..\..\Dashboard\Pages\_Paginator.cshtml" break; case Pager.ItemType.PrevPage: @@ -155,7 +153,7 @@ public override void Execute() - #line 25 "..\..\Dashboard\Pages\_Paginator.cshtml" + #line 24 "..\..\Dashboard\Pages\_Paginator.cshtml" Write(_pager.PageUrl(page.PageIndex)); @@ -165,7 +163,7 @@ public override void Execute() - #line 25 "..\..\Dashboard\Pages\_Paginator.cshtml" + #line 24 "..\..\Dashboard\Pages\_Paginator.cshtml" Write(page.Disabled ? "disabled" : null); @@ -175,7 +173,7 @@ public override void Execute() - #line 26 "..\..\Dashboard\Pages\_Paginator.cshtml" + #line 25 "..\..\Dashboard\Pages\_Paginator.cshtml" Write(Strings.Paginator_Prev); @@ -185,7 +183,7 @@ public override void Execute() - #line 28 "..\..\Dashboard\Pages\_Paginator.cshtml" + #line 27 "..\..\Dashboard\Pages\_Paginator.cshtml" break; case Pager.ItemType.MorePage: @@ -197,7 +195,7 @@ public override void Execute() - #line 33 "..\..\Dashboard\Pages\_Paginator.cshtml" + #line 32 "..\..\Dashboard\Pages\_Paginator.cshtml" break; } } @@ -213,7 +211,7 @@ public override void Execute() - #line 38 "..\..\Dashboard\Pages\_Paginator.cshtml" + #line 37 "..\..\Dashboard\Pages\_Paginator.cshtml" } @@ -223,7 +221,7 @@ public override void Execute() - #line 41 "..\..\Dashboard\Pages\_Paginator.cshtml" + #line 40 "..\..\Dashboard\Pages\_Paginator.cshtml" Write(Strings.Paginator_TotalItems); @@ -233,13 +231,13 @@ public override void Execute() - #line 41 "..\..\Dashboard\Pages\_Paginator.cshtml" + #line 40 "..\..\Dashboard\Pages\_Paginator.cshtml" Write(_pager.TotalRecordCount); #line default #line hidden -WriteLiteral("\r\n
\r\n
\r\n"); +WriteLiteral("\r\n \r\n"); } diff --git a/src/Hangfire.Core/Dashboard/Pages/_PerPageSelector.cshtml b/src/Hangfire.Core/Dashboard/Pages/_PerPageSelector.cshtml index 6242fa736..bb851945d 100644 --- a/src/Hangfire.Core/Dashboard/Pages/_PerPageSelector.cshtml +++ b/src/Hangfire.Core/Dashboard/Pages/_PerPageSelector.cshtml @@ -2,14 +2,16 @@ @using Hangfire.Dashboard.Resources; @inherits Hangfire.Dashboard.RazorPage +
\ No newline at end of file diff --git a/src/Hangfire.Core/Dashboard/Pages/_PerPageSelector.generated.cs b/src/Hangfire.Core/Dashboard/Pages/_PerPageSelector.generated.cs index 660186219..410428c81 100644 --- a/src/Hangfire.Core/Dashboard/Pages/_PerPageSelector.generated.cs +++ b/src/Hangfire.Core/Dashboard/Pages/_PerPageSelector.generated.cs @@ -35,12 +35,12 @@ public override void Execute() -WriteLiteral("\r\n
\r\n"); +WriteLiteral("\r\n
\r\n
\r\n"); - #line 6 "..\..\Dashboard\Pages\_PerPageSelector.cshtml" - foreach (var count in new[] { 10, 20, 50, 100, 500 }) + #line 7 "..\..\Dashboard\Pages\_PerPageSelector.cshtml" + foreach (var count in new[] { 10, 20, 50, 100, 500, int.MaxValue }) { @@ -50,18 +50,18 @@ public override void Execute() - #line 8 "..\..\Dashboard\Pages\_PerPageSelector.cshtml" + #line 9 "..\..\Dashboard\Pages\_PerPageSelector.cshtml" Write(count == _pager.RecordsPerPage ? "active" : null); #line default #line hidden -WriteLiteral("\" \r\n href=\""); +WriteLiteral("\"\r\n href=\""); - #line 9 "..\..\Dashboard\Pages\_PerPageSelector.cshtml" - Write(_pager.RecordsPerPageUrl(count)); + #line 10 "..\..\Dashboard\Pages\_PerPageSelector.cshtml" + Write(_pager.RecordsPerPageUrl(count)); #line default @@ -70,17 +70,17 @@ public override void Execute() - #line 9 "..\..\Dashboard\Pages\_PerPageSelector.cshtml" - Write(count); + #line 10 "..\..\Dashboard\Pages\_PerPageSelector.cshtml" + Write(count == int.MaxValue ? Strings.PerPageSelector_All : count.ToString()); #line default #line hidden -WriteLiteral(" \r\n"); +WriteLiteral("\r\n"); - #line 10 "..\..\Dashboard\Pages\_PerPageSelector.cshtml" + #line 11 "..\..\Dashboard\Pages\_PerPageSelector.cshtml" } @@ -91,13 +91,13 @@ public override void Execute() - #line 14 "..\..\Dashboard\Pages\_PerPageSelector.cshtml" + #line 15 "..\..\Dashboard\Pages\_PerPageSelector.cshtml" Write(Strings.PerPageSelector_ItemsPerPage); #line default #line hidden -WriteLiteral(":\r\n
\r\n"); +WriteLiteral(":\r\n
\r\n
"); } diff --git a/src/Hangfire.Core/Dashboard/RazorPage.cs b/src/Hangfire.Core/Dashboard/RazorPage.cs index e9bc145ad..bc6f2d8ad 100644 --- a/src/Hangfire.Core/Dashboard/RazorPage.cs +++ b/src/Hangfire.Core/Dashboard/RazorPage.cs @@ -42,6 +42,12 @@ protected RazorPage() public JobStorage Storage { get; internal set; } public string AppPath { get; internal set; } public int StatsPollingInterval { get; internal set; } + public bool DisplayArgumentsInLists { get; internal set; } + + public bool EnableJobFilters { get; internal set; } + public bool UseFullWidth { get; internal set; } + public int DefaultRecordsPerPage { get; internal set; } + public Stopwatch GenerationTime { get; private set; } public StatisticsDto Statistics @@ -79,6 +85,10 @@ public void Assign(RazorPage parentPage) Storage = parentPage.Storage; AppPath = parentPage.AppPath; StatsPollingInterval = parentPage.StatsPollingInterval; + DisplayArgumentsInLists = parentPage.DisplayArgumentsInLists; + EnableJobFilters = parentPage.EnableJobFilters; + UseFullWidth = parentPage.UseFullWidth; + DefaultRecordsPerPage = parentPage.DefaultRecordsPerPage; Url = parentPage.Url; GenerationTime = parentPage.GenerationTime; @@ -93,6 +103,11 @@ internal void Assign(DashboardContext context) Storage = context.Storage; AppPath = context.Options.AppPath; StatsPollingInterval = context.Options.StatsPollingInterval; + DisplayArgumentsInLists = context.Options.DisplayArgumentsInLists; + EnableJobFilters = context.Options.EnableJobFilters; + UseFullWidth = context.Options.UseFullWidth; + DefaultRecordsPerPage = context.Options.DefaultRecordsPerPage; + Url = new UrlHelper(context); _statisticsLazy = new Lazy(() => diff --git a/src/Hangfire.Core/DashboardOptions.cs b/src/Hangfire.Core/DashboardOptions.cs index 395824a84..9f512a49f 100644 --- a/src/Hangfire.Core/DashboardOptions.cs +++ b/src/Hangfire.Core/DashboardOptions.cs @@ -27,6 +27,10 @@ public DashboardOptions() AppPath = "/"; Authorization = new[] { new LocalRequestsOnlyAuthorizationFilter() }; StatsPollingInterval = 2000; + DisplayArgumentsInLists = false; + EnableJobFilters = false; + UseFullWidth = false; + DefaultRecordsPerPage = 10; } /// @@ -45,5 +49,26 @@ public DashboardOptions() /// The interval the /stats endpoint should be polled with. /// public int StatsPollingInterval { get; set; } + + /// + /// Gets or sets a value indicating whether or not to display arguments in job lists. + /// + public bool DisplayArgumentsInLists { get; set; } + + /// + /// Gets or sets a value indicating whether or not to be able to filter the job lists. + /// + public bool EnableJobFilters { get; set; } + + + /// + /// Gets or sets a value indicating whether or not to use the full screen width. + /// + public bool UseFullWidth { get; set; } + + /// + /// Gets or sets the default number of records per page. + /// + public int DefaultRecordsPerPage { get; set; } } } diff --git a/src/Hangfire.Core/Hangfire.Core.NetStandard.csproj b/src/Hangfire.Core/Hangfire.Core.NetStandard.csproj index cc07b33ae..b3024eee2 100644 --- a/src/Hangfire.Core/Hangfire.Core.NetStandard.csproj +++ b/src/Hangfire.Core/Hangfire.Core.NetStandard.csproj @@ -176,6 +176,9 @@ True True + + _Filter.cshtml + HomePage.cshtml @@ -251,6 +254,11 @@ True True + + _Filter.cshtml + True + True + _InlineMetric.cshtml True @@ -478,6 +486,10 @@ RazorGenerator _BlockMetric.generated.cs + + RazorGenerator + _Filter.generated.cs + RazorGenerator _InlineMetric.generated.cs diff --git a/src/Hangfire.Core/Hangfire.Core.csproj b/src/Hangfire.Core/Hangfire.Core.csproj index 0d56e0510..7dc74561e 100644 --- a/src/Hangfire.Core/Hangfire.Core.csproj +++ b/src/Hangfire.Core/Hangfire.Core.csproj @@ -92,6 +92,14 @@ + + _Filter.cshtml + + + _Filter.cshtml + True + True + @@ -514,6 +522,10 @@ RazorGenerator _Breadcrumbs.generated.cs + + RazorGenerator + _Filter.generated.cs + RazorGenerator _SidebarMenu.generated.cs diff --git a/src/Hangfire.Core/Storage/IMonitoringApi.cs b/src/Hangfire.Core/Storage/IMonitoringApi.cs index fad0eae41..2e75e9ab8 100644 --- a/src/Hangfire.Core/Storage/IMonitoringApi.cs +++ b/src/Hangfire.Core/Storage/IMonitoringApi.cs @@ -27,23 +27,23 @@ public interface IMonitoringApi JobDetailsDto JobDetails(string jobId); StatisticsDto GetStatistics(); - JobList EnqueuedJobs(string queue, int from, int perPage); - JobList FetchedJobs(string queue, int from, int perPage); + JobList EnqueuedJobs(string queue, int from, int perPage, string filter); + JobList FetchedJobs(string queue, int from, int perPage, string filter); - JobList ProcessingJobs(int from, int count); - JobList ScheduledJobs(int from, int count); - JobList SucceededJobs(int from, int count); - JobList FailedJobs(int from, int count); - JobList DeletedJobs(int from, int count); + JobList ProcessingJobs(int from, int count, string filter); + JobList ScheduledJobs(int from, int count, string filter); + JobList SucceededJobs(int from, int count, string filter); + JobList FailedJobs(int from, int count, string filter); + JobList DeletedJobs(int from, int count, string filter); - long ScheduledCount(); - long EnqueuedCount(string queue); - long FetchedCount(string queue); - long FailedCount(); - long ProcessingCount(); + long ScheduledCount(string filter); + long EnqueuedCount(string queue, string filter); + long FetchedCount(string queue, string filter); + long FailedCount(string filter); + long ProcessingCount(string filter); - long SucceededListCount(); - long DeletedListCount(); + long SucceededListCount(string filter); + long DeletedListCount(string filter); IDictionary SucceededByDatesCount(); IDictionary FailedByDatesCount(); diff --git a/src/Hangfire.SqlServer/SqlServerMonitoringApi.cs b/src/Hangfire.SqlServer/SqlServerMonitoringApi.cs index 4d1a657f1..8968488ec 100644 --- a/src/Hangfire.SqlServer/SqlServerMonitoringApi.cs +++ b/src/Hangfire.SqlServer/SqlServerMonitoringApi.cs @@ -43,13 +43,13 @@ public SqlServerMonitoringApi([NotNull] SqlServerStorage storage, int? jobListLi _jobListLimit = jobListLimit; } - public long ScheduledCount() + public long ScheduledCount(string filter) { return UseConnection(connection => - GetNumberOfJobsByStateName(connection, ScheduledState.StateName)); + GetNumberOfJobsByStateName(connection, ScheduledState.StateName, filter)); } - public long EnqueuedCount(string queue) + public long EnqueuedCount(string queue, string filter) { var queueApi = GetQueueApi(queue); var counters = queueApi.GetEnqueuedAndFetchedCount(queue); @@ -57,7 +57,7 @@ public long EnqueuedCount(string queue) return counters.EnqueuedCount ?? 0; } - public long FetchedCount(string queue) + public long FetchedCount(string queue, string filter) { var queueApi = GetQueueApi(queue); var counters = queueApi.GetEnqueuedAndFetchedCount(queue); @@ -65,24 +65,25 @@ public long FetchedCount(string queue) return counters.FetchedCount ?? 0; } - public long FailedCount() + public long FailedCount(string filter) { return UseConnection(connection => - GetNumberOfJobsByStateName(connection, FailedState.StateName)); + GetNumberOfJobsByStateName(connection, FailedState.StateName, filter)); } - public long ProcessingCount() + public long ProcessingCount(string filter) { return UseConnection(connection => - GetNumberOfJobsByStateName(connection, ProcessingState.StateName)); + GetNumberOfJobsByStateName(connection, ProcessingState.StateName, filter)); } - public JobList ProcessingJobs(int @from, int count) + public JobList ProcessingJobs(int @from, int count, string filter) { return UseConnection(connection => GetJobs( connection, from, count, ProcessingState.StateName, + filter, (sqlJob, job, stateData) => new ProcessingJobDto { Job = job, @@ -91,12 +92,13 @@ public JobList ProcessingJobs(int @from, int count) })); } - public JobList ScheduledJobs(int @from, int count) + public JobList ScheduledJobs(int @from, int count, string filter) { return UseConnection(connection => GetJobs( connection, from, count, ScheduledState.StateName, + filter, (sqlJob, job, stateData) => new ScheduledJobDto { Job = job, @@ -145,13 +147,14 @@ public IList Servers() }); } - public JobList FailedJobs(int @from, int count) + public JobList FailedJobs(int @from, int count, string filter) { return UseConnection(connection => GetJobs( connection, from, count, FailedState.StateName, + filter, (sqlJob, job, stateData) => new FailedJobDto { Job = job, @@ -163,13 +166,14 @@ public JobList FailedJobs(int @from, int count) })); } - public JobList SucceededJobs(int @from, int count) + public JobList SucceededJobs(int @from, int count, string filter) { return UseConnection(connection => GetJobs( connection, from, count, SucceededState.StateName, + filter, (sqlJob, job, stateData) => new SucceededJobDto { Job = job, @@ -181,13 +185,14 @@ public JobList SucceededJobs(int @from, int count) })); } - public JobList DeletedJobs(int @from, int count) + public JobList DeletedJobs(int @from, int count, string filter) { return UseConnection(connection => GetJobs( connection, from, count, DeletedState.StateName, + filter, (sqlJob, job, stateData) => new DeletedJobDto { Job = job, @@ -227,7 +232,7 @@ public IList Queues() return result; } - public JobList EnqueuedJobs(string queue, int @from, int perPage) + public JobList EnqueuedJobs(string queue, int @from, int perPage, string filter) { var queueApi = GetQueueApi(queue); var enqueuedJobIds = queueApi.GetEnqueuedJobIds(queue, from, perPage); @@ -236,7 +241,7 @@ public JobList EnqueuedJobs(string queue, int @from, int perPage return UseConnection(connection => EnqueuedJobs(connection, enqueuedJobIds.Select(x => (long)x).ToArray())); } - public JobList FetchedJobs(string queue, int @from, int perPage) + public JobList FetchedJobs(string queue, int @from, int perPage, string filter) { var queueApi = GetQueueApi(queue); var fetchedJobIds = queueApi.GetFetchedJobIds(queue, from, perPage); @@ -298,16 +303,16 @@ public JobDetailsDto JobDetails(string jobId) }); } - public long SucceededListCount() + public long SucceededListCount(string filter) { return UseConnection(connection => - GetNumberOfJobsByStateName(connection, SucceededState.StateName)); + GetNumberOfJobsByStateName(connection, SucceededState.StateName, filter)); } - public long DeletedListCount() + public long DeletedListCount(string filter) { return UseConnection(connection => - GetNumberOfJobsByStateName(connection, DeletedState.StateName)); + GetNumberOfJobsByStateName(connection, DeletedState.StateName, filter)); } public StatisticsDto GetStatistics() @@ -462,15 +467,19 @@ private JobList EnqueuedJobs(DbConnection connection, long[] job }); } - private long GetNumberOfJobsByStateName(DbConnection connection, string stateName) + private long GetNumberOfJobsByStateName(DbConnection connection, string stateName, string filter) { + var filterSql = !string.IsNullOrEmpty(filter) && filter.Length > 2 + ? "and InvocationData like @contains" + : ""; + var sqlQuery = _jobListLimit.HasValue - ? $@"select count(j.Id) from (select top (@limit) Id from [{_storage.SchemaName}].Job with (nolock) where StateName = @state) as j" - : $@"select count(Id) from [{_storage.SchemaName}].Job with (nolock) where StateName = @state"; + ? $@"select count(j.Id) from (select top (@limit) Id from [{_storage.SchemaName}].Job with (nolock) where StateName = @state {filterSql}) as j" + : $@"select count(Id) from [{_storage.SchemaName}].Job with (nolock) where StateName = @state {filterSql}"; var count = connection.ExecuteScalar( sqlQuery, - new { state = stateName, limit = _jobListLimit }, + new { state = stateName, limit = _jobListLimit, @contains = $"%{filter}%" }, commandTimeout: _storage.CommandTimeout); return count; @@ -496,25 +505,32 @@ private JobList GetJobs( int from, int count, string stateName, + string filter, Func, TDto> selector) { + var filterSql = !string.IsNullOrEmpty(filter) && filter.Length > 2 + ? "and j.InvocationData like @contains" + : ""; + string jobsSql = $@";with cte as ( select j.Id, row_number() over (order by j.Id desc) as row_num from [{_storage.SchemaName}].Job j with (nolock, forceseek) where j.StateName = @stateName + {filterSql} ) select j.Id, j.InvocationData, j.Arguments, s.Reason as StateReason, s.Data as StateData from [{_storage.SchemaName}].Job j with (nolock) inner join cte on cte.Id = j.Id left join [{_storage.SchemaName}].State s with (nolock) on j.StateId = s.Id where cte.row_num between @start and @end +{filterSql} order by j.Id desc"; var jobs = connection.Query( jobsSql, - new { stateName = stateName, start = @from + 1, end = @from + count }, + new { stateName = stateName, start = @from + 1, end = @from + count, @contains = $"%{filter}%" }, commandTimeout: _storage.CommandTimeout) .ToList(); diff --git a/tests/Hangfire.SqlServer.Tests/Hangfire.SqlServer.Tests.csproj b/tests/Hangfire.SqlServer.Tests/Hangfire.SqlServer.Tests.csproj index 9c353885c..5afd0c8ab 100644 --- a/tests/Hangfire.SqlServer.Tests/Hangfire.SqlServer.Tests.csproj +++ b/tests/Hangfire.SqlServer.Tests/Hangfire.SqlServer.Tests.csproj @@ -76,6 +76,7 @@ + diff --git a/tests/Hangfire.SqlServer.Tests/SqlServerMonitoringApiFacts.cs b/tests/Hangfire.SqlServer.Tests/SqlServerMonitoringApiFacts.cs new file mode 100644 index 000000000..dd51c1512 --- /dev/null +++ b/tests/Hangfire.SqlServer.Tests/SqlServerMonitoringApiFacts.cs @@ -0,0 +1,17 @@ +using System; +using Xunit; + +namespace Hangfire.SqlServer.Tests +{ + public class SqlServerMonitoringApiFacts + { + [Fact] + public void Ctor_ThrowsAnException_WhenStorageIsNull() + { + var exception = Assert.Throws( + () => new SqlServerMonitoringApi(null, null)); + + Assert.Equal("storage", exception.ParamName); + } + } +}