From 1b919d6010688db1ebfdc09121d97571724e11d5 Mon Sep 17 00:00:00 2001 From: yangxiaodong Date: Thu, 7 Sep 2017 18:34:08 +0800 Subject: [PATCH] modify published pages. --- .../Dashboard/DashboardRoutes.cs | 37 +++++++---- .../Dashboard/Pages/PublishedPage.cshtml | 66 +++++++++++++++++-- .../Pages/PublishedPage1.generated.cs | 29 ++++++++ 3 files changed, 115 insertions(+), 17 deletions(-) diff --git a/src/DotNetCore.CAP/Dashboard/DashboardRoutes.cs b/src/DotNetCore.CAP/Dashboard/DashboardRoutes.cs index 8f5a621..3b1cce5 100644 --- a/src/DotNetCore.CAP/Dashboard/DashboardRoutes.cs +++ b/src/DotNetCore.CAP/Dashboard/DashboardRoutes.cs @@ -8,20 +8,22 @@ namespace DotNetCore.CAP.Dashboard { private static readonly string[] Javascripts = { - "jquery-2.1.4.min.js", + "jquery-2.1.4.min.js", "bootstrap.min.js", "moment.min.js", "moment-with-locales.min.js", - "d3.min.js", - "d3.layout.min.js", - "rickshaw.min.js", + "d3.min.js", + "d3.layout.min.js", + "rickshaw.min.js", + "jsonview.min.js", "cap.js" }; private static readonly string[] Stylesheets = { - "bootstrap.min.css", - "rickshaw.min.css", + "bootstrap.min.css", + "rickshaw.min.css", + "jsonview.min.css", "cap.css" }; @@ -30,7 +32,7 @@ namespace DotNetCore.CAP.Dashboard Routes = new RouteCollection(); Routes.AddRazorPage("/", x => new HomePage()); Routes.Add("/stats", new JsonStats()); - + #region Embedded static content Routes.Add("/js[0-9]+", new CombinedResourceDispatcher( @@ -74,6 +76,14 @@ namespace DotNetCore.CAP.Dashboard #region Razor pages and commands + + Routes.AddJsonResult("/publishd/message/(?.+)", x => + { + var id = int.Parse(x.UriMatch.Groups["Id"].Value); + var message = x.Storage.GetConnection().GetPublishedMessageAsync(id).GetAwaiter().GetResult(); + return message; + }); + //Routes.AddRazorPage("/jobs/enqueued", x => new QueuesPage()); //Routes.AddRazorPage( // "/jobs/enqueued/fetched/(?.+)", @@ -106,15 +116,16 @@ namespace DotNetCore.CAP.Dashboard // (client, jobId) => client.ChangeState(jobId, CreateDeletedState(), ScheduledState.StateName)); Routes.AddRazorPage( - "/published/(?.+)", + "/published/(?.+)", x => new PublishedPage(x.Groups["StatusName"].Value)); + //Routes.AddPublishBatchCommand( + // "/published/succeeded/requeue", + // (client, jobId) => client.ChangeState(jobId, CreateEnqueuedState(), SucceededState.StateName)); + Routes.AddRazorPage( "/received/(?.+)", x => new ReceivedPage(x.Groups["StatusName"].Value)); - //Routes.AddClientBatchCommand( - // "/jobs/succeeded/requeue", - // (client, jobId) => client.ChangeState(jobId, CreateEnqueuedState(), SucceededState.StateName)); //Routes.AddRazorPage("/jobs/failed", x => new FailedJobsPage()); @@ -175,7 +186,7 @@ namespace DotNetCore.CAP.Dashboard internal static string GetContentFolderNamespace(string contentFolder) { - return $"{typeof (DashboardRoutes).Namespace}.Content.{contentFolder}"; + return $"{typeof(DashboardRoutes).Namespace}.Content.{contentFolder}"; } internal static string GetContentResourceName(string contentFolder, string resourceName) @@ -195,7 +206,7 @@ namespace DotNetCore.CAP.Dashboard private static Assembly GetExecutingAssembly() { - return typeof (DashboardRoutes).GetTypeInfo().Assembly; + return typeof(DashboardRoutes).GetTypeInfo().Assembly; } } } diff --git a/src/DotNetCore.CAP/Dashboard/Pages/PublishedPage.cshtml b/src/DotNetCore.CAP/Dashboard/Pages/PublishedPage.cshtml index 64fe84e..cb6df96 100644 --- a/src/DotNetCore.CAP/Dashboard/Pages/PublishedPage.cshtml +++ b/src/DotNetCore.CAP/Dashboard/Pages/PublishedPage.cshtml @@ -24,7 +24,7 @@ Name = name, Content = content, StatusName = StatusName, - CurrentPage = pager.CurrentPage - 1, + CurrentPage = pager.CurrentPage - 1, PageSize = pager.RecordsPerPage }; var succeededMessages = monitor.Messages(queryDto); @@ -80,6 +80,7 @@ + 编号 名称 内容 重试次数 @@ -94,10 +95,10 @@ - @message.Name + @message.Id - @message.Content + @message.Name @message.Retries @@ -116,6 +117,63 @@ @Html.Paginator(pager) + +
+ +
} - \ No newline at end of file + + + \ 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 index 99ecc12..ca28edb 100644 --- a/src/DotNetCore.CAP/Dashboard/Pages/PublishedPage1.generated.cs +++ b/src/DotNetCore.CAP/Dashboard/Pages/PublishedPage1.generated.cs @@ -357,6 +357,35 @@ WriteLiteral("\r\n \r\n"); #line 119 "..\..\Dashboard\Pages\PublishedPage.cshtml" + + + + #line default + #line hidden +WriteLiteral(@"
+
+
+
+
+ +

Modal title

+
+
+

One fine body…

+
+
+ + +
+
+
+
+
+"); + + + + #line 139 "..\..\Dashboard\Pages\PublishedPage.cshtml" }