diff --git a/src/DotNetCore.CAP/Dashboard/BatchCommandDispatcher.cs b/src/DotNetCore.CAP/Dashboard/BatchCommandDispatcher.cs index a51b0a2..6615140 100644 --- a/src/DotNetCore.CAP/Dashboard/BatchCommandDispatcher.cs +++ b/src/DotNetCore.CAP/Dashboard/BatchCommandDispatcher.cs @@ -31,4 +31,4 @@ namespace DotNetCore.CAP.Dashboard context.Response.StatusCode = (int)HttpStatusCode.NoContent; } } -} +} \ No newline at end of file diff --git a/src/DotNetCore.CAP/Dashboard/CombinedResourceDispatcher.cs b/src/DotNetCore.CAP/Dashboard/CombinedResourceDispatcher.cs index 6c6d3af..3004b30 100644 --- a/src/DotNetCore.CAP/Dashboard/CombinedResourceDispatcher.cs +++ b/src/DotNetCore.CAP/Dashboard/CombinedResourceDispatcher.cs @@ -9,9 +9,9 @@ namespace DotNetCore.CAP.Dashboard private readonly string[] _resourceNames; public CombinedResourceDispatcher( - string contentType, - Assembly assembly, - string baseNamespace, + string contentType, + Assembly assembly, + string baseNamespace, params string[] resourceNames) : base(contentType, assembly, null) { _assembly = assembly; @@ -30,4 +30,4 @@ namespace DotNetCore.CAP.Dashboard } } } -} +} \ No newline at end of file diff --git a/src/DotNetCore.CAP/Dashboard/CommandDispatcher.cs b/src/DotNetCore.CAP/Dashboard/CommandDispatcher.cs index 3abde72..85dd87a 100644 --- a/src/DotNetCore.CAP/Dashboard/CommandDispatcher.cs +++ b/src/DotNetCore.CAP/Dashboard/CommandDispatcher.cs @@ -15,7 +15,7 @@ namespace DotNetCore.CAP.Dashboard public Task Dispatch(DashboardContext context) { - var request = context.Request; + var request = context.Request; var response = context.Response; if (!"POST".Equals(request.Method, StringComparison.OrdinalIgnoreCase)) @@ -36,4 +36,4 @@ namespace DotNetCore.CAP.Dashboard return Task.FromResult(true); } } -} +} \ No newline at end of file diff --git a/src/DotNetCore.CAP/Dashboard/DashboardContext.cs b/src/DotNetCore.CAP/Dashboard/DashboardContext.cs index 44964b6..de6dd43 100644 --- a/src/DotNetCore.CAP/Dashboard/DashboardContext.cs +++ b/src/DotNetCore.CAP/Dashboard/DashboardContext.cs @@ -1,6 +1,4 @@ using System; -using System.Collections.Generic; -using System.Text; using System.Text.RegularExpressions; using Microsoft.AspNetCore.Http; @@ -48,4 +46,4 @@ namespace DotNetCore.CAP.Dashboard public HttpContext HttpContext { get; } } -} +} \ No newline at end of file diff --git a/src/DotNetCore.CAP/Dashboard/DashboardMetric.cs b/src/DotNetCore.CAP/Dashboard/DashboardMetric.cs index cef8593..8bda1b1 100644 --- a/src/DotNetCore.CAP/Dashboard/DashboardMetric.cs +++ b/src/DotNetCore.CAP/Dashboard/DashboardMetric.cs @@ -4,7 +4,7 @@ namespace DotNetCore.CAP.Dashboard { public class DashboardMetric { - public DashboardMetric(string name, Func func) + public DashboardMetric(string name, Func func) : this(name, name, func) { } diff --git a/src/DotNetCore.CAP/Dashboard/DashboardMetrics.cs b/src/DotNetCore.CAP/Dashboard/DashboardMetrics.cs index 26a7b68..cf54595 100644 --- a/src/DotNetCore.CAP/Dashboard/DashboardMetrics.cs +++ b/src/DotNetCore.CAP/Dashboard/DashboardMetrics.cs @@ -135,7 +135,6 @@ namespace DotNetCore.CAP.Dashboard IntValue = page.Statistics.ReceivedSucceeded }); - //---------------------------------------------------- public static readonly DashboardMetric PublishedFailedCount = new DashboardMetric( @@ -147,6 +146,7 @@ namespace DotNetCore.CAP.Dashboard 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", @@ -157,4 +157,4 @@ namespace DotNetCore.CAP.Dashboard Highlighted = page.Statistics.ReceivedFailed > 0 }); } -} +} \ No newline at end of file diff --git a/src/DotNetCore.CAP/Dashboard/DashboardRequest.cs b/src/DotNetCore.CAP/Dashboard/DashboardRequest.cs index 78f37a4..33f3535 100644 --- a/src/DotNetCore.CAP/Dashboard/DashboardRequest.cs +++ b/src/DotNetCore.CAP/Dashboard/DashboardRequest.cs @@ -15,6 +15,7 @@ namespace DotNetCore.CAP.Dashboard public abstract string RemoteIpAddress { get; } public abstract string GetQuery(string key); + public abstract Task> GetFormValuesAsync(string key); } @@ -25,7 +26,7 @@ namespace DotNetCore.CAP.Dashboard public CapDashboardRequest(HttpContext context) { if (context == null) throw new ArgumentNullException(nameof(context)); - _context = context; + _context = context; } public override string Method => _context.Request.Method; @@ -33,7 +34,9 @@ namespace DotNetCore.CAP.Dashboard public override string PathBase => _context.Request.PathBase.Value; public override string LocalIpAddress => _context.Connection.LocalIpAddress.ToString(); public override string RemoteIpAddress => _context.Connection.RemoteIpAddress.ToString(); + public override string GetQuery(string key) => _context.Request.Query[key]; + public override async Task> GetFormValuesAsync(string key) { var form = await _context.Request.ReadFormAsync(); diff --git a/src/DotNetCore.CAP/Dashboard/DashboardResponse.cs b/src/DotNetCore.CAP/Dashboard/DashboardResponse.cs index c3226b8..2d04da0 100644 --- a/src/DotNetCore.CAP/Dashboard/DashboardResponse.cs +++ b/src/DotNetCore.CAP/Dashboard/DashboardResponse.cs @@ -14,6 +14,7 @@ namespace DotNetCore.CAP.Dashboard public abstract Stream Body { get; } public abstract void SetExpire(DateTimeOffset? value); + public abstract Task WriteAsync(string text); } @@ -21,7 +22,7 @@ namespace DotNetCore.CAP.Dashboard { private readonly HttpContext _context; - public CapDashboardResponse( HttpContext context) + public CapDashboardResponse(HttpContext context) { if (context == null) throw new ArgumentNullException(nameof(context)); _context = context; diff --git a/src/DotNetCore.CAP/Dashboard/DashboardRoutes.cs b/src/DotNetCore.CAP/Dashboard/DashboardRoutes.cs index baa5bcb..662ace5 100644 --- a/src/DotNetCore.CAP/Dashboard/DashboardRoutes.cs +++ b/src/DotNetCore.CAP/Dashboard/DashboardRoutes.cs @@ -72,11 +72,10 @@ namespace DotNetCore.CAP.Dashboard GetExecutingAssembly(), GetContentResourceName("fonts", "glyphicons-halflings-regular.woff2"))); - #endregion + #endregion Embedded static content #region Razor pages and commands - Routes.AddJsonResult("/published/message/(?.+)", x => { var id = int.Parse(x.UriMatch.Groups["Id"].Value); @@ -103,7 +102,7 @@ namespace DotNetCore.CAP.Dashboard //Routes.AddRazorPage("/jobs/processing", x => new ProcessingJobsPage()); //Routes.AddClientBatchCommand( - // "/jobs/processing/delete", + // "/jobs/processing/delete", // (client, jobId) => client.ChangeState(jobId, CreateDeletedState(), ProcessingState.StateName)); //Routes.AddClientBatchCommand( @@ -113,7 +112,7 @@ namespace DotNetCore.CAP.Dashboard //Routes.AddRazorPage("/jobs/scheduled", x => new ScheduledJobsPage()); //Routes.AddClientBatchCommand( - // "/jobs/scheduled/enqueue", + // "/jobs/scheduled/enqueue", // (client, jobId) => client.ChangeState(jobId, CreateEnqueuedState(), ScheduledState.StateName)); //Routes.AddClientBatchCommand( @@ -176,17 +175,17 @@ namespace DotNetCore.CAP.Dashboard //Routes.AddRazorPage("/recurring", x => new RecurringJobsPage()); //Routes.AddRecurringBatchCommand( - // "/recurring/remove", + // "/recurring/remove", // (manager, jobId) => manager.RemoveIfExists(jobId)); //Routes.AddRecurringBatchCommand( - // "/recurring/trigger", + // "/recurring/trigger", // (manager, jobId) => manager.Trigger(jobId)); //Routes.AddRazorPage("/servers", x => new ServersPage()); //Routes.AddRazorPage("/retries", x => new RetriesPage()); - #endregion + #endregion Razor pages and commands } public static RouteCollection Routes { get; } @@ -216,4 +215,4 @@ namespace DotNetCore.CAP.Dashboard return typeof(DashboardRoutes).GetTypeInfo().Assembly; } } -} +} \ No newline at end of file diff --git a/src/DotNetCore.CAP/Dashboard/EmbeddedResourceDispatcher.cs b/src/DotNetCore.CAP/Dashboard/EmbeddedResourceDispatcher.cs index f04ee60..ef749cd 100644 --- a/src/DotNetCore.CAP/Dashboard/EmbeddedResourceDispatcher.cs +++ b/src/DotNetCore.CAP/Dashboard/EmbeddedResourceDispatcher.cs @@ -12,12 +12,12 @@ namespace DotNetCore.CAP.Dashboard public EmbeddedResourceDispatcher( string contentType, - Assembly assembly, + Assembly assembly, string resourceName) { if (contentType == null) throw new ArgumentNullException(nameof(contentType)); if (assembly == null) throw new ArgumentNullException(nameof(assembly)); - + _assembly = assembly; _resourceName = resourceName; _contentType = contentType; @@ -51,4 +51,4 @@ namespace DotNetCore.CAP.Dashboard } } } -} +} \ No newline at end of file diff --git a/src/DotNetCore.CAP/Dashboard/HtmlHelper.cs b/src/DotNetCore.CAP/Dashboard/HtmlHelper.cs index 4fe5b47..d60caca 100644 --- a/src/DotNetCore.CAP/Dashboard/HtmlHelper.cs +++ b/src/DotNetCore.CAP/Dashboard/HtmlHelper.cs @@ -2,12 +2,11 @@ using System.Collections.Generic; using System.Linq; using System.Net; -using System.Text; -using System.ComponentModel; using System.Reflection; +using System.Text; using System.Text.RegularExpressions; -using DotNetCore.CAP.Dashboard.Resources; using DotNetCore.CAP.Dashboard.Pages; +using DotNetCore.CAP.Dashboard.Resources; using DotNetCore.CAP.Infrastructure; using DotNetCore.CAP.Models; using Microsoft.Extensions.Internal; @@ -349,4 +348,4 @@ namespace DotNetCore.CAP.Dashboard return WebUtility.HtmlEncode(text); } } -} +} \ No newline at end of file diff --git a/src/DotNetCore.CAP/Dashboard/IDashboardAuthorizationFilter.cs b/src/DotNetCore.CAP/Dashboard/IDashboardAuthorizationFilter.cs index 741dd1a..f3833a8 100644 --- a/src/DotNetCore.CAP/Dashboard/IDashboardAuthorizationFilter.cs +++ b/src/DotNetCore.CAP/Dashboard/IDashboardAuthorizationFilter.cs @@ -2,6 +2,6 @@ { public interface IDashboardAuthorizationFilter { - bool Authorize( DashboardContext context); + bool Authorize(DashboardContext context); } } \ No newline at end of file diff --git a/src/DotNetCore.CAP/Dashboard/IDashboardDispatcher.cs b/src/DotNetCore.CAP/Dashboard/IDashboardDispatcher.cs index 770ce90..ce9cf3e 100644 --- a/src/DotNetCore.CAP/Dashboard/IDashboardDispatcher.cs +++ b/src/DotNetCore.CAP/Dashboard/IDashboardDispatcher.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Threading.Tasks; +using System.Threading.Tasks; namespace DotNetCore.CAP.Dashboard { @@ -9,4 +6,4 @@ namespace DotNetCore.CAP.Dashboard { Task Dispatch(DashboardContext context); } -} +} \ No newline at end of file diff --git a/src/DotNetCore.CAP/Dashboard/IMonitoringApi.cs b/src/DotNetCore.CAP/Dashboard/IMonitoringApi.cs index ee2d3ee..e834911 100644 --- a/src/DotNetCore.CAP/Dashboard/IMonitoringApi.cs +++ b/src/DotNetCore.CAP/Dashboard/IMonitoringApi.cs @@ -6,21 +6,28 @@ namespace DotNetCore.CAP.Dashboard { public interface IMonitoringApi { - StatisticsDto GetStatistics(); - + StatisticsDto GetStatistics(); + IList Messages(MessageQueryDto queryDto); - + int PublishedFailedCount(); + int PublishedProcessingCount(); + int PublishedSucceededCount(); int ReceivedFailedCount(); + int ReceivedProcessingCount(); + int ReceivedSucceededCount(); 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 0485f3e..a7197e6 100644 --- a/src/DotNetCore.CAP/Dashboard/JobHistoryRenderer.cs +++ b/src/DotNetCore.CAP/Dashboard/JobHistoryRenderer.cs @@ -14,6 +14,7 @@ namespace DotNetCore.CAP.Dashboard private static readonly IDictionary BackgroundStateColors = new Dictionary(); + private static readonly IDictionary ForegroundStateColors = new Dictionary(); @@ -144,7 +145,6 @@ namespace DotNetCore.CAP.Dashboard itemsAdded = true; } - if (stateData.ContainsKey("Result") && !String.IsNullOrWhiteSpace(stateData["Result"])) { var result = stateData["Result"]; @@ -249,4 +249,4 @@ namespace DotNetCore.CAP.Dashboard return new NonEscapedString(builder.ToString()); } } -} +} \ No newline at end of file diff --git a/src/DotNetCore.CAP/Dashboard/JsonDispatcher.cs b/src/DotNetCore.CAP/Dashboard/JsonDispatcher.cs index b908ffb..93dccd6 100644 --- a/src/DotNetCore.CAP/Dashboard/JsonDispatcher.cs +++ b/src/DotNetCore.CAP/Dashboard/JsonDispatcher.cs @@ -1,5 +1,4 @@ using System; -using System.Net; using System.Threading.Tasks; using Newtonsoft.Json; using Newtonsoft.Json.Converters; @@ -49,4 +48,4 @@ namespace DotNetCore.CAP.Dashboard await context.Response.WriteAsync(serialized); } } -} +} \ No newline at end of file diff --git a/src/DotNetCore.CAP/Dashboard/JsonStats.cs b/src/DotNetCore.CAP/Dashboard/JsonStats.cs index 5500bd8..c1a6777 100644 --- a/src/DotNetCore.CAP/Dashboard/JsonStats.cs +++ b/src/DotNetCore.CAP/Dashboard/JsonStats.cs @@ -27,7 +27,7 @@ namespace DotNetCore.CAP.Dashboard var settings = new JsonSerializerSettings { ContractResolver = new CamelCasePropertyNamesContractResolver(), - Converters = new JsonConverter[]{ new StringEnumConverter { CamelCaseText = true } } + Converters = new JsonConverter[] { new StringEnumConverter { CamelCaseText = true } } }; var serialized = JsonConvert.SerializeObject(result, settings); @@ -42,4 +42,4 @@ namespace DotNetCore.CAP.Dashboard } } } -} +} \ No newline at end of file diff --git a/src/DotNetCore.CAP/Dashboard/LocalRequestsOnlyAuthorizationFilter.cs b/src/DotNetCore.CAP/Dashboard/LocalRequestsOnlyAuthorizationFilter.cs index f8788c3..0580a4f 100644 --- a/src/DotNetCore.CAP/Dashboard/LocalRequestsOnlyAuthorizationFilter.cs +++ b/src/DotNetCore.CAP/Dashboard/LocalRequestsOnlyAuthorizationFilter.cs @@ -1,6 +1,4 @@ using System; -using System.Collections.Generic; -using System.Text; namespace DotNetCore.CAP.Dashboard { @@ -23,4 +21,4 @@ namespace DotNetCore.CAP.Dashboard return false; } } -} +} \ No newline at end of file diff --git a/src/DotNetCore.CAP/Dashboard/MenuItem.cs b/src/DotNetCore.CAP/Dashboard/MenuItem.cs index d6735f8..b06d5c4 100644 --- a/src/DotNetCore.CAP/Dashboard/MenuItem.cs +++ b/src/DotNetCore.CAP/Dashboard/MenuItem.cs @@ -21,7 +21,7 @@ namespace DotNetCore.CAP.Dashboard public IEnumerable GetAllMetrics() { var metrics = new List { Metric }; - + if (Metrics != null) { metrics.AddRange(Metrics); diff --git a/src/DotNetCore.CAP/Dashboard/MessagesSidebarMenu.cs b/src/DotNetCore.CAP/Dashboard/MessagesSidebarMenu.cs index d8e25cc..0157241 100644 --- a/src/DotNetCore.CAP/Dashboard/MessagesSidebarMenu.cs +++ b/src/DotNetCore.CAP/Dashboard/MessagesSidebarMenu.cs @@ -31,7 +31,7 @@ namespace DotNetCore.CAP.Dashboard Active = page.RequestPath.StartsWith("/published/failed"), Metric = DashboardMetrics.PublishedFailedCount }); - + //=======================================ReceivedItems============================= ReceivedItems.Add(page => new MenuItem(Strings.SidebarMenu_Succeeded, page.Url.To("/received/succeeded")) @@ -51,7 +51,6 @@ namespace DotNetCore.CAP.Dashboard Active = page.RequestPath.StartsWith("/received/failed"), Metric = DashboardMetrics.ReceivedFailedCount }); - } } } \ No newline at end of file diff --git a/src/DotNetCore.CAP/Dashboard/Metric.cs b/src/DotNetCore.CAP/Dashboard/Metric.cs index 50a48f9..d8108fa 100644 --- a/src/DotNetCore.CAP/Dashboard/Metric.cs +++ b/src/DotNetCore.CAP/Dashboard/Metric.cs @@ -1,5 +1,4 @@ - -namespace DotNetCore.CAP.Dashboard +namespace DotNetCore.CAP.Dashboard { public class Metric { @@ -31,12 +30,12 @@ namespace DotNetCore.CAP.Dashboard switch (style) { case MetricStyle.Default: return "metric-default"; - case MetricStyle.Info: return "metric-info"; + case MetricStyle.Info: return "metric-info"; case MetricStyle.Success: return "metric-success"; case MetricStyle.Warning: return "metric-warning"; - case MetricStyle.Danger: return "metric-danger"; - default: return "metric-null"; + case MetricStyle.Danger: return "metric-danger"; + default: return "metric-null"; } } } -} +} \ No newline at end of file diff --git a/src/DotNetCore.CAP/Dashboard/Monitoring/MessageDto.cs b/src/DotNetCore.CAP/Dashboard/Monitoring/MessageDto.cs index ca75645..5c2b1f0 100644 --- a/src/DotNetCore.CAP/Dashboard/Monitoring/MessageDto.cs +++ b/src/DotNetCore.CAP/Dashboard/Monitoring/MessageDto.cs @@ -1,4 +1,5 @@ using System; + namespace DotNetCore.CAP.Dashboard.Monitoring { public class MessageDto diff --git a/src/DotNetCore.CAP/Dashboard/Monitoring/MessageQueryDto.cs b/src/DotNetCore.CAP/Dashboard/Monitoring/MessageQueryDto.cs index 9de8a4a..98f3e97 100644 --- a/src/DotNetCore.CAP/Dashboard/Monitoring/MessageQueryDto.cs +++ b/src/DotNetCore.CAP/Dashboard/Monitoring/MessageQueryDto.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; -using DotNetCore.CAP.Models; +using DotNetCore.CAP.Models; namespace DotNetCore.CAP.Dashboard.Monitoring { @@ -15,9 +12,9 @@ namespace DotNetCore.CAP.Dashboard.Monitoring public string Content { get; set; } public string StatusName { get; set; } - + public int CurrentPage { get; set; } public int PageSize { get; set; } } -} +} \ No newline at end of file diff --git a/src/DotNetCore.CAP/Dashboard/Monitoring/ServerDto.cs b/src/DotNetCore.CAP/Dashboard/Monitoring/ServerDto.cs index 970c00f..8564205 100644 --- a/src/DotNetCore.CAP/Dashboard/Monitoring/ServerDto.cs +++ b/src/DotNetCore.CAP/Dashboard/Monitoring/ServerDto.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; - -namespace DotNetCore.CAP.Dashboard.Monitoring +namespace DotNetCore.CAP.Dashboard.Monitoring { public class SubscriberDto { diff --git a/src/DotNetCore.CAP/Dashboard/Monitoring/StateHistoryDto.cs b/src/DotNetCore.CAP/Dashboard/Monitoring/StateHistoryDto.cs index 0f391e8..81947da 100644 --- a/src/DotNetCore.CAP/Dashboard/Monitoring/StateHistoryDto.cs +++ b/src/DotNetCore.CAP/Dashboard/Monitoring/StateHistoryDto.cs @@ -8,6 +8,6 @@ namespace DotNetCore.CAP.Dashboard.Monitoring public string StateName { get; set; } public string Reason { get; set; } public DateTime CreatedAt { get; set; } - public IDictionary Data { get; set; } + public IDictionary Data { get; set; } } } \ No newline at end of file diff --git a/src/DotNetCore.CAP/Dashboard/Monitoring/StatisticsDto.cs b/src/DotNetCore.CAP/Dashboard/Monitoring/StatisticsDto.cs index 3551f38..38a8355 100644 --- a/src/DotNetCore.CAP/Dashboard/Monitoring/StatisticsDto.cs +++ b/src/DotNetCore.CAP/Dashboard/Monitoring/StatisticsDto.cs @@ -13,4 +13,4 @@ public int PublishedProcessing { get; set; } public int ReceivedProcessing { get; set; } } -} +} \ No newline at end of file diff --git a/src/DotNetCore.CAP/Dashboard/NavigationMenu.cs b/src/DotNetCore.CAP/Dashboard/NavigationMenu.cs index b044e4b..3c51f92 100644 --- a/src/DotNetCore.CAP/Dashboard/NavigationMenu.cs +++ b/src/DotNetCore.CAP/Dashboard/NavigationMenu.cs @@ -13,7 +13,7 @@ namespace DotNetCore.CAP.Dashboard Items.Add(page => new MenuItem(Strings.NavigationMenu_Published, page.Url.LinkToPublished()) { Active = page.RequestPath.StartsWith("/published"), - Metrics = new [] + Metrics = new[] { DashboardMetrics.PublishedSucceededCount, DashboardMetrics.PublishedFailedCountOrNull diff --git a/src/DotNetCore.CAP/Dashboard/NonEscapedString.cs b/src/DotNetCore.CAP/Dashboard/NonEscapedString.cs index f95cf4f..60b60b9 100644 --- a/src/DotNetCore.CAP/Dashboard/NonEscapedString.cs +++ b/src/DotNetCore.CAP/Dashboard/NonEscapedString.cs @@ -14,4 +14,4 @@ return _value; } } -} +} \ No newline at end of file diff --git a/src/DotNetCore.CAP/Dashboard/Pager.cs b/src/DotNetCore.CAP/Dashboard/Pager.cs index b964569..7476f36 100644 --- a/src/DotNetCore.CAP/Dashboard/Pager.cs +++ b/src/DotNetCore.CAP/Dashboard/Pager.cs @@ -66,7 +66,7 @@ namespace DotNetCore.CAP.Dashboard AddPrevious(pagerItems); // first page - if (_startPageIndex > 1) + if (_startPageIndex > 1) pagerItems.Add(new Item(1, false, ItemType.Page)); // more page before numeric page buttons @@ -153,4 +153,4 @@ namespace DotNetCore.CAP.Dashboard MorePage } } -} +} \ No newline at end of file diff --git a/src/DotNetCore.CAP/Dashboard/Pages/BlockMetric.cs b/src/DotNetCore.CAP/Dashboard/Pages/BlockMetric.cs index f102675..0b37e34 100644 --- a/src/DotNetCore.CAP/Dashboard/Pages/BlockMetric.cs +++ b/src/DotNetCore.CAP/Dashboard/Pages/BlockMetric.cs @@ -9,4 +9,4 @@ public DashboardMetric DashboardMetric { get; } } -} +} \ No newline at end of file diff --git a/src/DotNetCore.CAP/Dashboard/Pages/Breadcrumbs.cs b/src/DotNetCore.CAP/Dashboard/Pages/Breadcrumbs.cs index ad66efa..46f6692 100644 --- a/src/DotNetCore.CAP/Dashboard/Pages/Breadcrumbs.cs +++ b/src/DotNetCore.CAP/Dashboard/Pages/Breadcrumbs.cs @@ -13,4 +13,4 @@ namespace DotNetCore.CAP.Dashboard.Pages public string Title { get; } public IDictionary Items { get; } } -} +} \ No newline at end of file diff --git a/src/DotNetCore.CAP/Dashboard/Pages/HomePage.cs b/src/DotNetCore.CAP/Dashboard/Pages/HomePage.cs index d2ed24e..2e1b0ce 100644 --- a/src/DotNetCore.CAP/Dashboard/Pages/HomePage.cs +++ b/src/DotNetCore.CAP/Dashboard/Pages/HomePage.cs @@ -6,4 +6,4 @@ namespace DotNetCore.CAP.Dashboard.Pages { public static readonly List Metrics = new List(); } -} +} \ No newline at end of file diff --git a/src/DotNetCore.CAP/Dashboard/Pages/InlineMetric.cs b/src/DotNetCore.CAP/Dashboard/Pages/InlineMetric.cs index d02f228..f24c19a 100644 --- a/src/DotNetCore.CAP/Dashboard/Pages/InlineMetric.cs +++ b/src/DotNetCore.CAP/Dashboard/Pages/InlineMetric.cs @@ -9,4 +9,4 @@ public DashboardMetric DashboardMetric { get; } } -} +} \ No newline at end of file diff --git a/src/DotNetCore.CAP/Dashboard/Pages/LayoutPage.cs b/src/DotNetCore.CAP/Dashboard/Pages/LayoutPage.cs index 9cbd688..820402b 100644 --- a/src/DotNetCore.CAP/Dashboard/Pages/LayoutPage.cs +++ b/src/DotNetCore.CAP/Dashboard/Pages/LayoutPage.cs @@ -9,4 +9,4 @@ public string Title { get; } } -} +} \ No newline at end of file diff --git a/src/DotNetCore.CAP/Dashboard/Pages/PublishedPage.cs b/src/DotNetCore.CAP/Dashboard/Pages/PublishedPage.cs index d2b6fc5..2852ba8 100644 --- a/src/DotNetCore.CAP/Dashboard/Pages/PublishedPage.cs +++ b/src/DotNetCore.CAP/Dashboard/Pages/PublishedPage.cs @@ -1,6 +1,4 @@ using System; -using System.Collections.Generic; -using System.Text; using DotNetCore.CAP.Processor.States; namespace DotNetCore.CAP.Dashboard.Pages @@ -30,4 +28,4 @@ namespace DotNetCore.CAP.Dashboard.Pages } } } -} +} \ No newline at end of file diff --git a/src/DotNetCore.CAP/Dashboard/Pages/ReceivedPage.cs b/src/DotNetCore.CAP/Dashboard/Pages/ReceivedPage.cs index 09c857f..3f9a569 100644 --- a/src/DotNetCore.CAP/Dashboard/Pages/ReceivedPage.cs +++ b/src/DotNetCore.CAP/Dashboard/Pages/ReceivedPage.cs @@ -1,6 +1,4 @@ using System; -using System.Collections.Generic; -using System.Text; using DotNetCore.CAP.Processor.States; namespace DotNetCore.CAP.Dashboard.Pages @@ -30,4 +28,4 @@ namespace DotNetCore.CAP.Dashboard.Pages } } } -} +} \ No newline at end of file diff --git a/src/DotNetCore.CAP/Dashboard/Pages/SidebarMenu.cs b/src/DotNetCore.CAP/Dashboard/Pages/SidebarMenu.cs index 285fcde..0e9305a 100644 --- a/src/DotNetCore.CAP/Dashboard/Pages/SidebarMenu.cs +++ b/src/DotNetCore.CAP/Dashboard/Pages/SidebarMenu.cs @@ -5,7 +5,7 @@ namespace DotNetCore.CAP.Dashboard.Pages { partial class SidebarMenu { - public SidebarMenu( IEnumerable> items) + public SidebarMenu(IEnumerable> items) { if (items == null) throw new ArgumentNullException(nameof(items)); Items = items; @@ -13,4 +13,4 @@ namespace DotNetCore.CAP.Dashboard.Pages public IEnumerable> Items { get; } } -} +} \ No newline at end of file diff --git a/src/DotNetCore.CAP/Dashboard/Pages/_Paginator.cs b/src/DotNetCore.CAP/Dashboard/Pages/_Paginator.cs index babfc06..e5f6307 100644 --- a/src/DotNetCore.CAP/Dashboard/Pages/_Paginator.cs +++ b/src/DotNetCore.CAP/Dashboard/Pages/_Paginator.cs @@ -9,4 +9,4 @@ _pager = pager; } } -} +} \ No newline at end of file diff --git a/src/DotNetCore.CAP/Dashboard/Pages/_PerPageSelector.cs b/src/DotNetCore.CAP/Dashboard/Pages/_PerPageSelector.cs index d1ffb7d..f909724 100644 --- a/src/DotNetCore.CAP/Dashboard/Pages/_PerPageSelector.cs +++ b/src/DotNetCore.CAP/Dashboard/Pages/_PerPageSelector.cs @@ -9,4 +9,4 @@ _pager = pager; } } -} +} \ No newline at end of file diff --git a/src/DotNetCore.CAP/Dashboard/RazorPage.cs b/src/DotNetCore.CAP/Dashboard/RazorPage.cs index b7b65e3..cea0a1c 100644 --- a/src/DotNetCore.CAP/Dashboard/RazorPage.cs +++ b/src/DotNetCore.CAP/Dashboard/RazorPage.cs @@ -2,12 +2,11 @@ using System.Diagnostics; using System.Net; using System.Text; -using System.Threading.Tasks; using DotNetCore.CAP.Dashboard.Monitoring; namespace DotNetCore.CAP.Dashboard { - public abstract class RazorPage + public abstract class RazorPage { private Lazy _statisticsLazy; @@ -116,15 +115,15 @@ namespace DotNetCore.CAP.Dashboard private string TransformText(string body) { _body = body; - + Execute(); - + if (Layout != null) { Layout.Assign(this); return Layout.TransformText(_content.ToString()); } - + return _content.ToString(); } @@ -135,4 +134,4 @@ namespace DotNetCore.CAP.Dashboard : WebUtility.HtmlEncode(text); } } -} +} \ No newline at end of file diff --git a/src/DotNetCore.CAP/Dashboard/RazorPageDispatcher.cs b/src/DotNetCore.CAP/Dashboard/RazorPageDispatcher.cs index 79359c5..ade0988 100644 --- a/src/DotNetCore.CAP/Dashboard/RazorPageDispatcher.cs +++ b/src/DotNetCore.CAP/Dashboard/RazorPageDispatcher.cs @@ -23,4 +23,4 @@ namespace DotNetCore.CAP.Dashboard return context.Response.WriteAsync(page.ToString()); } } -} +} \ No newline at end of file diff --git a/src/DotNetCore.CAP/Dashboard/RouteCollection.cs b/src/DotNetCore.CAP/Dashboard/RouteCollection.cs index c0d19f3..65b6e31 100644 --- a/src/DotNetCore.CAP/Dashboard/RouteCollection.cs +++ b/src/DotNetCore.CAP/Dashboard/RouteCollection.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Text; using System.Text.RegularExpressions; namespace DotNetCore.CAP.Dashboard @@ -45,4 +44,4 @@ namespace DotNetCore.CAP.Dashboard return null; } } -} +} \ No newline at end of file diff --git a/src/DotNetCore.CAP/Dashboard/RouteCollectionExtensions.cs b/src/DotNetCore.CAP/Dashboard/RouteCollectionExtensions.cs index ac2b492..15b54b0 100644 --- a/src/DotNetCore.CAP/Dashboard/RouteCollectionExtensions.cs +++ b/src/DotNetCore.CAP/Dashboard/RouteCollectionExtensions.cs @@ -19,7 +19,7 @@ namespace DotNetCore.CAP.Dashboard public static void AddCommand( this RouteCollection routes, - string pathTemplate, + string pathTemplate, Func command) { if (routes == null) throw new ArgumentNullException(nameof(routes)); @@ -63,6 +63,6 @@ namespace DotNetCore.CAP.Dashboard if (command == null) throw new ArgumentNullException(nameof(command)); routes.Add(pathTemplate, new BatchCommandDispatcher(command)); - } + } } -} +} \ No newline at end of file diff --git a/src/DotNetCore.CAP/Dashboard/UrlHelper.cs b/src/DotNetCore.CAP/Dashboard/UrlHelper.cs index 64316b2..13a6a90 100644 --- a/src/DotNetCore.CAP/Dashboard/UrlHelper.cs +++ b/src/DotNetCore.CAP/Dashboard/UrlHelper.cs @@ -1,14 +1,12 @@ using System; -using System.Collections.Generic; namespace DotNetCore.CAP.Dashboard { public class UrlHelper { - private readonly DashboardContext _context; - public UrlHelper( DashboardContext context) + public UrlHelper(DashboardContext context) { if (context == null) throw new ArgumentNullException(nameof(context)); _context = context; @@ -46,4 +44,4 @@ namespace DotNetCore.CAP.Dashboard return To("/jobs/enqueued/" + queue); } } -} +} \ No newline at end of file