diff --git a/src/DotNetCore.CAP/Dashboard/Content/js/cap.js b/src/DotNetCore.CAP/Dashboard/Content/js/cap.js index e3eee08..827fcab 100644 --- a/src/DotNetCore.CAP/Dashboard/Content/js/cap.js +++ b/src/DotNetCore.CAP/Dashboard/Content/js/cap.js @@ -112,8 +112,8 @@ RealtimeGraph.prototype = Object.create(BaseGraph.prototype); RealtimeGraph.prototype.appendHistory = function (statistics) { - var newSucceeded = parseInt(statistics["succeeded:count"].intValue); - var newFailed = parseInt(statistics["failed:count"].intValue); + var newSucceeded = parseInt(statistics["published_succeeded:count"].intValue); + var newFailed = parseInt(statistics["published_failed:count"].intValue); if (this._succeeded !== null && this._failed !== null) { var succeeded = newSucceeded - this._succeeded; diff --git a/src/DotNetCore.CAP/Dashboard/DashboardMetrics.cs b/src/DotNetCore.CAP/Dashboard/DashboardMetrics.cs index 9b6c07c..66ade25 100644 --- a/src/DotNetCore.CAP/Dashboard/DashboardMetrics.cs +++ b/src/DotNetCore.CAP/Dashboard/DashboardMetrics.cs @@ -12,17 +12,19 @@ namespace DotNetCore.CAP.Dashboard static DashboardMetrics() { AddMetric(ServerCount); - AddMetric(RecurringJobCount); AddMetric(RetriesCount); - AddMetric(EnqueuedCountOrNull); - AddMetric(FailedCountOrNull); - AddMetric(EnqueuedAndQueueCount); - AddMetric(ScheduledCount); - AddMetric(ProcessingCount); - AddMetric(SucceededCount); - AddMetric(FailedCount); - AddMetric(DeletedCount); - AddMetric(AwaitingCount); + + AddMetric(PublishedFailedCountOrNull); + AddMetric(ReceivedFailedCountOrNull); + + AddMetric(PublishedProcessingCount); + AddMetric(ReceivedProcessingCount); + + AddMetric(PublishedSucceededCount); + AddMetric(ReceivedSucceededCount); + + AddMetric(PublishedFailedCount); + AddMetric(ReceivedFailedCount); } public static void AddMetric(DashboardMetric metric) @@ -44,7 +46,7 @@ namespace DotNetCore.CAP.Dashboard } public static readonly DashboardMetric ServerCount = new DashboardMetric( - "servers:count", + "servers:count", "Metrics_Servers", page => new Metric(page.Statistics.Servers.ToString("N0")) { @@ -55,11 +57,6 @@ namespace DotNetCore.CAP.Dashboard : null }); - public static readonly DashboardMetric RecurringJobCount = new DashboardMetric( - "recurring:count", - "Metrics_RecurringJobs", - page => new Metric(page.Statistics.Recurring.ToString("N0"))); - public static readonly DashboardMetric RetriesCount = new DashboardMetric( "retries:count", "Metrics_Retries", @@ -83,97 +80,87 @@ namespace DotNetCore.CAP.Dashboard }; }); - public static readonly DashboardMetric EnqueuedCountOrNull = new DashboardMetric( - "enqueued:count-or-null", - "Metrics_EnqueuedCountOrNull", - page => page.Statistics.Enqueued > 0 || page.Statistics.Failed == 0 - ? new Metric(page.Statistics.Enqueued.ToString("N0")) - { - Style = page.Statistics.Enqueued > 0 ? MetricStyle.Info : MetricStyle.Default, - Highlighted = page.Statistics.Enqueued > 0 && page.Statistics.Failed == 0 - } - : null); + //---------------------------------------------------- - public static readonly DashboardMetric FailedCountOrNull = new DashboardMetric( - "failed:count-or-null", + public static readonly DashboardMetric PublishedFailedCountOrNull = new DashboardMetric( + "publish_failed:count-or-null", "Metrics_FailedJobs", - page => page.Statistics.Failed > 0 - ? new Metric(page.Statistics.Failed.ToString("N0")) + page => page.Statistics.PublishedFailed > 0 + ? new Metric(page.Statistics.PublishedFailed.ToString("N0")) { Style = MetricStyle.Danger, Highlighted = true, - Title = string.Format(Strings.Metrics_FailedCountOrNull, page.Statistics.Failed) + Title = string.Format(Strings.Metrics_FailedCountOrNull, page.Statistics.PublishedFailed) } : null); - public static readonly DashboardMetric EnqueuedAndQueueCount = new DashboardMetric( - "enqueued-queues:count", - "Metrics_EnqueuedQueuesCount", - page => new Metric($"{page.Statistics.Enqueued:N0} / {page.Statistics.Queues:N0}") - { - Style = page.Statistics.Enqueued > 0 ? MetricStyle.Info : MetricStyle.Default, - Highlighted = page.Statistics.Enqueued > 0 - }); - - public static readonly DashboardMetric ScheduledCount = new DashboardMetric( - "scheduled:count", - "Metrics_ScheduledJobs", - page => new Metric(page.Statistics.Scheduled.ToString("N0")) - { - Style = page.Statistics.Scheduled > 0 ? MetricStyle.Info : MetricStyle.Default - }); - - public static readonly DashboardMetric ProcessingCount = new DashboardMetric( - "processing:count", + public static readonly DashboardMetric ReceivedFailedCountOrNull = new DashboardMetric( + "received_failed:count-or-null", + "Metrics_FailedJobs", + page => page.Statistics.ReceivedFailed > 0 + ? new Metric(page.Statistics.ReceivedFailed.ToString("N0")) + { + Style = MetricStyle.Danger, + Highlighted = true, + Title = string.Format(Strings.Metrics_FailedCountOrNull, page.Statistics.ReceivedFailed) + } + : null); + + //---------------------------------------------------- + + public static readonly DashboardMetric PublishedProcessingCount = new DashboardMetric( + "publish_processing:count", "Metrics_ProcessingJobs", - page => new Metric(page.Statistics.Processing.ToString("N0")) + page => new Metric(page.Statistics.PublishedProcessing.ToString("N0")) { - Style = page.Statistics.Processing > 0 ? MetricStyle.Warning : MetricStyle.Default + Style = page.Statistics.PublishedProcessing > 0 ? MetricStyle.Warning : MetricStyle.Default }); - public static readonly DashboardMetric SucceededCount = new DashboardMetric( - "succeeded:count", + public static readonly DashboardMetric ReceivedProcessingCount = new DashboardMetric( + "received_processing:count", + "Metrics_ProcessingJobs", + page => new Metric(page.Statistics.ReceivedProcessing.ToString("N0")) + { + Style = page.Statistics.ReceivedProcessing > 0 ? MetricStyle.Warning : MetricStyle.Default + }); + + //---------------------------------------------------- + public static readonly DashboardMetric PublishedSucceededCount = new DashboardMetric( + "publish_succeeded:count", "Metrics_SucceededJobs", - page => new Metric(page.Statistics.Succeeded.ToString("N0")) + page => new Metric(page.Statistics.PublishedSucceeded.ToString("N0")) { - IntValue = page.Statistics.Succeeded + IntValue = page.Statistics.PublishedSucceeded }); - public static readonly DashboardMetric FailedCount = new DashboardMetric( - "failed:count", - "Metrics_FailedJobs", - page => new Metric(page.Statistics.Failed.ToString("N0")) - { - IntValue = page.Statistics.Failed, - Style = page.Statistics.Failed > 0 ? MetricStyle.Danger : MetricStyle.Default, - Highlighted = page.Statistics.Failed > 0 - }); + public static readonly DashboardMetric ReceivedSucceededCount = new DashboardMetric( + "received_succeeded:count", + "Metrics_SucceededJobs", + page => new Metric(page.Statistics.ReceivedSucceeded.ToString("N0")) + { + IntValue = page.Statistics.ReceivedSucceeded + }); - public static readonly DashboardMetric DeletedCount = new DashboardMetric( - "deleted:count", - "Metrics_DeletedJobs", - page => new Metric(page.Statistics.Deleted.ToString("N0"))); - public static readonly DashboardMetric AwaitingCount = new DashboardMetric( - "awaiting:count", - "Metrics_AwaitingCount", - page => - { - long awaitingCount = -1; + //---------------------------------------------------- - using (var connection = page.Storage.GetConnection()) - { - var storageConnection = connection as IStorageConnection; - if (storageConnection != null) - { - awaitingCount = storageConnection.GetSetCount("awaiting"); - } - } - - return new Metric(awaitingCount.ToString("N0")) - { - Style = awaitingCount > 0 ? MetricStyle.Info : MetricStyle.Default - }; + public static readonly DashboardMetric PublishedFailedCount = new DashboardMetric( + "publish_failed:count", + "Metrics_FailedJobs", + page => new Metric(page.Statistics.PublishedFailed.ToString("N0")) + { + IntValue = page.Statistics.PublishedFailed, + Style = page.Statistics.PublishedFailed > 0 ? MetricStyle.Danger : MetricStyle.Default, + Highlighted = page.Statistics.PublishedFailed > 0 }); + public static readonly DashboardMetric ReceivedFailedCount = new DashboardMetric( + "received_failed:count", + "Metrics_FailedJobs", + page => new Metric(page.Statistics.ReceivedFailed.ToString("N0")) + { + IntValue = page.Statistics.ReceivedFailed, + Style = page.Statistics.ReceivedFailed > 0 ? MetricStyle.Danger : MetricStyle.Default, + Highlighted = page.Statistics.ReceivedFailed > 0 + }); } } diff --git a/src/DotNetCore.CAP/Dashboard/DashboardRoutes.cs b/src/DotNetCore.CAP/Dashboard/DashboardRoutes.cs index f08f01d..8f5a621 100644 --- a/src/DotNetCore.CAP/Dashboard/DashboardRoutes.cs +++ b/src/DotNetCore.CAP/Dashboard/DashboardRoutes.cs @@ -74,7 +74,7 @@ namespace DotNetCore.CAP.Dashboard #region Razor pages and commands - Routes.AddRazorPage("/jobs/enqueued", x => new QueuesPage()); + //Routes.AddRazorPage("/jobs/enqueued", x => new QueuesPage()); //Routes.AddRazorPage( // "/jobs/enqueued/fetched/(?.+)", // x => new FetchedJobsPage(x.Groups["Queue"].Value)); @@ -105,7 +105,13 @@ namespace DotNetCore.CAP.Dashboard // "/jobs/scheduled/delete", // (client, jobId) => client.ChangeState(jobId, CreateDeletedState(), ScheduledState.StateName)); - //Routes.AddRazorPage("/jobs/succeeded", x => new SucceededJobs()); + Routes.AddRazorPage( + "/published/(?.+)", + x => new PublishedPage(x.Groups["StatusName"].Value)); + + Routes.AddRazorPage( + "/received/(?.+)", + x => new ReceivedPage(x.Groups["StatusName"].Value)); //Routes.AddClientBatchCommand( // "/jobs/succeeded/requeue", // (client, jobId) => client.ChangeState(jobId, CreateEnqueuedState(), SucceededState.StateName)); diff --git a/src/DotNetCore.CAP/Dashboard/HtmlHelper.cs b/src/DotNetCore.CAP/Dashboard/HtmlHelper.cs index d3c83cb..ca18a45 100644 --- a/src/DotNetCore.CAP/Dashboard/HtmlHelper.cs +++ b/src/DotNetCore.CAP/Dashboard/HtmlHelper.cs @@ -29,9 +29,16 @@ namespace DotNetCore.CAP.Dashboard return RenderPartial(new Breadcrumbs(title, items)); } - public NonEscapedString JobsSidebar() + public NonEscapedString JobsSidebar(MessageType type) { - return RenderPartial(new SidebarMenu(JobsSidebarMenu.Items)); + if (type == MessageType.Publish) + { + return SidebarMenu(MessagesSidebarMenu.PublishedItems); + } + else + { + return SidebarMenu(MessagesSidebarMenu.ReceivedItems); + } } public NonEscapedString SidebarMenu(IEnumerable> items) @@ -52,17 +59,17 @@ namespace DotNetCore.CAP.Dashboard return RenderPartial(new InlineMetric(metric)); } - //public NonEscapedString Paginator(Pager pager) - //{ - // if (pager == null) throw new ArgumentNullException(nameof(pager)); - // return RenderPartial(new Paginator(pager)); - //} + public NonEscapedString Paginator(Pager pager) + { + if (pager == null) throw new ArgumentNullException(nameof(pager)); + return RenderPartial(new Paginator(pager)); + } - //public NonEscapedString PerPageSelector(Pager pager) - //{ - // if (pager == null) throw new ArgumentNullException(nameof(pager)); - // return RenderPartial(new PerPageSelector(pager)); - //} + public NonEscapedString PerPageSelector(Pager pager) + { + if (pager == null) throw new ArgumentNullException(nameof(pager)); + return RenderPartial(new PerPageSelector(pager)); + } public NonEscapedString RenderPartial(RazorPage partialPage) { diff --git a/src/DotNetCore.CAP/Dashboard/IMonitoringApi.cs b/src/DotNetCore.CAP/Dashboard/IMonitoringApi.cs index b7bb626..818a640 100644 --- a/src/DotNetCore.CAP/Dashboard/IMonitoringApi.cs +++ b/src/DotNetCore.CAP/Dashboard/IMonitoringApi.cs @@ -6,32 +6,23 @@ namespace DotNetCore.CAP.Dashboard { public interface IMonitoringApi { - IList Queues(); IList Servers(); - JobDetailsDto JobDetails(string jobId); - StatisticsDto GetStatistics(); - JobList EnqueuedJobs(string queue, int from, int perPage); - JobList FetchedJobs(string queue, int from, int perPage); - - 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); + StatisticsDto GetStatistics(); + + IList Messages(MessageQueryDto queryDto); + + int PublishedFailedCount(); + int PublishedProcessingCount(); + int PublishedSucceededCount(); - long ScheduledCount(); - long EnqueuedCount(string queue); - long FetchedCount(string queue); - long FailedCount(); - long ProcessingCount(); + int ReceivedFailedCount(); + int ReceivedProcessingCount(); + int ReceivedSucceededCount(); - long SucceededListCount(); - long DeletedListCount(); - - IDictionary SucceededByDatesCount(); - IDictionary FailedByDatesCount(); - IDictionary HourlySucceededJobs(); - IDictionary HourlyFailedJobs(); + IDictionary SucceededByDatesCount(); + IDictionary FailedByDatesCount(); + IDictionary HourlySucceededJobs(); + IDictionary HourlyFailedJobs(); } } \ No newline at end of file diff --git a/src/DotNetCore.CAP/Dashboard/JobHistoryRenderer.cs b/src/DotNetCore.CAP/Dashboard/JobHistoryRenderer.cs index 5df9a94..04d0d0e 100644 --- a/src/DotNetCore.CAP/Dashboard/JobHistoryRenderer.cs +++ b/src/DotNetCore.CAP/Dashboard/JobHistoryRenderer.cs @@ -20,7 +20,7 @@ namespace DotNetCore.CAP.Dashboard [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1810:InitializeReferenceTypeStaticFieldsInline")] static JobHistoryRenderer() { - Register(SuccessedState.StateName, SucceededRenderer); + Register(SucceededState.StateName, SucceededRenderer); Register(FailedState.StateName, FailedRenderer); Register(ProcessingState.StateName, ProcessingRenderer); Register(EnqueuedState.StateName, EnqueuedRenderer); @@ -29,7 +29,7 @@ namespace DotNetCore.CAP.Dashboard //Register(AwaitingState.StateName, AwaitingRenderer); BackgroundStateColors.Add(EnqueuedState.StateName, "#F5F5F5"); - BackgroundStateColors.Add(SuccessedState.StateName, "#EDF7ED"); + BackgroundStateColors.Add(SucceededState.StateName, "#EDF7ED"); BackgroundStateColors.Add(FailedState.StateName, "#FAEBEA"); BackgroundStateColors.Add(ProcessingState.StateName, "#FCEFDC"); BackgroundStateColors.Add(ScheduledState.StateName, "#E0F3F8"); @@ -37,7 +37,7 @@ namespace DotNetCore.CAP.Dashboard //BackgroundStateColors.Add(AwaitingState.StateName, "#F5F5F5"); ForegroundStateColors.Add(EnqueuedState.StateName, "#999"); - ForegroundStateColors.Add(SuccessedState.StateName, "#5cb85c"); + ForegroundStateColors.Add(SucceededState.StateName, "#5cb85c"); ForegroundStateColors.Add(FailedState.StateName, "#d9534f"); ForegroundStateColors.Add(ProcessingState.StateName, "#f0ad4e"); ForegroundStateColors.Add(ScheduledState.StateName, "#5bc0de"); diff --git a/src/DotNetCore.CAP/Dashboard/MessagesSidebarMenu.cs b/src/DotNetCore.CAP/Dashboard/MessagesSidebarMenu.cs new file mode 100644 index 0000000..fd2d134 --- /dev/null +++ b/src/DotNetCore.CAP/Dashboard/MessagesSidebarMenu.cs @@ -0,0 +1,57 @@ +using System; +using System.Collections.Generic; +using DotNetCore.CAP.Dashboard.Resources; + +namespace DotNetCore.CAP.Dashboard +{ + public static class MessagesSidebarMenu + { + public static readonly List> PublishedItems + = new List>(); + + public static readonly List> ReceivedItems + = new List>(); + + static MessagesSidebarMenu() + { + PublishedItems.Add(page => new MenuItem(Strings.MessagesSidebarMenu_Succeeded, page.Url.To("/published/succeeded")) + { + Active = page.RequestPath.StartsWith("/published/succeeded"), + Metric = DashboardMetrics.PublishedSucceededCount + }); + + PublishedItems.Add(page => new MenuItem(Strings.MessagesSidebarMenu_Processing, page.Url.To("/published/processing")) + { + Active = page.RequestPath.StartsWith("/published/processing"), + Metric = DashboardMetrics.PublishedProcessingCount + }); + + PublishedItems.Add(page => new MenuItem(Strings.MessagesSidebarMenu_Failed, page.Url.To("/published/failed")) + { + Active = page.RequestPath.StartsWith("/published/failed"), + Metric = DashboardMetrics.PublishedFailedCount + }); + + //=======================================ReceivedItems============================= + + ReceivedItems.Add(page => new MenuItem(Strings.MessagesSidebarMenu_Succeeded, page.Url.To("/received/succeeded")) + { + Active = page.RequestPath.StartsWith("/received/succeeded"), + Metric = DashboardMetrics.ReceivedSucceededCount + }); + + ReceivedItems.Add(page => new MenuItem(Strings.MessagesSidebarMenu_Processing, page.Url.To("/received/processing")) + { + Active = page.RequestPath.StartsWith("/received/processing"), + Metric = DashboardMetrics.ReceivedProcessingCount + }); + + ReceivedItems.Add(page => new MenuItem(Strings.MessagesSidebarMenu_Failed, page.Url.To("/received/failed")) + { + Active = page.RequestPath.StartsWith("/received/failed"), + Metric = DashboardMetrics.ReceivedFailedCount + }); + + } + } +} \ No newline at end of file diff --git a/src/DotNetCore.CAP/Dashboard/Monitoring/DeletedJobDto.cs b/src/DotNetCore.CAP/Dashboard/Monitoring/DeletedJobDto.cs deleted file mode 100644 index bdc2bd6..0000000 --- a/src/DotNetCore.CAP/Dashboard/Monitoring/DeletedJobDto.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using DotNetCore.CAP.Models; - -namespace DotNetCore.CAP.Dashboard.Monitoring -{ - public class DeletedJobDto - { - public DeletedJobDto() - { - InDeletedState = true; - } - - public Message Message { get; set; } - public DateTime? DeletedAt { get; set; } - public bool InDeletedState { get; set; } - } -} diff --git a/src/DotNetCore.CAP/Dashboard/Monitoring/MessageDto.cs b/src/DotNetCore.CAP/Dashboard/Monitoring/MessageDto.cs new file mode 100644 index 0000000..ca75645 --- /dev/null +++ b/src/DotNetCore.CAP/Dashboard/Monitoring/MessageDto.cs @@ -0,0 +1,22 @@ +using System; +namespace DotNetCore.CAP.Dashboard.Monitoring +{ + public class MessageDto + { + public int Id { get; set; } + + public string Group { get; set; } + + public string Name { get; set; } + + public string Content { get; set; } + + public DateTime Added { get; set; } + + public DateTime? ExpiresAt { get; set; } + + public int Retries { get; set; } + + public string StatusName { get; set; } + } +} \ No newline at end of file diff --git a/src/DotNetCore.CAP/Dashboard/Monitoring/MessageQueryDto.cs b/src/DotNetCore.CAP/Dashboard/Monitoring/MessageQueryDto.cs new file mode 100644 index 0000000..72a1418 --- /dev/null +++ b/src/DotNetCore.CAP/Dashboard/Monitoring/MessageQueryDto.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Text; +using DotNetCore.CAP.Models; + +namespace DotNetCore.CAP.Dashboard.Monitoring +{ + public class MessageQueryDto + { + public MessageType MessageType { get; set; } + + public string Name { get; set; } + + public string Content { get; set; } + + public string StatusName { get; set; } + + public int CurrentPage { get; set; } + + public int PageSize { get; set; } + } +} diff --git a/src/DotNetCore.CAP/Dashboard/Monitoring/QueueWithTopEnqueuedJobsDto.cs b/src/DotNetCore.CAP/Dashboard/Monitoring/QueueWithTopEnqueuedJobsDto.cs deleted file mode 100644 index ec40525..0000000 --- a/src/DotNetCore.CAP/Dashboard/Monitoring/QueueWithTopEnqueuedJobsDto.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace DotNetCore.CAP.Dashboard.Monitoring -{ - public class QueueWithTopEnqueuedJobsDto - { - public string Name { get; set; } - public long Length { get; set; } - public long? Fetched { get; set; } - public JobList FirstJobs { get; set; } - } -} diff --git a/src/DotNetCore.CAP/Dashboard/Monitoring/StatisticsDto.cs b/src/DotNetCore.CAP/Dashboard/Monitoring/StatisticsDto.cs index 56048ac..3551f38 100644 --- a/src/DotNetCore.CAP/Dashboard/Monitoring/StatisticsDto.cs +++ b/src/DotNetCore.CAP/Dashboard/Monitoring/StatisticsDto.cs @@ -2,14 +2,15 @@ { public class StatisticsDto { - public long Servers { get; set; } - public long Recurring { get; set; } - public long Enqueued { get; set; } - public long Queues { get; set; } - public long Scheduled { get; set; } - public long Processing { get; set; } - public long Succeeded { get; set; } - public long Failed { get; set; } - public long Deleted { get; set; } + public int Servers { get; set; } + + public int PublishedSucceeded { get; set; } + public int ReceivedSucceeded { get; set; } + + public int PublishedFailed { get; set; } + public int ReceivedFailed { get; set; } + + public int PublishedProcessing { get; set; } + public int ReceivedProcessing { get; set; } } } diff --git a/src/DotNetCore.CAP/Dashboard/NavigationMenu.cs b/src/DotNetCore.CAP/Dashboard/NavigationMenu.cs index 0ed59c0..3140467 100644 --- a/src/DotNetCore.CAP/Dashboard/NavigationMenu.cs +++ b/src/DotNetCore.CAP/Dashboard/NavigationMenu.cs @@ -10,26 +10,30 @@ namespace DotNetCore.CAP.Dashboard static NavigationMenu() { - Items.Add(page => new MenuItem(Strings.NavigationMenu_Jobs, page.Url.LinkToQueues()) + Items.Add(page => new MenuItem(Strings.NavigationMenu_Published, page.Url.LinkToPublished()) { - Active = page.RequestPath.StartsWith("/jobs"), + Active = page.RequestPath.StartsWith("/published"), Metrics = new [] { - DashboardMetrics.EnqueuedCountOrNull, - DashboardMetrics.FailedCountOrNull + DashboardMetrics.PublishedSucceededCount, + DashboardMetrics.PublishedFailedCountOrNull } }); - Items.Add(page => new MenuItem(Strings.NavigationMenu_Retries, page.Url.To("/retries")) + Items.Add(page => new MenuItem(Strings.NavigationMenu_Received, page.Url.LinkToReceived()) { - Active = page.RequestPath.StartsWith("/retries"), - Metric = DashboardMetrics.RetriesCount + Active = page.RequestPath.StartsWith("/received"), + Metrics = new[] + { + DashboardMetrics.ReceivedSucceededCount, + DashboardMetrics.ReceivedFailedCountOrNull + } }); - Items.Add(page => new MenuItem(Strings.NavigationMenu_RecurringJobs, page.Url.To("/recurring")) + Items.Add(page => new MenuItem(Strings.NavigationMenu_Retries, page.Url.To("/retries")) { - Active = page.RequestPath.StartsWith("/recurring"), - Metric = DashboardMetrics.RecurringJobCount + Active = page.RequestPath.StartsWith("/retries"), + Metric = DashboardMetrics.RetriesCount }); Items.Add(page => new MenuItem(Strings.NavigationMenu_Servers, page.Url.To("/servers")) diff --git a/src/DotNetCore.CAP/Dashboard/Pages/AwaitingJobsPage.cshtml b/src/DotNetCore.CAP/Dashboard/Pages/AwaitingJobsPage.cshtml deleted file mode 100644 index 582e068..0000000 --- a/src/DotNetCore.CAP/Dashboard/Pages/AwaitingJobsPage.cshtml +++ /dev/null @@ -1,159 +0,0 @@ -@* Generator: Template TypeVisibility: Internal GeneratePrettyNames: true *@ -@using System -@using System.Collections.Generic -@using DotNetCore.CAP -@using DotNetCore.CAP.Dashboard -@using DotNetCore.CAP.Dashboard.Pages -@using DotNetCore.CAP.Dashboard.Resources -@inherits RazorPage -@{ - Layout = new LayoutPage(Strings.AwaitingJobsPage_Title); - - int from, perPage; - - int.TryParse(Query("from"), out from); - int.TryParse(Query("count"), out perPage); - - List jobIds = null; - Pager pager = null; - - using (var connection = Storage.GetConnection()) - { - var storageConnection = connection as IStorageConnection; - - if (storageConnection != null) - { - pager = new Pager(from, perPage, storageConnection.GetSetCount("awaiting")); - jobIds = storageConnection.GetRangeFromSet("awaiting", pager.FromRecord, pager.FromRecord + pager.RecordsPerPage - 1); - } - } -} - -
-
- @Html.JobsSidebar() -
-
-

@Strings.AwaitingJobsPage_Title

- - @if (jobIds == null) - { -
-

@Strings.AwaitingJobsPage_ContinuationsWarning_Title

-

@Strings.AwaitingJobsPage_ContinuationsWarning_Text

-
- } - else if (jobIds.Count > 0) - { -
-
- - - - - @Html.PerPageSelector(pager) -
- -
- - - - - - - - - - - - - @foreach (var jobId in jobIds) - { - MessageData jobData; - StateData stateData; - StateData parentStateData = null; - - using (var connection = Storage.GetConnection()) - { - jobData = connection.GetJobData(jobId); - stateData = connection.GetStateData(jobId); - - //if (stateData != null && stateData.Name == AwaitingState.StateName) - //{ - // parentStateData = connection.GetStateData(stateData.Data["ParentId"]); - //} - } - - - - - @if (jobData == null) - { - - } - else - { - - - - - } - - } - -
- - @Strings.Common_Id@Strings.Common_Job@Strings.AwaitingJobsPage_Table_Options@Strings.AwaitingJobsPage_Table_Parent@Strings.Common_Created
- - - @Html.JobIdLink(jobId) - @Strings.Common_JobExpired - @Html.JobNameLink(jobId, jobData.Message) - - @if (stateData != null && stateData.Data.ContainsKey("Options") && !String.IsNullOrWhiteSpace(stateData.Data["Options"])) - { - @stateData.Data["Options"] - } - else - { - @Strings.Common_NotAvailable - } - - @if (parentStateData != null) - { - - - @parentStateData.Name - - - } - else - { - @Strings.Common_NotAvailable - } - - @Html.RelativeTime(jobData.CreatedAt) -
-
- @Html.Paginator(pager) -
- } - else - { -
- @Strings.AwaitingJobsPage_NoJobs -
- } -
-
diff --git a/src/DotNetCore.CAP/Dashboard/Pages/HomePage.cshtml b/src/DotNetCore.CAP/Dashboard/Pages/HomePage.cshtml index 099064a..4329f59 100644 --- a/src/DotNetCore.CAP/Dashboard/Pages/HomePage.cshtml +++ b/src/DotNetCore.CAP/Dashboard/Pages/HomePage.cshtml @@ -8,8 +8,8 @@ @inherits RazorPage @{ Layout = new LayoutPage(Strings.HomePage_Title); - IDictionary succeeded = null; - IDictionary failed = null; + IDictionary succeeded = null; + IDictionary failed = null; var period = Query("period") ?? "day"; @@ -41,12 +41,12 @@ }

@Strings.HomePage_RealtimeGraph

-
- - + +

diff --git a/src/DotNetCore.CAP/Dashboard/Pages/HomePage.generated.cs b/src/DotNetCore.CAP/Dashboard/Pages/HomePage.generated.cs index 8d67de0..3b55307 100644 --- a/src/DotNetCore.CAP/Dashboard/Pages/HomePage.generated.cs +++ b/src/DotNetCore.CAP/Dashboard/Pages/HomePage.generated.cs @@ -73,8 +73,8 @@ WriteLiteral("\r\n"); #line 9 "..\..\Dashboard\Pages\HomePage.cshtml" Layout = new LayoutPage(Strings.HomePage_Title); - IDictionary succeeded = null; - IDictionary failed = null; + IDictionary succeeded = null; + IDictionary failed = null; var period = Query("period") ?? "day"; @@ -172,7 +172,7 @@ WriteLiteral("

\r\n
- - + +

diff --git a/src/DotNetCore.CAP/Dashboard/Pages/ProcessingJobsPage.cshtml b/src/DotNetCore.CAP/Dashboard/Pages/ProcessingJobsPage.cshtml deleted file mode 100644 index af50fb9..0000000 --- a/src/DotNetCore.CAP/Dashboard/Pages/ProcessingJobsPage.cshtml +++ /dev/null @@ -1,123 +0,0 @@ -@* Generator: Template TypeVisibility: Internal GeneratePrettyNames: True *@ -@using System -@using System.Linq -@using DotNetCore.CAP.Dashboard -@using DotNetCore.CAP.Dashboard.Pages -@using DotNetCore.CAP.Dashboard.Resources -@inherits RazorPage -@{ - Layout = new LayoutPage(Strings.ProcessingJobsPage_Title); - - int from, perPage; - - int.TryParse(Query("from"), out from); - int.TryParse(Query("count"), out perPage); - - var monitor = Storage.GetMonitoringApi(); - var pager = new Pager(from, perPage, monitor.ProcessingCount()); - var processingJobs = monitor.ProcessingJobs(pager.FromRecord, pager.RecordsPerPage); - var servers = monitor.Servers(); -} - -
-
- @Html.JobsSidebar() -
-
-

@Strings.ProcessingJobsPage_Title

- - @if (pager.TotalPageCount == 0) - { -
- @Strings.ProcessingJobsPage_NoJobs -
- } - else - { -
-
- - - - - @Html.PerPageSelector(pager) -
- -
- - - - - - - - - - - - @foreach (var job in processingJobs) - { - - - - @if (!job.Value.InProcessingState) - { - - } - else - { - - - - } - - } - -
- - @Strings.Common_Id@Strings.Common_Server@Strings.Common_Job@Strings.ProcessingJobsPage_Table_Started
- @if (job.Value.InProcessingState) - { - - } - - @Html.JobIdLink(job.Key) - @if (!job.Value.InProcessingState) - { - - } - @Strings.Common_JobStateChanged_Text - @Html.ServerId(job.Value.ServerId) - - @if (servers.All(x => x.Name != job.Value.ServerId || x.Heartbeat < DateTime.UtcNow.AddMinutes(-1))) - { - - } - - @Html.JobNameLink(job.Key, job.Value.Job) - - @if (job.Value.StartedAt.HasValue) - { - @Html.RelativeTime(job.Value.StartedAt.Value) - } -
-
- - @Html.Paginator(pager) -
- } -
-
\ No newline at end of file diff --git a/src/DotNetCore.CAP/Dashboard/Pages/PublishedPage.cs b/src/DotNetCore.CAP/Dashboard/Pages/PublishedPage.cs new file mode 100644 index 0000000..d2b6fc5 --- /dev/null +++ b/src/DotNetCore.CAP/Dashboard/Pages/PublishedPage.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Text; +using DotNetCore.CAP.Processor.States; + +namespace DotNetCore.CAP.Dashboard.Pages +{ + internal partial class PublishedPage + { + public PublishedPage(string statusName) + { + StatusName = statusName; + } + + public string StatusName { get; set; } + + public int GetTotal(IMonitoringApi api) + { + if (String.Compare(StatusName, SucceededState.StateName, true) == 0) + { + return api.PublishedSucceededCount(); + } + else if (String.Compare(StatusName, ProcessingState.StateName, true) == 0) + { + return api.PublishedProcessingCount(); + } + else + { + return api.PublishedFailedCount(); + } + } + } +} diff --git a/src/DotNetCore.CAP/Dashboard/Pages/PublishedPage.cshtml b/src/DotNetCore.CAP/Dashboard/Pages/PublishedPage.cshtml new file mode 100644 index 0000000..2b697f8 --- /dev/null +++ b/src/DotNetCore.CAP/Dashboard/Pages/PublishedPage.cshtml @@ -0,0 +1,122 @@ +@* Generator: Template TypeVisibility: Internal GeneratePrettyNames: True *@ +@using System +@using DotNetCore.CAP.Models; +@using DotNetCore.CAP.Dashboard +@using DotNetCore.CAP.Dashboard.Pages +@using DotNetCore.CAP.Dashboard.Monitoring +@using DotNetCore.CAP.Dashboard.Resources +@inherits RazorPage +@{ + Layout = new LayoutPage(Strings.SucceededMessagesPage_Title); + + int from, perPage; + + int.TryParse(Query("from"), out from); + int.TryParse(Query("count"), out perPage); + string name = Query("name"); + string content = Query("content"); + + var monitor = Storage.GetMonitoringApi(); + var pager = new Pager(from, perPage, GetTotal(monitor)); + var total = 0; + var queryDto = new MessageQueryDto + { + MessageType = MessageType.Publish, + Name = name, + Content = content, + StatusName = StatusName, + CurrentPage = pager.CurrentPage - 1, + PageSize = pager.RecordsPerPage + }; + var succeededMessages = monitor.Messages(queryDto); +} + +
+
+ @Html.JobsSidebar(MessageType.Publish) +
+
+

@Strings.SucceededMessagesPage_Title

+ + @if (succeededMessages.Count == 0) + { +
+ @Strings.SucceededJobsPage_NoJobs +
+ } + else + { +
+
+
+ + + +
+
+ + + + +
+
+
+
+
+ + + @Html.PerPageSelector(pager) +
+ +
+ + + + + + + + + + + + @foreach (var message in succeededMessages) + { + + + + + + + + + } + +
+ + 名称内容重试次数过期时间
+ + + @message.Name + + @message.Content + + @message.Retries + + @if (message.ExpiresAt.HasValue) + { + @Html.RelativeTime(message.ExpiresAt.Value) + } +
+
+ @Html.Paginator(pager) +
+ } +
+
\ No newline at end of file diff --git a/src/DotNetCore.CAP/Dashboard/Pages/PublishedPage1.generated.cs b/src/DotNetCore.CAP/Dashboard/Pages/PublishedPage1.generated.cs new file mode 100644 index 0000000..b1d8da9 --- /dev/null +++ b/src/DotNetCore.CAP/Dashboard/Pages/PublishedPage1.generated.cs @@ -0,0 +1,372 @@ +#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 DotNetCore.CAP.Dashboard.Pages +{ + + #line 2 "..\..\Dashboard\Pages\PublishedPage.cshtml" + using System; + + #line default + #line hidden + using System.Collections.Generic; + using System.Linq; + using System.Text; + + #line 4 "..\..\Dashboard\Pages\PublishedPage.cshtml" + using DotNetCore.CAP.Dashboard; + + #line default + #line hidden + + #line 6 "..\..\Dashboard\Pages\PublishedPage.cshtml" + using DotNetCore.CAP.Dashboard.Monitoring; + + #line default + #line hidden + + #line 5 "..\..\Dashboard\Pages\PublishedPage.cshtml" + using DotNetCore.CAP.Dashboard.Pages; + + #line default + #line hidden + + #line 7 "..\..\Dashboard\Pages\PublishedPage.cshtml" + using DotNetCore.CAP.Dashboard.Resources; + + #line default + #line hidden + + #line 3 "..\..\Dashboard\Pages\PublishedPage.cshtml" + using DotNetCore.CAP.Models; + + #line default + #line hidden + + [System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")] + internal partial class PublishedPage : RazorPage + { +#line hidden + + public override void Execute() + { + + +WriteLiteral("\r\n"); + + + + + + + + + + + #line 9 "..\..\Dashboard\Pages\PublishedPage.cshtml" + + Layout = new LayoutPage(Strings.SucceededMessagesPage_Title); + + int from, perPage; + + int.TryParse(Query("from"), out from); + int.TryParse(Query("count"), out perPage); + string name = Query("name"); + string content = Query("content"); + + var monitor = Storage.GetMonitoringApi(); + var pager = new Pager(from, perPage, GetTotal(monitor)); + var total = 0; + var queryDto = new MessageQueryDto + { + MessageType = MessageType.Publish, + Name = name, + Content = content, + StatusName = StatusName, + CurrentPage = pager.CurrentPage - 1, + PageSize = pager.RecordsPerPage + }; + var succeededMessages = monitor.Messages(queryDto); + + + + #line default + #line hidden +WriteLiteral("\r\n
\r\n
\r\n "); + + + + #line 36 "..\..\Dashboard\Pages\PublishedPage.cshtml" + Write(Html.JobsSidebar(MessageType.Publish)); + + + #line default + #line hidden +WriteLiteral("\r\n
\r\n
\r\n

"); + + + + #line 39 "..\..\Dashboard\Pages\PublishedPage.cshtml" + Write(Strings.SucceededMessagesPage_Title); + + + #line default + #line hidden +WriteLiteral("

\r\n\r\n"); + + + + #line 41 "..\..\Dashboard\Pages\PublishedPage.cshtml" + if (succeededMessages.Count == 0) + { + + + #line default + #line hidden +WriteLiteral("
\r\n "); + + + + #line 44 "..\..\Dashboard\Pages\PublishedPage.cshtml" + Write(Strings.SucceededJobsPage_NoJobs); + + + #line default + #line hidden +WriteLiteral("\r\n
\r\n"); + + + + #line 46 "..\..\Dashboard\Pages\PublishedPage.cshtml" + } + else + { + + + #line default + #line hidden +WriteLiteral(@"
+
+
+ + \r\n \r\n " + +"
\r\n
\r\n" + +" + + + +
+
+
+
+
+ \r\n\r\n "); + + + + #line 74 "..\..\Dashboard\Pages\PublishedPage.cshtml" + Write(Html.PerPageSelector(pager)); + + + #line default + #line hidden +WriteLiteral(@" +
+ +
+ + + + + + + + + + + +"); + + + + #line 91 "..\..\Dashboard\Pages\PublishedPage.cshtml" + foreach (var message in succeededMessages) + { + + + #line default + #line hidden +WriteLiteral(" \r\n " + +" \r\n " + +" \r\n " + +"\r\n " + +"\r\n " + +"\r\n\r\n \r\n"); + + + + #line 114 "..\..\Dashboard\Pages\PublishedPage.cshtml" + } + + + #line default + #line hidden +WriteLiteral(" \r\n
+ + 名称内容重试次数过期时间
\r\n \r\n \r\n "); + + + + #line 98 "..\..\Dashboard\Pages\PublishedPage.cshtml" + Write(message.Name); + + + #line default + #line hidden +WriteLiteral("\r\n \r\n "); + + + + #line 101 "..\..\Dashboard\Pages\PublishedPage.cshtml" + Write(message.Content); + + + #line default + #line hidden +WriteLiteral("\r\n \r\n "); + + + + #line 104 "..\..\Dashboard\Pages\PublishedPage.cshtml" + Write(message.Retries); + + + #line default + #line hidden +WriteLiteral("\r\n \r\n"); + + + + #line 107 "..\..\Dashboard\Pages\PublishedPage.cshtml" + if (message.ExpiresAt.HasValue) + { + + + #line default + #line hidden + + #line 109 "..\..\Dashboard\Pages\PublishedPage.cshtml" + Write(Html.RelativeTime(message.ExpiresAt.Value)); + + + #line default + #line hidden + + #line 109 "..\..\Dashboard\Pages\PublishedPage.cshtml" + + } + + + #line default + #line hidden +WriteLiteral("
\r\n <" + +"/div>\r\n "); + + + + #line 118 "..\..\Dashboard\Pages\PublishedPage.cshtml" + Write(Html.Paginator(pager)); + + + #line default + #line hidden +WriteLiteral("\r\n
\r\n"); + + + + #line 120 "..\..\Dashboard\Pages\PublishedPage.cshtml" + } + + + #line default + #line hidden +WriteLiteral("
\r\n
"); + + + } + } +} +#pragma warning restore 1591 diff --git a/src/DotNetCore.CAP/Dashboard/Pages/ReceivedPage.cs b/src/DotNetCore.CAP/Dashboard/Pages/ReceivedPage.cs new file mode 100644 index 0000000..09c857f --- /dev/null +++ b/src/DotNetCore.CAP/Dashboard/Pages/ReceivedPage.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Text; +using DotNetCore.CAP.Processor.States; + +namespace DotNetCore.CAP.Dashboard.Pages +{ + internal partial class ReceivedPage + { + public ReceivedPage(string statusName) + { + StatusName = statusName; + } + + public string StatusName { get; set; } + + public int GetTotal(IMonitoringApi api) + { + if (String.Compare(StatusName, SucceededState.StateName, true) == 0) + { + return api.ReceivedSucceededCount(); + } + else if (String.Compare(StatusName, ProcessingState.StateName, true) == 0) + { + return api.ReceivedProcessingCount(); + } + else + { + return api.ReceivedFailedCount(); + } + } + } +} diff --git a/src/DotNetCore.CAP/Dashboard/Pages/ReceivedPage.cshtml b/src/DotNetCore.CAP/Dashboard/Pages/ReceivedPage.cshtml new file mode 100644 index 0000000..c1f4c3d --- /dev/null +++ b/src/DotNetCore.CAP/Dashboard/Pages/ReceivedPage.cshtml @@ -0,0 +1,121 @@ +@* Generator: Template TypeVisibility: Internal GeneratePrettyNames: True *@ +@using System +@using DotNetCore.CAP.Models; +@using DotNetCore.CAP.Dashboard +@using DotNetCore.CAP.Dashboard.Pages +@using DotNetCore.CAP.Dashboard.Monitoring +@using DotNetCore.CAP.Dashboard.Resources +@inherits RazorPage +@{ + Layout = new LayoutPage(Strings.SucceededMessagesPage_Title); + + int from, perPage; + + int.TryParse(Query("from"), out from); + int.TryParse(Query("count"), out perPage); + string name = Query("name"); + string content = Query("content"); + + var monitor = Storage.GetMonitoringApi(); + var pager = new Pager(from, perPage, GetTotal(monitor)); + var total = 0; + var queryDto = new MessageQueryDto + { + MessageType = MessageType.Subscribe, + Name = name, + Content = content, + StatusName = StatusName, + CurrentPage = pager.CurrentPage - 1, + PageSize = pager.RecordsPerPage + }; + var succeededMessages = monitor.Messages(queryDto); +} + +
+
+ @Html.JobsSidebar(MessageType.Subscribe) +
+
+

@Strings.SucceededMessagesPage_Title

+ + @if (succeededMessages.Count == 0) + { +
+ @Strings.SucceededJobsPage_NoJobs +
+ } + else + { +
+
+
+ + + +
+
+ + + + +
+
+
+
+
+ + + @Html.PerPageSelector(pager) +
+ +
+ + + + + + + + + + + + @foreach (var message in succeededMessages) + { + + + + + + + + } + +
+ + 名称内容重试次数过期时间
+ + + @message.Name + + @message.Content + + @message.Retries + + @if (message.ExpiresAt.HasValue) + { + @Html.RelativeTime(message.ExpiresAt.Value) + } +
+
+ @Html.Paginator(pager) +
+ } +
+
\ No newline at end of file diff --git a/src/DotNetCore.CAP/Dashboard/Pages/ReceivedPage.generated.cs b/src/DotNetCore.CAP/Dashboard/Pages/ReceivedPage.generated.cs new file mode 100644 index 0000000..a004b15 --- /dev/null +++ b/src/DotNetCore.CAP/Dashboard/Pages/ReceivedPage.generated.cs @@ -0,0 +1,372 @@ +#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 DotNetCore.CAP.Dashboard.Pages +{ + + #line 2 "..\..\Dashboard\Pages\ReceivedPage.cshtml" + using System; + + #line default + #line hidden + using System.Collections.Generic; + using System.Linq; + using System.Text; + + #line 4 "..\..\Dashboard\Pages\ReceivedPage.cshtml" + using DotNetCore.CAP.Dashboard; + + #line default + #line hidden + + #line 6 "..\..\Dashboard\Pages\ReceivedPage.cshtml" + using DotNetCore.CAP.Dashboard.Monitoring; + + #line default + #line hidden + + #line 5 "..\..\Dashboard\Pages\ReceivedPage.cshtml" + using DotNetCore.CAP.Dashboard.Pages; + + #line default + #line hidden + + #line 7 "..\..\Dashboard\Pages\ReceivedPage.cshtml" + using DotNetCore.CAP.Dashboard.Resources; + + #line default + #line hidden + + #line 3 "..\..\Dashboard\Pages\ReceivedPage.cshtml" + using DotNetCore.CAP.Models; + + #line default + #line hidden + + [System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")] + internal partial class ReceivedPage : RazorPage + { +#line hidden + + public override void Execute() + { + + +WriteLiteral("\r\n"); + + + + + + + + + + + #line 9 "..\..\Dashboard\Pages\ReceivedPage.cshtml" + + Layout = new LayoutPage(Strings.SucceededMessagesPage_Title); + + int from, perPage; + + int.TryParse(Query("from"), out from); + int.TryParse(Query("count"), out perPage); + string name = Query("name"); + string content = Query("content"); + + var monitor = Storage.GetMonitoringApi(); + var pager = new Pager(from, perPage, GetTotal(monitor)); + var total = 0; + var queryDto = new MessageQueryDto + { + MessageType = MessageType.Subscribe, + Name = name, + Content = content, + StatusName = StatusName, + CurrentPage = pager.CurrentPage - 1, + PageSize = pager.RecordsPerPage + }; + var succeededMessages = monitor.Messages(queryDto); + + + + #line default + #line hidden +WriteLiteral("\r\n
\r\n
\r\n "); + + + + #line 36 "..\..\Dashboard\Pages\ReceivedPage.cshtml" + Write(Html.JobsSidebar(MessageType.Subscribe)); + + + #line default + #line hidden +WriteLiteral("\r\n
\r\n
\r\n

"); + + + + #line 39 "..\..\Dashboard\Pages\ReceivedPage.cshtml" + Write(Strings.SucceededMessagesPage_Title); + + + #line default + #line hidden +WriteLiteral("

\r\n\r\n"); + + + + #line 41 "..\..\Dashboard\Pages\ReceivedPage.cshtml" + if (succeededMessages.Count == 0) + { + + + #line default + #line hidden +WriteLiteral("
\r\n "); + + + + #line 44 "..\..\Dashboard\Pages\ReceivedPage.cshtml" + Write(Strings.SucceededJobsPage_NoJobs); + + + #line default + #line hidden +WriteLiteral("\r\n
\r\n"); + + + + #line 46 "..\..\Dashboard\Pages\ReceivedPage.cshtml" + } + else + { + + + #line default + #line hidden +WriteLiteral(@"
+
+
+ + \r\n \r\n " + +"
\r\n
\r\n" + +" + + + +
+
+
+
+
+ \r\n\r\n "); + + + + #line 74 "..\..\Dashboard\Pages\ReceivedPage.cshtml" + Write(Html.PerPageSelector(pager)); + + + #line default + #line hidden +WriteLiteral(@" +
+ +
+ + + + + + + + + + + +"); + + + + #line 91 "..\..\Dashboard\Pages\ReceivedPage.cshtml" + foreach (var message in succeededMessages) + { + + + #line default + #line hidden +WriteLiteral(" \r\n " + +" \r\n " + +" \r\n " + +"\r\n " + +"\r\n " + +"\r\n \r" + +"\n"); + + + + #line 113 "..\..\Dashboard\Pages\ReceivedPage.cshtml" + } + + + #line default + #line hidden +WriteLiteral(" \r\n
+ + 名称内容重试次数过期时间
\r\n \r\n \r\n "); + + + + #line 98 "..\..\Dashboard\Pages\ReceivedPage.cshtml" + Write(message.Name); + + + #line default + #line hidden +WriteLiteral("\r\n \r\n "); + + + + #line 101 "..\..\Dashboard\Pages\ReceivedPage.cshtml" + Write(message.Content); + + + #line default + #line hidden +WriteLiteral("\r\n \r\n "); + + + + #line 104 "..\..\Dashboard\Pages\ReceivedPage.cshtml" + Write(message.Retries); + + + #line default + #line hidden +WriteLiteral("\r\n \r\n"); + + + + #line 107 "..\..\Dashboard\Pages\ReceivedPage.cshtml" + if (message.ExpiresAt.HasValue) + { + + + #line default + #line hidden + + #line 109 "..\..\Dashboard\Pages\ReceivedPage.cshtml" + Write(Html.RelativeTime(message.ExpiresAt.Value)); + + + #line default + #line hidden + + #line 109 "..\..\Dashboard\Pages\ReceivedPage.cshtml" + + } + + + #line default + #line hidden +WriteLiteral("
\r\n <" + +"/div>\r\n "); + + + + #line 117 "..\..\Dashboard\Pages\ReceivedPage.cshtml" + Write(Html.Paginator(pager)); + + + #line default + #line hidden +WriteLiteral("\r\n
\r\n"); + + + + #line 119 "..\..\Dashboard\Pages\ReceivedPage.cshtml" + } + + + #line default + #line hidden +WriteLiteral("
\r\n
"); + + + } + } +} +#pragma warning restore 1591 diff --git a/src/DotNetCore.CAP/Dashboard/Pages/_Paginator.generated.cs b/src/DotNetCore.CAP/Dashboard/Pages/_Paginator.generated.cs new file mode 100644 index 0000000..020372e --- /dev/null +++ b/src/DotNetCore.CAP/Dashboard/Pages/_Paginator.generated.cs @@ -0,0 +1,248 @@ +#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 DotNetCore.CAP.Dashboard.Pages +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Text; + + #line 2 "..\..\Dashboard\Pages\_Paginator.cshtml" + using DotNetCore.CAP.Dashboard; + + #line default + #line hidden + + #line 3 "..\..\Dashboard\Pages\_Paginator.cshtml" + using DotNetCore.CAP.Dashboard.Resources; + + #line default + #line hidden + + [System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")] + internal partial class Paginator : RazorPage + { +#line hidden + + public override void Execute() + { + + +WriteLiteral("\r\n"); + + + +WriteLiteral("\r\n"); + + +WriteLiteral("
\r\n"); + + + + #line 7 "..\..\Dashboard\Pages\_Paginator.cshtml" + if (_pager.TotalPageCount > 1) + { + + + #line default + #line hidden +WriteLiteral("
\r\n"); + + + + #line 10 "..\..\Dashboard\Pages\_Paginator.cshtml" + foreach (var page in _pager.PagerItems) + { + switch (page.Type) + { + case Pager.ItemType.Page: + + + #line default + #line hidden +WriteLiteral(" \r\n"); + + + + #line 18 "..\..\Dashboard\Pages\_Paginator.cshtml" + break; + case Pager.ItemType.NextPage: + + + #line default + #line hidden +WriteLiteral(" \r\n"); + + + + #line 23 "..\..\Dashboard\Pages\_Paginator.cshtml" + break; + case Pager.ItemType.PrevPage: + + + #line default + #line hidden +WriteLiteral(" \r\n"); + + + + #line 28 "..\..\Dashboard\Pages\_Paginator.cshtml" + break; + case Pager.ItemType.MorePage: + + + #line default + #line hidden +WriteLiteral(" \r\n " + +" …\r\n \r\n"); + + + + #line 33 "..\..\Dashboard\Pages\_Paginator.cshtml" + break; + } + } + + + #line default + #line hidden +WriteLiteral("
\r\n"); + + + +WriteLiteral("
\r\n"); + + + + #line 38 "..\..\Dashboard\Pages\_Paginator.cshtml" + } + + + #line default + #line hidden +WriteLiteral("\r\n
\r\n "); + + + + #line 41 "..\..\Dashboard\Pages\_Paginator.cshtml" + Write(Strings.Paginator_TotalItems); + + + #line default + #line hidden +WriteLiteral(": "); + + + + #line 41 "..\..\Dashboard\Pages\_Paginator.cshtml" + Write(_pager.TotalRecordCount); + + + #line default + #line hidden +WriteLiteral("\r\n
\r\n
\r\n"); + + + } + } +} +#pragma warning restore 1591 diff --git a/src/DotNetCore.CAP/Dashboard/Pages/_PerPageSelector.generated.cs b/src/DotNetCore.CAP/Dashboard/Pages/_PerPageSelector.generated.cs new file mode 100644 index 0000000..57428c5 --- /dev/null +++ b/src/DotNetCore.CAP/Dashboard/Pages/_PerPageSelector.generated.cs @@ -0,0 +1,106 @@ +#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 DotNetCore.CAP.Dashboard.Pages +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Text; + + #line 2 "..\..\Dashboard\Pages\_PerPageSelector.cshtml" + using DotNetCore.CAP.Dashboard.Resources; + + #line default + #line hidden + + [System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")] + internal partial class PerPageSelector : DotNetCore.CAP.Dashboard.RazorPage + { +#line hidden + + public override void Execute() + { + + +WriteLiteral("\r\n"); + + + +WriteLiteral("\r\n
\r\n"); + + + + #line 6 "..\..\Dashboard\Pages\_PerPageSelector.cshtml" + foreach (var count in new[] { 10, 20, 50, 100, 500 }) + { + + + #line default + #line hidden +WriteLiteral(" \r\n"); + + + + #line 10 "..\..\Dashboard\Pages\_PerPageSelector.cshtml" + } + + + #line default + #line hidden +WriteLiteral("
\r\n
\r\n
\r\n "); + + + + #line 14 "..\..\Dashboard\Pages\_PerPageSelector.cshtml" + Write(Strings.PerPageSelector_ItemsPerPage); + + + #line default + #line hidden +WriteLiteral(":\r\n
\r\n"); + + + } + } +} +#pragma warning restore 1591 diff --git a/src/DotNetCore.CAP/Dashboard/UrlHelper.cs b/src/DotNetCore.CAP/Dashboard/UrlHelper.cs index cbfb2e8..64316b2 100644 --- a/src/DotNetCore.CAP/Dashboard/UrlHelper.cs +++ b/src/DotNetCore.CAP/Dashboard/UrlHelper.cs @@ -31,9 +31,14 @@ namespace DotNetCore.CAP.Dashboard return To("/jobs/details/" + jobId); } - public string LinkToQueues() + public string LinkToPublished() { - return To("/jobs/enqueued"); + return To("/published/succeeded"); + } + + public string LinkToReceived() + { + return To("/received/succeeded"); } public string Queue(string queue)