Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
CAP
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tsai
CAP
Commits
f6ca2cc4
Commit
f6ca2cc4
authored
Sep 15, 2017
by
yangxiaodong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup.
parent
7930e82c
Changes
44
Hide whitespace changes
Inline
Side-by-side
Showing
44 changed files
with
90 additions
and
104 deletions
+90
-104
BatchCommandDispatcher.cs
src/DotNetCore.CAP/Dashboard/BatchCommandDispatcher.cs
+1
-1
CombinedResourceDispatcher.cs
src/DotNetCore.CAP/Dashboard/CombinedResourceDispatcher.cs
+4
-4
CommandDispatcher.cs
src/DotNetCore.CAP/Dashboard/CommandDispatcher.cs
+2
-2
DashboardContext.cs
src/DotNetCore.CAP/Dashboard/DashboardContext.cs
+1
-3
DashboardMetric.cs
src/DotNetCore.CAP/Dashboard/DashboardMetric.cs
+1
-1
DashboardMetrics.cs
src/DotNetCore.CAP/Dashboard/DashboardMetrics.cs
+2
-2
DashboardRequest.cs
src/DotNetCore.CAP/Dashboard/DashboardRequest.cs
+4
-1
DashboardResponse.cs
src/DotNetCore.CAP/Dashboard/DashboardResponse.cs
+2
-1
DashboardRoutes.cs
src/DotNetCore.CAP/Dashboard/DashboardRoutes.cs
+7
-8
EmbeddedResourceDispatcher.cs
src/DotNetCore.CAP/Dashboard/EmbeddedResourceDispatcher.cs
+3
-3
HtmlHelper.cs
src/DotNetCore.CAP/Dashboard/HtmlHelper.cs
+3
-4
IDashboardAuthorizationFilter.cs
...DotNetCore.CAP/Dashboard/IDashboardAuthorizationFilter.cs
+1
-1
IDashboardDispatcher.cs
src/DotNetCore.CAP/Dashboard/IDashboardDispatcher.cs
+2
-5
IMonitoringApi.cs
src/DotNetCore.CAP/Dashboard/IMonitoringApi.cs
+10
-3
JobHistoryRenderer.cs
src/DotNetCore.CAP/Dashboard/JobHistoryRenderer.cs
+2
-2
JsonDispatcher.cs
src/DotNetCore.CAP/Dashboard/JsonDispatcher.cs
+1
-2
JsonStats.cs
src/DotNetCore.CAP/Dashboard/JsonStats.cs
+2
-2
LocalRequestsOnlyAuthorizationFilter.cs
...ore.CAP/Dashboard/LocalRequestsOnlyAuthorizationFilter.cs
+1
-3
MenuItem.cs
src/DotNetCore.CAP/Dashboard/MenuItem.cs
+1
-1
MessagesSidebarMenu.cs
src/DotNetCore.CAP/Dashboard/MessagesSidebarMenu.cs
+1
-2
Metric.cs
src/DotNetCore.CAP/Dashboard/Metric.cs
+5
-6
MessageDto.cs
src/DotNetCore.CAP/Dashboard/Monitoring/MessageDto.cs
+1
-0
MessageQueryDto.cs
src/DotNetCore.CAP/Dashboard/Monitoring/MessageQueryDto.cs
+3
-6
ServerDto.cs
src/DotNetCore.CAP/Dashboard/Monitoring/ServerDto.cs
+1
-4
StateHistoryDto.cs
src/DotNetCore.CAP/Dashboard/Monitoring/StateHistoryDto.cs
+1
-1
StatisticsDto.cs
src/DotNetCore.CAP/Dashboard/Monitoring/StatisticsDto.cs
+1
-1
NavigationMenu.cs
src/DotNetCore.CAP/Dashboard/NavigationMenu.cs
+1
-1
NonEscapedString.cs
src/DotNetCore.CAP/Dashboard/NonEscapedString.cs
+1
-1
Pager.cs
src/DotNetCore.CAP/Dashboard/Pager.cs
+2
-2
BlockMetric.cs
src/DotNetCore.CAP/Dashboard/Pages/BlockMetric.cs
+1
-1
Breadcrumbs.cs
src/DotNetCore.CAP/Dashboard/Pages/Breadcrumbs.cs
+1
-1
HomePage.cs
src/DotNetCore.CAP/Dashboard/Pages/HomePage.cs
+1
-1
InlineMetric.cs
src/DotNetCore.CAP/Dashboard/Pages/InlineMetric.cs
+1
-1
LayoutPage.cs
src/DotNetCore.CAP/Dashboard/Pages/LayoutPage.cs
+1
-1
PublishedPage.cs
src/DotNetCore.CAP/Dashboard/Pages/PublishedPage.cs
+1
-3
ReceivedPage.cs
src/DotNetCore.CAP/Dashboard/Pages/ReceivedPage.cs
+1
-3
SidebarMenu.cs
src/DotNetCore.CAP/Dashboard/Pages/SidebarMenu.cs
+2
-2
_Paginator.cs
src/DotNetCore.CAP/Dashboard/Pages/_Paginator.cs
+1
-1
_PerPageSelector.cs
src/DotNetCore.CAP/Dashboard/Pages/_PerPageSelector.cs
+1
-1
RazorPage.cs
src/DotNetCore.CAP/Dashboard/RazorPage.cs
+5
-6
RazorPageDispatcher.cs
src/DotNetCore.CAP/Dashboard/RazorPageDispatcher.cs
+1
-1
RouteCollection.cs
src/DotNetCore.CAP/Dashboard/RouteCollection.cs
+1
-2
RouteCollectionExtensions.cs
src/DotNetCore.CAP/Dashboard/RouteCollectionExtensions.cs
+3
-3
UrlHelper.cs
src/DotNetCore.CAP/Dashboard/UrlHelper.cs
+2
-4
No files found.
src/DotNetCore.CAP/Dashboard/BatchCommandDispatcher.cs
View file @
f6ca2cc4
...
@@ -31,4 +31,4 @@ namespace DotNetCore.CAP.Dashboard
...
@@ -31,4 +31,4 @@ namespace DotNetCore.CAP.Dashboard
context
.
Response
.
StatusCode
=
(
int
)
HttpStatusCode
.
NoContent
;
context
.
Response
.
StatusCode
=
(
int
)
HttpStatusCode
.
NoContent
;
}
}
}
}
}
}
\ No newline at end of file
src/DotNetCore.CAP/Dashboard/CombinedResourceDispatcher.cs
View file @
f6ca2cc4
...
@@ -9,9 +9,9 @@ namespace DotNetCore.CAP.Dashboard
...
@@ -9,9 +9,9 @@ namespace DotNetCore.CAP.Dashboard
private
readonly
string
[]
_resourceNames
;
private
readonly
string
[]
_resourceNames
;
public
CombinedResourceDispatcher
(
public
CombinedResourceDispatcher
(
string
contentType
,
string
contentType
,
Assembly
assembly
,
Assembly
assembly
,
string
baseNamespace
,
string
baseNamespace
,
params
string
[]
resourceNames
)
:
base
(
contentType
,
assembly
,
null
)
params
string
[]
resourceNames
)
:
base
(
contentType
,
assembly
,
null
)
{
{
_assembly
=
assembly
;
_assembly
=
assembly
;
...
@@ -30,4 +30,4 @@ namespace DotNetCore.CAP.Dashboard
...
@@ -30,4 +30,4 @@ namespace DotNetCore.CAP.Dashboard
}
}
}
}
}
}
}
}
\ No newline at end of file
src/DotNetCore.CAP/Dashboard/CommandDispatcher.cs
View file @
f6ca2cc4
...
@@ -15,7 +15,7 @@ namespace DotNetCore.CAP.Dashboard
...
@@ -15,7 +15,7 @@ namespace DotNetCore.CAP.Dashboard
public
Task
Dispatch
(
DashboardContext
context
)
public
Task
Dispatch
(
DashboardContext
context
)
{
{
var
request
=
context
.
Request
;
var
request
=
context
.
Request
;
var
response
=
context
.
Response
;
var
response
=
context
.
Response
;
if
(!
"POST"
.
Equals
(
request
.
Method
,
StringComparison
.
OrdinalIgnoreCase
))
if
(!
"POST"
.
Equals
(
request
.
Method
,
StringComparison
.
OrdinalIgnoreCase
))
...
@@ -36,4 +36,4 @@ namespace DotNetCore.CAP.Dashboard
...
@@ -36,4 +36,4 @@ namespace DotNetCore.CAP.Dashboard
return
Task
.
FromResult
(
true
);
return
Task
.
FromResult
(
true
);
}
}
}
}
}
}
\ No newline at end of file
src/DotNetCore.CAP/Dashboard/DashboardContext.cs
View file @
f6ca2cc4
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
System.Text.RegularExpressions
;
using
System.Text.RegularExpressions
;
using
Microsoft.AspNetCore.Http
;
using
Microsoft.AspNetCore.Http
;
...
@@ -48,4 +46,4 @@ namespace DotNetCore.CAP.Dashboard
...
@@ -48,4 +46,4 @@ namespace DotNetCore.CAP.Dashboard
public
HttpContext
HttpContext
{
get
;
}
public
HttpContext
HttpContext
{
get
;
}
}
}
}
}
\ No newline at end of file
src/DotNetCore.CAP/Dashboard/DashboardMetric.cs
View file @
f6ca2cc4
...
@@ -4,7 +4,7 @@ namespace DotNetCore.CAP.Dashboard
...
@@ -4,7 +4,7 @@ namespace DotNetCore.CAP.Dashboard
{
{
public
class
DashboardMetric
public
class
DashboardMetric
{
{
public
DashboardMetric
(
string
name
,
Func
<
RazorPage
,
Metric
>
func
)
public
DashboardMetric
(
string
name
,
Func
<
RazorPage
,
Metric
>
func
)
:
this
(
name
,
name
,
func
)
:
this
(
name
,
name
,
func
)
{
{
}
}
...
...
src/DotNetCore.CAP/Dashboard/DashboardMetrics.cs
View file @
f6ca2cc4
...
@@ -135,7 +135,6 @@ namespace DotNetCore.CAP.Dashboard
...
@@ -135,7 +135,6 @@ namespace DotNetCore.CAP.Dashboard
IntValue
=
page
.
Statistics
.
ReceivedSucceeded
IntValue
=
page
.
Statistics
.
ReceivedSucceeded
});
});
//----------------------------------------------------
//----------------------------------------------------
public
static
readonly
DashboardMetric
PublishedFailedCount
=
new
DashboardMetric
(
public
static
readonly
DashboardMetric
PublishedFailedCount
=
new
DashboardMetric
(
...
@@ -147,6 +146,7 @@ namespace DotNetCore.CAP.Dashboard
...
@@ -147,6 +146,7 @@ namespace DotNetCore.CAP.Dashboard
Style
=
page
.
Statistics
.
PublishedFailed
>
0
?
MetricStyle
.
Danger
:
MetricStyle
.
Default
,
Style
=
page
.
Statistics
.
PublishedFailed
>
0
?
MetricStyle
.
Danger
:
MetricStyle
.
Default
,
Highlighted
=
page
.
Statistics
.
PublishedFailed
>
0
Highlighted
=
page
.
Statistics
.
PublishedFailed
>
0
});
});
public
static
readonly
DashboardMetric
ReceivedFailedCount
=
new
DashboardMetric
(
public
static
readonly
DashboardMetric
ReceivedFailedCount
=
new
DashboardMetric
(
"received_failed:count"
,
"received_failed:count"
,
"Metrics_FailedJobs"
,
"Metrics_FailedJobs"
,
...
@@ -157,4 +157,4 @@ namespace DotNetCore.CAP.Dashboard
...
@@ -157,4 +157,4 @@ namespace DotNetCore.CAP.Dashboard
Highlighted
=
page
.
Statistics
.
ReceivedFailed
>
0
Highlighted
=
page
.
Statistics
.
ReceivedFailed
>
0
});
});
}
}
}
}
\ No newline at end of file
src/DotNetCore.CAP/Dashboard/DashboardRequest.cs
View file @
f6ca2cc4
...
@@ -15,6 +15,7 @@ namespace DotNetCore.CAP.Dashboard
...
@@ -15,6 +15,7 @@ namespace DotNetCore.CAP.Dashboard
public
abstract
string
RemoteIpAddress
{
get
;
}
public
abstract
string
RemoteIpAddress
{
get
;
}
public
abstract
string
GetQuery
(
string
key
);
public
abstract
string
GetQuery
(
string
key
);
public
abstract
Task
<
IList
<
string
>>
GetFormValuesAsync
(
string
key
);
public
abstract
Task
<
IList
<
string
>>
GetFormValuesAsync
(
string
key
);
}
}
...
@@ -25,7 +26,7 @@ namespace DotNetCore.CAP.Dashboard
...
@@ -25,7 +26,7 @@ namespace DotNetCore.CAP.Dashboard
public
CapDashboardRequest
(
HttpContext
context
)
public
CapDashboardRequest
(
HttpContext
context
)
{
{
if
(
context
==
null
)
throw
new
ArgumentNullException
(
nameof
(
context
));
if
(
context
==
null
)
throw
new
ArgumentNullException
(
nameof
(
context
));
_context
=
context
;
_context
=
context
;
}
}
public
override
string
Method
=>
_context
.
Request
.
Method
;
public
override
string
Method
=>
_context
.
Request
.
Method
;
...
@@ -33,7 +34,9 @@ namespace DotNetCore.CAP.Dashboard
...
@@ -33,7 +34,9 @@ namespace DotNetCore.CAP.Dashboard
public
override
string
PathBase
=>
_context
.
Request
.
PathBase
.
Value
;
public
override
string
PathBase
=>
_context
.
Request
.
PathBase
.
Value
;
public
override
string
LocalIpAddress
=>
_context
.
Connection
.
LocalIpAddress
.
ToString
();
public
override
string
LocalIpAddress
=>
_context
.
Connection
.
LocalIpAddress
.
ToString
();
public
override
string
RemoteIpAddress
=>
_context
.
Connection
.
RemoteIpAddress
.
ToString
();
public
override
string
RemoteIpAddress
=>
_context
.
Connection
.
RemoteIpAddress
.
ToString
();
public
override
string
GetQuery
(
string
key
)
=>
_context
.
Request
.
Query
[
key
];
public
override
string
GetQuery
(
string
key
)
=>
_context
.
Request
.
Query
[
key
];
public
override
async
Task
<
IList
<
string
>>
GetFormValuesAsync
(
string
key
)
public
override
async
Task
<
IList
<
string
>>
GetFormValuesAsync
(
string
key
)
{
{
var
form
=
await
_context
.
Request
.
ReadFormAsync
();
var
form
=
await
_context
.
Request
.
ReadFormAsync
();
...
...
src/DotNetCore.CAP/Dashboard/DashboardResponse.cs
View file @
f6ca2cc4
...
@@ -14,6 +14,7 @@ namespace DotNetCore.CAP.Dashboard
...
@@ -14,6 +14,7 @@ namespace DotNetCore.CAP.Dashboard
public
abstract
Stream
Body
{
get
;
}
public
abstract
Stream
Body
{
get
;
}
public
abstract
void
SetExpire
(
DateTimeOffset
?
value
);
public
abstract
void
SetExpire
(
DateTimeOffset
?
value
);
public
abstract
Task
WriteAsync
(
string
text
);
public
abstract
Task
WriteAsync
(
string
text
);
}
}
...
@@ -21,7 +22,7 @@ namespace DotNetCore.CAP.Dashboard
...
@@ -21,7 +22,7 @@ namespace DotNetCore.CAP.Dashboard
{
{
private
readonly
HttpContext
_context
;
private
readonly
HttpContext
_context
;
public
CapDashboardResponse
(
HttpContext
context
)
public
CapDashboardResponse
(
HttpContext
context
)
{
{
if
(
context
==
null
)
throw
new
ArgumentNullException
(
nameof
(
context
));
if
(
context
==
null
)
throw
new
ArgumentNullException
(
nameof
(
context
));
_context
=
context
;
_context
=
context
;
...
...
src/DotNetCore.CAP/Dashboard/DashboardRoutes.cs
View file @
f6ca2cc4
...
@@ -72,11 +72,10 @@ namespace DotNetCore.CAP.Dashboard
...
@@ -72,11 +72,10 @@ namespace DotNetCore.CAP.Dashboard
GetExecutingAssembly
(),
GetExecutingAssembly
(),
GetContentResourceName
(
"fonts"
,
"glyphicons-halflings-regular.woff2"
)));
GetContentResourceName
(
"fonts"
,
"glyphicons-halflings-regular.woff2"
)));
#
endregion
#
endregion
Embedded
static
content
#
region
Razor
pages
and
commands
#
region
Razor
pages
and
commands
Routes
.
AddJsonResult
(
"/published/message/(?<Id>.+)"
,
x
=>
Routes
.
AddJsonResult
(
"/published/message/(?<Id>.+)"
,
x
=>
{
{
var
id
=
int
.
Parse
(
x
.
UriMatch
.
Groups
[
"Id"
].
Value
);
var
id
=
int
.
Parse
(
x
.
UriMatch
.
Groups
[
"Id"
].
Value
);
...
@@ -103,7 +102,7 @@ namespace DotNetCore.CAP.Dashboard
...
@@ -103,7 +102,7 @@ namespace DotNetCore.CAP.Dashboard
//Routes.AddRazorPage("/jobs/processing", x => new ProcessingJobsPage());
//Routes.AddRazorPage("/jobs/processing", x => new ProcessingJobsPage());
//Routes.AddClientBatchCommand(
//Routes.AddClientBatchCommand(
// "/jobs/processing/delete",
// "/jobs/processing/delete",
// (client, jobId) => client.ChangeState(jobId, CreateDeletedState(), ProcessingState.StateName));
// (client, jobId) => client.ChangeState(jobId, CreateDeletedState(), ProcessingState.StateName));
//Routes.AddClientBatchCommand(
//Routes.AddClientBatchCommand(
...
@@ -113,7 +112,7 @@ namespace DotNetCore.CAP.Dashboard
...
@@ -113,7 +112,7 @@ namespace DotNetCore.CAP.Dashboard
//Routes.AddRazorPage("/jobs/scheduled", x => new ScheduledJobsPage());
//Routes.AddRazorPage("/jobs/scheduled", x => new ScheduledJobsPage());
//Routes.AddClientBatchCommand(
//Routes.AddClientBatchCommand(
// "/jobs/scheduled/enqueue",
// "/jobs/scheduled/enqueue",
// (client, jobId) => client.ChangeState(jobId, CreateEnqueuedState(), ScheduledState.StateName));
// (client, jobId) => client.ChangeState(jobId, CreateEnqueuedState(), ScheduledState.StateName));
//Routes.AddClientBatchCommand(
//Routes.AddClientBatchCommand(
...
@@ -176,17 +175,17 @@ namespace DotNetCore.CAP.Dashboard
...
@@ -176,17 +175,17 @@ namespace DotNetCore.CAP.Dashboard
//Routes.AddRazorPage("/recurring", x => new RecurringJobsPage());
//Routes.AddRazorPage("/recurring", x => new RecurringJobsPage());
//Routes.AddRecurringBatchCommand(
//Routes.AddRecurringBatchCommand(
// "/recurring/remove",
// "/recurring/remove",
// (manager, jobId) => manager.RemoveIfExists(jobId));
// (manager, jobId) => manager.RemoveIfExists(jobId));
//Routes.AddRecurringBatchCommand(
//Routes.AddRecurringBatchCommand(
// "/recurring/trigger",
// "/recurring/trigger",
// (manager, jobId) => manager.Trigger(jobId));
// (manager, jobId) => manager.Trigger(jobId));
//Routes.AddRazorPage("/servers", x => new ServersPage());
//Routes.AddRazorPage("/servers", x => new ServersPage());
//Routes.AddRazorPage("/retries", x => new RetriesPage());
//Routes.AddRazorPage("/retries", x => new RetriesPage());
#
endregion
#
endregion
Razor
pages
and
commands
}
}
public
static
RouteCollection
Routes
{
get
;
}
public
static
RouteCollection
Routes
{
get
;
}
...
@@ -216,4 +215,4 @@ namespace DotNetCore.CAP.Dashboard
...
@@ -216,4 +215,4 @@ namespace DotNetCore.CAP.Dashboard
return
typeof
(
DashboardRoutes
).
GetTypeInfo
().
Assembly
;
return
typeof
(
DashboardRoutes
).
GetTypeInfo
().
Assembly
;
}
}
}
}
}
}
\ No newline at end of file
src/DotNetCore.CAP/Dashboard/EmbeddedResourceDispatcher.cs
View file @
f6ca2cc4
...
@@ -12,12 +12,12 @@ namespace DotNetCore.CAP.Dashboard
...
@@ -12,12 +12,12 @@ namespace DotNetCore.CAP.Dashboard
public
EmbeddedResourceDispatcher
(
public
EmbeddedResourceDispatcher
(
string
contentType
,
string
contentType
,
Assembly
assembly
,
Assembly
assembly
,
string
resourceName
)
string
resourceName
)
{
{
if
(
contentType
==
null
)
throw
new
ArgumentNullException
(
nameof
(
contentType
));
if
(
contentType
==
null
)
throw
new
ArgumentNullException
(
nameof
(
contentType
));
if
(
assembly
==
null
)
throw
new
ArgumentNullException
(
nameof
(
assembly
));
if
(
assembly
==
null
)
throw
new
ArgumentNullException
(
nameof
(
assembly
));
_assembly
=
assembly
;
_assembly
=
assembly
;
_resourceName
=
resourceName
;
_resourceName
=
resourceName
;
_contentType
=
contentType
;
_contentType
=
contentType
;
...
@@ -51,4 +51,4 @@ namespace DotNetCore.CAP.Dashboard
...
@@ -51,4 +51,4 @@ namespace DotNetCore.CAP.Dashboard
}
}
}
}
}
}
}
}
\ No newline at end of file
src/DotNetCore.CAP/Dashboard/HtmlHelper.cs
View file @
f6ca2cc4
...
@@ -2,12 +2,11 @@
...
@@ -2,12 +2,11 @@
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Linq
;
using
System.Net
;
using
System.Net
;
using
System.Text
;
using
System.ComponentModel
;
using
System.Reflection
;
using
System.Reflection
;
using
System.Text
;
using
System.Text.RegularExpressions
;
using
System.Text.RegularExpressions
;
using
DotNetCore.CAP.Dashboard.Resources
;
using
DotNetCore.CAP.Dashboard.Pages
;
using
DotNetCore.CAP.Dashboard.Pages
;
using
DotNetCore.CAP.Dashboard.Resources
;
using
DotNetCore.CAP.Infrastructure
;
using
DotNetCore.CAP.Infrastructure
;
using
DotNetCore.CAP.Models
;
using
DotNetCore.CAP.Models
;
using
Microsoft.Extensions.Internal
;
using
Microsoft.Extensions.Internal
;
...
@@ -349,4 +348,4 @@ namespace DotNetCore.CAP.Dashboard
...
@@ -349,4 +348,4 @@ namespace DotNetCore.CAP.Dashboard
return
WebUtility
.
HtmlEncode
(
text
);
return
WebUtility
.
HtmlEncode
(
text
);
}
}
}
}
}
}
\ No newline at end of file
src/DotNetCore.CAP/Dashboard/IDashboardAuthorizationFilter.cs
View file @
f6ca2cc4
...
@@ -2,6 +2,6 @@
...
@@ -2,6 +2,6 @@
{
{
public
interface
IDashboardAuthorizationFilter
public
interface
IDashboardAuthorizationFilter
{
{
bool
Authorize
(
DashboardContext
context
);
bool
Authorize
(
DashboardContext
context
);
}
}
}
}
\ No newline at end of file
src/DotNetCore.CAP/Dashboard/IDashboardDispatcher.cs
View file @
f6ca2cc4
using
System
;
using
System.Threading.Tasks
;
using
System.Collections.Generic
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
DotNetCore.CAP.Dashboard
namespace
DotNetCore.CAP.Dashboard
{
{
...
@@ -9,4 +6,4 @@ namespace DotNetCore.CAP.Dashboard
...
@@ -9,4 +6,4 @@ namespace DotNetCore.CAP.Dashboard
{
{
Task
Dispatch
(
DashboardContext
context
);
Task
Dispatch
(
DashboardContext
context
);
}
}
}
}
\ No newline at end of file
src/DotNetCore.CAP/Dashboard/IMonitoringApi.cs
View file @
f6ca2cc4
...
@@ -6,21 +6,28 @@ namespace DotNetCore.CAP.Dashboard
...
@@ -6,21 +6,28 @@ namespace DotNetCore.CAP.Dashboard
{
{
public
interface
IMonitoringApi
public
interface
IMonitoringApi
{
{
StatisticsDto
GetStatistics
();
StatisticsDto
GetStatistics
();
IList
<
MessageDto
>
Messages
(
MessageQueryDto
queryDto
);
IList
<
MessageDto
>
Messages
(
MessageQueryDto
queryDto
);
int
PublishedFailedCount
();
int
PublishedFailedCount
();
int
PublishedProcessingCount
();
int
PublishedProcessingCount
();
int
PublishedSucceededCount
();
int
PublishedSucceededCount
();
int
ReceivedFailedCount
();
int
ReceivedFailedCount
();
int
ReceivedProcessingCount
();
int
ReceivedProcessingCount
();
int
ReceivedSucceededCount
();
int
ReceivedSucceededCount
();
IDictionary
<
DateTime
,
int
>
SucceededByDatesCount
();
IDictionary
<
DateTime
,
int
>
SucceededByDatesCount
();
IDictionary
<
DateTime
,
int
>
FailedByDatesCount
();
IDictionary
<
DateTime
,
int
>
FailedByDatesCount
();
IDictionary
<
DateTime
,
int
>
HourlySucceededJobs
();
IDictionary
<
DateTime
,
int
>
HourlySucceededJobs
();
IDictionary
<
DateTime
,
int
>
HourlyFailedJobs
();
IDictionary
<
DateTime
,
int
>
HourlyFailedJobs
();
}
}
}
}
\ No newline at end of file
src/DotNetCore.CAP/Dashboard/JobHistoryRenderer.cs
View file @
f6ca2cc4
...
@@ -14,6 +14,7 @@ namespace DotNetCore.CAP.Dashboard
...
@@ -14,6 +14,7 @@ namespace DotNetCore.CAP.Dashboard
private
static
readonly
IDictionary
<
string
,
string
>
BackgroundStateColors
private
static
readonly
IDictionary
<
string
,
string
>
BackgroundStateColors
=
new
Dictionary
<
string
,
string
>();
=
new
Dictionary
<
string
,
string
>();
private
static
readonly
IDictionary
<
string
,
string
>
ForegroundStateColors
private
static
readonly
IDictionary
<
string
,
string
>
ForegroundStateColors
=
new
Dictionary
<
string
,
string
>();
=
new
Dictionary
<
string
,
string
>();
...
@@ -144,7 +145,6 @@ namespace DotNetCore.CAP.Dashboard
...
@@ -144,7 +145,6 @@ namespace DotNetCore.CAP.Dashboard
itemsAdded
=
true
;
itemsAdded
=
true
;
}
}
if
(
stateData
.
ContainsKey
(
"Result"
)
&&
!
String
.
IsNullOrWhiteSpace
(
stateData
[
"Result"
]))
if
(
stateData
.
ContainsKey
(
"Result"
)
&&
!
String
.
IsNullOrWhiteSpace
(
stateData
[
"Result"
]))
{
{
var
result
=
stateData
[
"Result"
];
var
result
=
stateData
[
"Result"
];
...
@@ -249,4 +249,4 @@ namespace DotNetCore.CAP.Dashboard
...
@@ -249,4 +249,4 @@ namespace DotNetCore.CAP.Dashboard
return
new
NonEscapedString
(
builder
.
ToString
());
return
new
NonEscapedString
(
builder
.
ToString
());
}
}
}
}
}
}
\ No newline at end of file
src/DotNetCore.CAP/Dashboard/JsonDispatcher.cs
View file @
f6ca2cc4
using
System
;
using
System
;
using
System.Net
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
using
Newtonsoft.Json
;
using
Newtonsoft.Json
;
using
Newtonsoft.Json.Converters
;
using
Newtonsoft.Json.Converters
;
...
@@ -49,4 +48,4 @@ namespace DotNetCore.CAP.Dashboard
...
@@ -49,4 +48,4 @@ namespace DotNetCore.CAP.Dashboard
await
context
.
Response
.
WriteAsync
(
serialized
);
await
context
.
Response
.
WriteAsync
(
serialized
);
}
}
}
}
}
}
\ No newline at end of file
src/DotNetCore.CAP/Dashboard/JsonStats.cs
View file @
f6ca2cc4
...
@@ -27,7 +27,7 @@ namespace DotNetCore.CAP.Dashboard
...
@@ -27,7 +27,7 @@ namespace DotNetCore.CAP.Dashboard
var
settings
=
new
JsonSerializerSettings
var
settings
=
new
JsonSerializerSettings
{
{
ContractResolver
=
new
CamelCasePropertyNamesContractResolver
(),
ContractResolver
=
new
CamelCasePropertyNamesContractResolver
(),
Converters
=
new
JsonConverter
[]{
new
StringEnumConverter
{
CamelCaseText
=
true
}
}
Converters
=
new
JsonConverter
[]
{
new
StringEnumConverter
{
CamelCaseText
=
true
}
}
};
};
var
serialized
=
JsonConvert
.
SerializeObject
(
result
,
settings
);
var
serialized
=
JsonConvert
.
SerializeObject
(
result
,
settings
);
...
@@ -42,4 +42,4 @@ namespace DotNetCore.CAP.Dashboard
...
@@ -42,4 +42,4 @@ namespace DotNetCore.CAP.Dashboard
}
}
}
}
}
}
}
}
\ No newline at end of file
src/DotNetCore.CAP/Dashboard/LocalRequestsOnlyAuthorizationFilter.cs
View file @
f6ca2cc4
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
DotNetCore.CAP.Dashboard
namespace
DotNetCore.CAP.Dashboard
{
{
...
@@ -23,4 +21,4 @@ namespace DotNetCore.CAP.Dashboard
...
@@ -23,4 +21,4 @@ namespace DotNetCore.CAP.Dashboard
return
false
;
return
false
;
}
}
}
}
}
}
\ No newline at end of file
src/DotNetCore.CAP/Dashboard/MenuItem.cs
View file @
f6ca2cc4
...
@@ -21,7 +21,7 @@ namespace DotNetCore.CAP.Dashboard
...
@@ -21,7 +21,7 @@ namespace DotNetCore.CAP.Dashboard
public
IEnumerable
<
DashboardMetric
>
GetAllMetrics
()
public
IEnumerable
<
DashboardMetric
>
GetAllMetrics
()
{
{
var
metrics
=
new
List
<
DashboardMetric
>
{
Metric
};
var
metrics
=
new
List
<
DashboardMetric
>
{
Metric
};
if
(
Metrics
!=
null
)
if
(
Metrics
!=
null
)
{
{
metrics
.
AddRange
(
Metrics
);
metrics
.
AddRange
(
Metrics
);
...
...
src/DotNetCore.CAP/Dashboard/MessagesSidebarMenu.cs
View file @
f6ca2cc4
...
@@ -31,7 +31,7 @@ namespace DotNetCore.CAP.Dashboard
...
@@ -31,7 +31,7 @@ namespace DotNetCore.CAP.Dashboard
Active
=
page
.
RequestPath
.
StartsWith
(
"/published/failed"
),
Active
=
page
.
RequestPath
.
StartsWith
(
"/published/failed"
),
Metric
=
DashboardMetrics
.
PublishedFailedCount
Metric
=
DashboardMetrics
.
PublishedFailedCount
});
});
//=======================================ReceivedItems=============================
//=======================================ReceivedItems=============================
ReceivedItems
.
Add
(
page
=>
new
MenuItem
(
Strings
.
SidebarMenu_Succeeded
,
page
.
Url
.
To
(
"/received/succeeded"
))
ReceivedItems
.
Add
(
page
=>
new
MenuItem
(
Strings
.
SidebarMenu_Succeeded
,
page
.
Url
.
To
(
"/received/succeeded"
))
...
@@ -51,7 +51,6 @@ namespace DotNetCore.CAP.Dashboard
...
@@ -51,7 +51,6 @@ namespace DotNetCore.CAP.Dashboard
Active
=
page
.
RequestPath
.
StartsWith
(
"/received/failed"
),
Active
=
page
.
RequestPath
.
StartsWith
(
"/received/failed"
),
Metric
=
DashboardMetrics
.
ReceivedFailedCount
Metric
=
DashboardMetrics
.
ReceivedFailedCount
});
});
}
}
}
}
}
}
\ No newline at end of file
src/DotNetCore.CAP/Dashboard/Metric.cs
View file @
f6ca2cc4
namespace
DotNetCore.CAP.Dashboard
namespace
DotNetCore.CAP.Dashboard
{
{
public
class
Metric
public
class
Metric
{
{
...
@@ -31,12 +30,12 @@ namespace DotNetCore.CAP.Dashboard
...
@@ -31,12 +30,12 @@ namespace DotNetCore.CAP.Dashboard
switch
(
style
)
switch
(
style
)
{
{
case
MetricStyle
.
Default
:
return
"metric-default"
;
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
.
Success
:
return
"metric-success"
;
case
MetricStyle
.
Warning
:
return
"metric-warning"
;
case
MetricStyle
.
Warning
:
return
"metric-warning"
;
case
MetricStyle
.
Danger
:
return
"metric-danger"
;
case
MetricStyle
.
Danger
:
return
"metric-danger"
;
default
:
return
"metric-null"
;
default
:
return
"metric-null"
;
}
}
}
}
}
}
}
}
\ No newline at end of file
src/DotNetCore.CAP/Dashboard/Monitoring/MessageDto.cs
View file @
f6ca2cc4
using
System
;
using
System
;
namespace
DotNetCore.CAP.Dashboard.Monitoring
namespace
DotNetCore.CAP.Dashboard.Monitoring
{
{
public
class
MessageDto
public
class
MessageDto
...
...
src/DotNetCore.CAP/Dashboard/Monitoring/MessageQueryDto.cs
View file @
f6ca2cc4
using
System
;
using
DotNetCore.CAP.Models
;
using
System.Collections.Generic
;
using
System.Text
;
using
DotNetCore.CAP.Models
;
namespace
DotNetCore.CAP.Dashboard.Monitoring
namespace
DotNetCore.CAP.Dashboard.Monitoring
{
{
...
@@ -15,9 +12,9 @@ namespace DotNetCore.CAP.Dashboard.Monitoring
...
@@ -15,9 +12,9 @@ namespace DotNetCore.CAP.Dashboard.Monitoring
public
string
Content
{
get
;
set
;
}
public
string
Content
{
get
;
set
;
}
public
string
StatusName
{
get
;
set
;
}
public
string
StatusName
{
get
;
set
;
}
public
int
CurrentPage
{
get
;
set
;
}
public
int
CurrentPage
{
get
;
set
;
}
public
int
PageSize
{
get
;
set
;
}
public
int
PageSize
{
get
;
set
;
}
}
}
}
}
\ No newline at end of file
src/DotNetCore.CAP/Dashboard/Monitoring/ServerDto.cs
View file @
f6ca2cc4
using
System
;
namespace
DotNetCore.CAP.Dashboard.Monitoring
using
System.Collections.Generic
;
namespace
DotNetCore.CAP.Dashboard.Monitoring
{
{
public
class
SubscriberDto
public
class
SubscriberDto
{
{
...
...
src/DotNetCore.CAP/Dashboard/Monitoring/StateHistoryDto.cs
View file @
f6ca2cc4
...
@@ -8,6 +8,6 @@ namespace DotNetCore.CAP.Dashboard.Monitoring
...
@@ -8,6 +8,6 @@ namespace DotNetCore.CAP.Dashboard.Monitoring
public
string
StateName
{
get
;
set
;
}
public
string
StateName
{
get
;
set
;
}
public
string
Reason
{
get
;
set
;
}
public
string
Reason
{
get
;
set
;
}
public
DateTime
CreatedAt
{
get
;
set
;
}
public
DateTime
CreatedAt
{
get
;
set
;
}
public
IDictionary
<
string
,
string
>
Data
{
get
;
set
;
}
public
IDictionary
<
string
,
string
>
Data
{
get
;
set
;
}
}
}
}
}
\ No newline at end of file
src/DotNetCore.CAP/Dashboard/Monitoring/StatisticsDto.cs
View file @
f6ca2cc4
...
@@ -13,4 +13,4 @@
...
@@ -13,4 +13,4 @@
public
int
PublishedProcessing
{
get
;
set
;
}
public
int
PublishedProcessing
{
get
;
set
;
}
public
int
ReceivedProcessing
{
get
;
set
;
}
public
int
ReceivedProcessing
{
get
;
set
;
}
}
}
}
}
\ No newline at end of file
src/DotNetCore.CAP/Dashboard/NavigationMenu.cs
View file @
f6ca2cc4
...
@@ -13,7 +13,7 @@ namespace DotNetCore.CAP.Dashboard
...
@@ -13,7 +13,7 @@ namespace DotNetCore.CAP.Dashboard
Items
.
Add
(
page
=>
new
MenuItem
(
Strings
.
NavigationMenu_Published
,
page
.
Url
.
LinkToPublished
())
Items
.
Add
(
page
=>
new
MenuItem
(
Strings
.
NavigationMenu_Published
,
page
.
Url
.
LinkToPublished
())
{
{
Active
=
page
.
RequestPath
.
StartsWith
(
"/published"
),
Active
=
page
.
RequestPath
.
StartsWith
(
"/published"
),
Metrics
=
new
[]
Metrics
=
new
[]
{
{
DashboardMetrics
.
PublishedSucceededCount
,
DashboardMetrics
.
PublishedSucceededCount
,
DashboardMetrics
.
PublishedFailedCountOrNull
DashboardMetrics
.
PublishedFailedCountOrNull
...
...
src/DotNetCore.CAP/Dashboard/NonEscapedString.cs
View file @
f6ca2cc4
...
@@ -14,4 +14,4 @@
...
@@ -14,4 +14,4 @@
return
_value
;
return
_value
;
}
}
}
}
}
}
\ No newline at end of file
src/DotNetCore.CAP/Dashboard/Pager.cs
View file @
f6ca2cc4
...
@@ -66,7 +66,7 @@ namespace DotNetCore.CAP.Dashboard
...
@@ -66,7 +66,7 @@ namespace DotNetCore.CAP.Dashboard
AddPrevious
(
pagerItems
);
AddPrevious
(
pagerItems
);
// first page
// first page
if
(
_startPageIndex
>
1
)
if
(
_startPageIndex
>
1
)
pagerItems
.
Add
(
new
Item
(
1
,
false
,
ItemType
.
Page
));
pagerItems
.
Add
(
new
Item
(
1
,
false
,
ItemType
.
Page
));
// more page before numeric page buttons
// more page before numeric page buttons
...
@@ -153,4 +153,4 @@ namespace DotNetCore.CAP.Dashboard
...
@@ -153,4 +153,4 @@ namespace DotNetCore.CAP.Dashboard
MorePage
MorePage
}
}
}
}
}
}
\ No newline at end of file
src/DotNetCore.CAP/Dashboard/Pages/BlockMetric.cs
View file @
f6ca2cc4
...
@@ -9,4 +9,4 @@
...
@@ -9,4 +9,4 @@
public
DashboardMetric
DashboardMetric
{
get
;
}
public
DashboardMetric
DashboardMetric
{
get
;
}
}
}
}
}
\ No newline at end of file
src/DotNetCore.CAP/Dashboard/Pages/Breadcrumbs.cs
View file @
f6ca2cc4
...
@@ -13,4 +13,4 @@ namespace DotNetCore.CAP.Dashboard.Pages
...
@@ -13,4 +13,4 @@ namespace DotNetCore.CAP.Dashboard.Pages
public
string
Title
{
get
;
}
public
string
Title
{
get
;
}
public
IDictionary
<
string
,
string
>
Items
{
get
;
}
public
IDictionary
<
string
,
string
>
Items
{
get
;
}
}
}
}
}
\ No newline at end of file
src/DotNetCore.CAP/Dashboard/Pages/HomePage.cs
View file @
f6ca2cc4
...
@@ -6,4 +6,4 @@ namespace DotNetCore.CAP.Dashboard.Pages
...
@@ -6,4 +6,4 @@ namespace DotNetCore.CAP.Dashboard.Pages
{
{
public
static
readonly
List
<
DashboardMetric
>
Metrics
=
new
List
<
DashboardMetric
>();
public
static
readonly
List
<
DashboardMetric
>
Metrics
=
new
List
<
DashboardMetric
>();
}
}
}
}
\ No newline at end of file
src/DotNetCore.CAP/Dashboard/Pages/InlineMetric.cs
View file @
f6ca2cc4
...
@@ -9,4 +9,4 @@
...
@@ -9,4 +9,4 @@
public
DashboardMetric
DashboardMetric
{
get
;
}
public
DashboardMetric
DashboardMetric
{
get
;
}
}
}
}
}
\ No newline at end of file
src/DotNetCore.CAP/Dashboard/Pages/LayoutPage.cs
View file @
f6ca2cc4
...
@@ -9,4 +9,4 @@
...
@@ -9,4 +9,4 @@
public
string
Title
{
get
;
}
public
string
Title
{
get
;
}
}
}
}
}
\ No newline at end of file
src/DotNetCore.CAP/Dashboard/Pages/PublishedPage.cs
View file @
f6ca2cc4
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
DotNetCore.CAP.Processor.States
;
using
DotNetCore.CAP.Processor.States
;
namespace
DotNetCore.CAP.Dashboard.Pages
namespace
DotNetCore.CAP.Dashboard.Pages
...
@@ -30,4 +28,4 @@ namespace DotNetCore.CAP.Dashboard.Pages
...
@@ -30,4 +28,4 @@ namespace DotNetCore.CAP.Dashboard.Pages
}
}
}
}
}
}
}
}
\ No newline at end of file
src/DotNetCore.CAP/Dashboard/Pages/ReceivedPage.cs
View file @
f6ca2cc4
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
DotNetCore.CAP.Processor.States
;
using
DotNetCore.CAP.Processor.States
;
namespace
DotNetCore.CAP.Dashboard.Pages
namespace
DotNetCore.CAP.Dashboard.Pages
...
@@ -30,4 +28,4 @@ namespace DotNetCore.CAP.Dashboard.Pages
...
@@ -30,4 +28,4 @@ namespace DotNetCore.CAP.Dashboard.Pages
}
}
}
}
}
}
}
}
\ No newline at end of file
src/DotNetCore.CAP/Dashboard/Pages/SidebarMenu.cs
View file @
f6ca2cc4
...
@@ -5,7 +5,7 @@ namespace DotNetCore.CAP.Dashboard.Pages
...
@@ -5,7 +5,7 @@ namespace DotNetCore.CAP.Dashboard.Pages
{
{
partial
class
SidebarMenu
partial
class
SidebarMenu
{
{
public
SidebarMenu
(
IEnumerable
<
Func
<
RazorPage
,
MenuItem
>>
items
)
public
SidebarMenu
(
IEnumerable
<
Func
<
RazorPage
,
MenuItem
>>
items
)
{
{
if
(
items
==
null
)
throw
new
ArgumentNullException
(
nameof
(
items
));
if
(
items
==
null
)
throw
new
ArgumentNullException
(
nameof
(
items
));
Items
=
items
;
Items
=
items
;
...
@@ -13,4 +13,4 @@ namespace DotNetCore.CAP.Dashboard.Pages
...
@@ -13,4 +13,4 @@ namespace DotNetCore.CAP.Dashboard.Pages
public
IEnumerable
<
Func
<
RazorPage
,
MenuItem
>>
Items
{
get
;
}
public
IEnumerable
<
Func
<
RazorPage
,
MenuItem
>>
Items
{
get
;
}
}
}
}
}
\ No newline at end of file
src/DotNetCore.CAP/Dashboard/Pages/_Paginator.cs
View file @
f6ca2cc4
...
@@ -9,4 +9,4 @@
...
@@ -9,4 +9,4 @@
_pager
=
pager
;
_pager
=
pager
;
}
}
}
}
}
}
\ No newline at end of file
src/DotNetCore.CAP/Dashboard/Pages/_PerPageSelector.cs
View file @
f6ca2cc4
...
@@ -9,4 +9,4 @@
...
@@ -9,4 +9,4 @@
_pager
=
pager
;
_pager
=
pager
;
}
}
}
}
}
}
\ No newline at end of file
src/DotNetCore.CAP/Dashboard/RazorPage.cs
View file @
f6ca2cc4
...
@@ -2,12 +2,11 @@
...
@@ -2,12 +2,11 @@
using
System.Diagnostics
;
using
System.Diagnostics
;
using
System.Net
;
using
System.Net
;
using
System.Text
;
using
System.Text
;
using
System.Threading.Tasks
;
using
DotNetCore.CAP.Dashboard.Monitoring
;
using
DotNetCore.CAP.Dashboard.Monitoring
;
namespace
DotNetCore.CAP.Dashboard
namespace
DotNetCore.CAP.Dashboard
{
{
public
abstract
class
RazorPage
public
abstract
class
RazorPage
{
{
private
Lazy
<
StatisticsDto
>
_statisticsLazy
;
private
Lazy
<
StatisticsDto
>
_statisticsLazy
;
...
@@ -116,15 +115,15 @@ namespace DotNetCore.CAP.Dashboard
...
@@ -116,15 +115,15 @@ namespace DotNetCore.CAP.Dashboard
private
string
TransformText
(
string
body
)
private
string
TransformText
(
string
body
)
{
{
_body
=
body
;
_body
=
body
;
Execute
();
Execute
();
if
(
Layout
!=
null
)
if
(
Layout
!=
null
)
{
{
Layout
.
Assign
(
this
);
Layout
.
Assign
(
this
);
return
Layout
.
TransformText
(
_content
.
ToString
());
return
Layout
.
TransformText
(
_content
.
ToString
());
}
}
return
_content
.
ToString
();
return
_content
.
ToString
();
}
}
...
@@ -135,4 +134,4 @@ namespace DotNetCore.CAP.Dashboard
...
@@ -135,4 +134,4 @@ namespace DotNetCore.CAP.Dashboard
:
WebUtility
.
HtmlEncode
(
text
);
:
WebUtility
.
HtmlEncode
(
text
);
}
}
}
}
}
}
\ No newline at end of file
src/DotNetCore.CAP/Dashboard/RazorPageDispatcher.cs
View file @
f6ca2cc4
...
@@ -23,4 +23,4 @@ namespace DotNetCore.CAP.Dashboard
...
@@ -23,4 +23,4 @@ namespace DotNetCore.CAP.Dashboard
return
context
.
Response
.
WriteAsync
(
page
.
ToString
());
return
context
.
Response
.
WriteAsync
(
page
.
ToString
());
}
}
}
}
}
}
\ No newline at end of file
src/DotNetCore.CAP/Dashboard/RouteCollection.cs
View file @
f6ca2cc4
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Text
;
using
System.Text.RegularExpressions
;
using
System.Text.RegularExpressions
;
namespace
DotNetCore.CAP.Dashboard
namespace
DotNetCore.CAP.Dashboard
...
@@ -45,4 +44,4 @@ namespace DotNetCore.CAP.Dashboard
...
@@ -45,4 +44,4 @@ namespace DotNetCore.CAP.Dashboard
return
null
;
return
null
;
}
}
}
}
}
}
\ No newline at end of file
src/DotNetCore.CAP/Dashboard/RouteCollectionExtensions.cs
View file @
f6ca2cc4
...
@@ -19,7 +19,7 @@ namespace DotNetCore.CAP.Dashboard
...
@@ -19,7 +19,7 @@ namespace DotNetCore.CAP.Dashboard
public
static
void
AddCommand
(
public
static
void
AddCommand
(
this
RouteCollection
routes
,
this
RouteCollection
routes
,
string
pathTemplate
,
string
pathTemplate
,
Func
<
DashboardContext
,
bool
>
command
)
Func
<
DashboardContext
,
bool
>
command
)
{
{
if
(
routes
==
null
)
throw
new
ArgumentNullException
(
nameof
(
routes
));
if
(
routes
==
null
)
throw
new
ArgumentNullException
(
nameof
(
routes
));
...
@@ -63,6 +63,6 @@ namespace DotNetCore.CAP.Dashboard
...
@@ -63,6 +63,6 @@ namespace DotNetCore.CAP.Dashboard
if
(
command
==
null
)
throw
new
ArgumentNullException
(
nameof
(
command
));
if
(
command
==
null
)
throw
new
ArgumentNullException
(
nameof
(
command
));
routes
.
Add
(
pathTemplate
,
new
BatchCommandDispatcher
(
command
));
routes
.
Add
(
pathTemplate
,
new
BatchCommandDispatcher
(
command
));
}
}
}
}
}
}
\ No newline at end of file
src/DotNetCore.CAP/Dashboard/UrlHelper.cs
View file @
f6ca2cc4
using
System
;
using
System
;
using
System.Collections.Generic
;
namespace
DotNetCore.CAP.Dashboard
namespace
DotNetCore.CAP.Dashboard
{
{
public
class
UrlHelper
public
class
UrlHelper
{
{
private
readonly
DashboardContext
_context
;
private
readonly
DashboardContext
_context
;
public
UrlHelper
(
DashboardContext
context
)
public
UrlHelper
(
DashboardContext
context
)
{
{
if
(
context
==
null
)
throw
new
ArgumentNullException
(
nameof
(
context
));
if
(
context
==
null
)
throw
new
ArgumentNullException
(
nameof
(
context
));
_context
=
context
;
_context
=
context
;
...
@@ -46,4 +44,4 @@ namespace DotNetCore.CAP.Dashboard
...
@@ -46,4 +44,4 @@ namespace DotNetCore.CAP.Dashboard
return
To
(
"/jobs/enqueued/"
+
queue
);
return
To
(
"/jobs/enqueued/"
+
queue
);
}
}
}
}
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment