@@ -151,17 +151,12 @@ VALUES(@Name,@Group,@Content,@Retries,@Added,@ExpiresAt,@StatusName);"; | |||||
return new MySqlFetchedMessage(fetchedMessage.MessageId, fetchedMessage.MessageType, connection, transaction); | return new MySqlFetchedMessage(fetchedMessage.MessageId, fetchedMessage.MessageType, connection, transaction); | ||||
} | } | ||||
public List<string> GetRangeFromSet(string key, int startingFrom, int endingAt) | |||||
public bool ChangePublishedState(int messageId, string state) | |||||
{ | { | ||||
throw new NotImplementedException(); | throw new NotImplementedException(); | ||||
} | } | ||||
public bool ChangePublishedState(int messageId, IState state) | |||||
{ | |||||
throw new NotImplementedException(); | |||||
} | |||||
public bool ChangeReceivedState(int messageId, IState state) | |||||
public bool ChangeReceivedState(int messageId, string state) | |||||
{ | { | ||||
throw new NotImplementedException(); | throw new NotImplementedException(); | ||||
} | } | ||||
@@ -1,6 +1,6 @@ | |||||
using System.Reflection; | using System.Reflection; | ||||
using DotNetCore.CAP.Dashboard.Pages; | using DotNetCore.CAP.Dashboard.Pages; | ||||
using DotNetCore.CAP.Processor.States; | |||||
using DotNetCore.CAP.Infrastructure; | |||||
namespace DotNetCore.CAP.Dashboard | namespace DotNetCore.CAP.Dashboard | ||||
{ | { | ||||
@@ -32,7 +32,7 @@ namespace DotNetCore.CAP.Dashboard | |||||
Routes = new RouteCollection(); | Routes = new RouteCollection(); | ||||
Routes.AddRazorPage("/", x => new HomePage()); | Routes.AddRazorPage("/", x => new HomePage()); | ||||
Routes.Add("/stats", new JsonStats()); | Routes.Add("/stats", new JsonStats()); | ||||
Routes.Add("/health",new OkStats()); | |||||
Routes.Add("/health", new OkStats()); | |||||
#region Embedded static content | #region Embedded static content | ||||
@@ -88,23 +88,25 @@ namespace DotNetCore.CAP.Dashboard | |||||
var id = int.Parse(x.UriMatch.Groups["Id"].Value); | var id = int.Parse(x.UriMatch.Groups["Id"].Value); | ||||
var message = x.Storage.GetConnection().GetReceivedMessageAsync(id).GetAwaiter().GetResult(); | var message = x.Storage.GetConnection().GetReceivedMessageAsync(id).GetAwaiter().GetResult(); | ||||
return message.Content; | return message.Content; | ||||
}); | |||||
}); | |||||
Routes.AddPublishBatchCommand( | Routes.AddPublishBatchCommand( | ||||
"/published/requeue", | |||||
(client, messageId) => client.Storage.GetConnection().ChangePublishedState(messageId, new ScheduledState())); | |||||
"/published/requeue", | |||||
(client, messageId) => | |||||
client.Storage.GetConnection().ChangePublishedState(messageId, StatusName.Scheduled)); | |||||
Routes.AddPublishBatchCommand( | Routes.AddPublishBatchCommand( | ||||
"/received/requeue", | |||||
(client, messageId) => client.Storage.GetConnection().ChangeReceivedState(messageId, new ScheduledState())); | |||||
"/received/requeue", | |||||
(client, messageId) => | |||||
client.Storage.GetConnection().ChangeReceivedState(messageId, StatusName.Scheduled)); | |||||
Routes.AddRazorPage( | Routes.AddRazorPage( | ||||
"/published/(?<StatusName>.+)", | "/published/(?<StatusName>.+)", | ||||
x => new PublishedPage(x.Groups["StatusName"].Value)); | |||||
x => new PublishedPage(x.Groups["StatusName"].Value)); | |||||
Routes.AddRazorPage( | Routes.AddRazorPage( | ||||
"/received/(?<StatusName>.+)", | |||||
"/received/(?<StatusName>.+)", | |||||
x => new ReceivedPage(x.Groups["StatusName"].Value)); | x => new ReceivedPage(x.Groups["StatusName"].Value)); | ||||
Routes.AddRazorPage("/subscribers", x => new SubscriberPage()); | |||||
Routes.AddRazorPage("/subscribers", x => new SubscriberPage()); | |||||
Routes.AddRazorPage("/nodes", x => new NodePage()); | Routes.AddRazorPage("/nodes", x => new NodePage()); | ||||
@@ -1,5 +1,4 @@ | |||||
using System; | using System; | ||||
using DotNetCore.CAP.Processor.States; | |||||
namespace DotNetCore.CAP.Dashboard.Pages | namespace DotNetCore.CAP.Dashboard.Pages | ||||
{ | { | ||||
@@ -14,11 +13,11 @@ namespace DotNetCore.CAP.Dashboard.Pages | |||||
public int GetTotal(IMonitoringApi api) | public int GetTotal(IMonitoringApi api) | ||||
{ | { | ||||
if (string.Equals(StatusName, SucceededState.StateName, StringComparison.CurrentCultureIgnoreCase)) | |||||
if (string.Equals(StatusName, Infrastructure.StatusName.Succeeded, StringComparison.CurrentCultureIgnoreCase)) | |||||
{ | { | ||||
return api.PublishedSucceededCount(); | return api.PublishedSucceededCount(); | ||||
} | } | ||||
if (string.Equals(StatusName, ProcessingState.StateName, StringComparison.CurrentCultureIgnoreCase)) | |||||
if (string.Equals(StatusName, Infrastructure.StatusName.Processing, StringComparison.CurrentCultureIgnoreCase)) | |||||
{ | { | ||||
return api.PublishedProcessingCount(); | return api.PublishedProcessingCount(); | ||||
} | } | ||||
@@ -1,5 +1,4 @@ | |||||
using System; | using System; | ||||
using DotNetCore.CAP.Processor.States; | |||||
namespace DotNetCore.CAP.Dashboard.Pages | namespace DotNetCore.CAP.Dashboard.Pages | ||||
{ | { | ||||
@@ -14,11 +13,11 @@ namespace DotNetCore.CAP.Dashboard.Pages | |||||
public int GetTotal(IMonitoringApi api) | public int GetTotal(IMonitoringApi api) | ||||
{ | { | ||||
if (string.Equals(StatusName, SucceededState.StateName, StringComparison.CurrentCultureIgnoreCase)) | |||||
if (string.Equals(StatusName, Infrastructure.StatusName.Succeeded, StringComparison.CurrentCultureIgnoreCase)) | |||||
{ | { | ||||
return api.ReceivedSucceededCount(); | return api.ReceivedSucceededCount(); | ||||
} | } | ||||
if (string.Equals(StatusName, ProcessingState.StateName, StringComparison.CurrentCultureIgnoreCase)) | |||||
if (string.Equals(StatusName, Infrastructure.StatusName.Processing, StringComparison.CurrentCultureIgnoreCase)) | |||||
{ | { | ||||
return api.ReceivedProcessingCount(); | return api.ReceivedProcessingCount(); | ||||
} | } | ||||