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
0d165b7e
Commit
0d165b7e
authored
Sep 05, 2017
by
yangxiaodong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update dashboard
parent
c3a6a11b
Changes
25
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
1671 additions
and
348 deletions
+1671
-348
cap.js
src/DotNetCore.CAP/Dashboard/Content/js/cap.js
+2
-2
DashboardMetrics.cs
src/DotNetCore.CAP/Dashboard/DashboardMetrics.cs
+75
-88
DashboardRoutes.cs
src/DotNetCore.CAP/Dashboard/DashboardRoutes.cs
+8
-2
HtmlHelper.cs
src/DotNetCore.CAP/Dashboard/HtmlHelper.cs
+19
-12
IMonitoringApi.cs
src/DotNetCore.CAP/Dashboard/IMonitoringApi.cs
+14
-23
JobHistoryRenderer.cs
src/DotNetCore.CAP/Dashboard/JobHistoryRenderer.cs
+3
-3
MessagesSidebarMenu.cs
src/DotNetCore.CAP/Dashboard/MessagesSidebarMenu.cs
+57
-0
DeletedJobDto.cs
src/DotNetCore.CAP/Dashboard/Monitoring/DeletedJobDto.cs
+0
-17
MessageDto.cs
src/DotNetCore.CAP/Dashboard/Monitoring/MessageDto.cs
+22
-0
MessageQueryDto.cs
src/DotNetCore.CAP/Dashboard/Monitoring/MessageQueryDto.cs
+22
-0
QueueWithTopEnqueuedJobsDto.cs
...e.CAP/Dashboard/Monitoring/QueueWithTopEnqueuedJobsDto.cs
+0
-10
StatisticsDto.cs
src/DotNetCore.CAP/Dashboard/Monitoring/StatisticsDto.cs
+10
-9
NavigationMenu.cs
src/DotNetCore.CAP/Dashboard/NavigationMenu.cs
+14
-10
AwaitingJobsPage.cshtml
src/DotNetCore.CAP/Dashboard/Pages/AwaitingJobsPage.cshtml
+0
-159
HomePage.cshtml
src/DotNetCore.CAP/Dashboard/Pages/HomePage.cshtml
+5
-5
HomePage.generated.cs
src/DotNetCore.CAP/Dashboard/Pages/HomePage.generated.cs
+6
-6
PublishedPage.cs
src/DotNetCore.CAP/Dashboard/Pages/PublishedPage.cs
+33
-0
PublishedPage.cshtml
src/DotNetCore.CAP/Dashboard/Pages/PublishedPage.cshtml
+122
-0
PublishedPage1.generated.cs
...otNetCore.CAP/Dashboard/Pages/PublishedPage1.generated.cs
+372
-0
ReceivedPage.cs
src/DotNetCore.CAP/Dashboard/Pages/ReceivedPage.cs
+33
-0
ReceivedPage.cshtml
src/DotNetCore.CAP/Dashboard/Pages/ReceivedPage.cshtml
+121
-0
ReceivedPage.generated.cs
src/DotNetCore.CAP/Dashboard/Pages/ReceivedPage.generated.cs
+372
-0
_Paginator.generated.cs
src/DotNetCore.CAP/Dashboard/Pages/_Paginator.generated.cs
+248
-0
_PerPageSelector.generated.cs
...NetCore.CAP/Dashboard/Pages/_PerPageSelector.generated.cs
+106
-0
UrlHelper.cs
src/DotNetCore.CAP/Dashboard/UrlHelper.cs
+7
-2
No files found.
src/DotNetCore.CAP/Dashboard/Content/js/cap.js
View file @
0d165b7e
...
...
@@ -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
;
...
...
src/DotNetCore.CAP/Dashboard/DashboardMetrics.cs
View file @
0d165b7e
...
...
@@ -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
)
...
...
@@ -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"
))
//----------------------------------------------------
public
static
readonly
DashboardMetric
PublishedFailedCountOrNull
=
new
DashboardMetric
(
"publish_failed:count-or-null"
,
"Metrics_FailedJobs"
,
page
=>
page
.
Statistics
.
PublishedFailed
>
0
?
new
Metric
(
page
.
Statistics
.
PublishedFailed
.
ToString
(
"N0"
))
{
Style
=
page
.
Statistics
.
Enqueued
>
0
?
MetricStyle
.
Info
:
MetricStyle
.
Default
,
Highlighted
=
page
.
Statistics
.
Enqueued
>
0
&&
page
.
Statistics
.
Failed
==
0
Style
=
MetricStyle
.
Danger
,
Highlighted
=
true
,
Title
=
string
.
Format
(
Strings
.
Metrics_FailedCountOrNull
,
page
.
Statistics
.
PublishedFailed
)
}
:
null
);
public
static
readonly
DashboardMetric
FailedCountOrNull
=
new
DashboardMetric
(
"failed:count-or-null"
,
public
static
readonly
DashboardMetric
Received
FailedCountOrNull
=
new
DashboardMetric
(
"
received_
failed:count-or-null"
,
"Metrics_FailedJobs"
,
page
=>
page
.
Statistics
.
Failed
>
0
?
new
Metric
(
page
.
Statistics
.
Failed
.
ToString
(
"N0"
))
page
=>
page
.
Statistics
.
Received
Failed
>
0
?
new
Metric
(
page
.
Statistics
.
Received
Failed
.
ToString
(
"N0"
))
{
Style
=
MetricStyle
.
Danger
,
Highlighted
=
true
,
Title
=
string
.
Format
(
Strings
.
Metrics_FailedCountOrNull
,
page
.
Statistics
.
Failed
)
Title
=
string
.
Format
(
Strings
.
Metrics_FailedCountOrNull
,
page
.
Statistics
.
Received
Failed
)
}
:
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
Scheduled
Count
=
new
DashboardMetric
(
"
scheduled
:count"
,
"Metrics_
Scheduled
Jobs"
,
page
=>
new
Metric
(
page
.
Statistics
.
Scheduled
.
ToString
(
"N0"
))
public
static
readonly
DashboardMetric
PublishedProcessing
Count
=
new
DashboardMetric
(
"
publish_processing
:count"
,
"Metrics_
Processing
Jobs"
,
page
=>
new
Metric
(
page
.
Statistics
.
PublishedProcessing
.
ToString
(
"N0"
))
{
Style
=
page
.
Statistics
.
Scheduled
>
0
?
MetricStyle
.
Info
:
MetricStyle
.
Default
Style
=
page
.
Statistics
.
PublishedProcessing
>
0
?
MetricStyle
.
Warning
:
MetricStyle
.
Default
});
public
static
readonly
DashboardMetric
ProcessingCount
=
new
DashboardMetric
(
"
processing:count"
,
public
static
readonly
DashboardMetric
Received
ProcessingCount
=
new
DashboardMetric
(
"received_
processing:count"
,
"Metrics_ProcessingJobs"
,
page
=>
new
Metric
(
page
.
Statistics
.
Processing
.
ToString
(
"N0"
))
page
=>
new
Metric
(
page
.
Statistics
.
Received
Processing
.
ToString
(
"N0"
))
{
Style
=
page
.
Statistics
.
Processing
>
0
?
MetricStyle
.
Warning
:
MetricStyle
.
Default
Style
=
page
.
Statistics
.
Received
Processing
>
0
?
MetricStyle
.
Warning
:
MetricStyle
.
Default
});
public
static
readonly
DashboardMetric
SucceededCount
=
new
DashboardMetric
(
"succeeded:count"
,
//----------------------------------------------------
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
.
Published
Succeeded
.
ToString
(
"N0"
))
{
IntValue
=
page
.
Statistics
.
Succeeded
IntValue
=
page
.
Statistics
.
Published
Succeeded
});
public
static
readonly
DashboardMetric
Fail
edCount
=
new
DashboardMetric
(
"fail
ed:count"
,
"Metrics_Fail
edJobs"
,
page
=>
new
Metric
(
page
.
Statistics
.
Fail
ed
.
ToString
(
"N0"
))
public
static
readonly
DashboardMetric
ReceivedSucceed
edCount
=
new
DashboardMetric
(
"received_succeed
ed:count"
,
"Metrics_Succeed
edJobs"
,
page
=>
new
Metric
(
page
.
Statistics
.
ReceivedSucceed
ed
.
ToString
(
"N0"
))
{
IntValue
=
page
.
Statistics
.
Failed
,
Style
=
page
.
Statistics
.
Failed
>
0
?
MetricStyle
.
Danger
:
MetricStyle
.
Default
,
Highlighted
=
page
.
Statistics
.
Failed
>
0
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
)
public
static
readonly
DashboardMetric
PublishedFailedCount
=
new
DashboardMetric
(
"publish_failed:count"
,
"Metrics_FailedJobs"
,
page
=>
new
Metric
(
page
.
Statistics
.
PublishedFailed
.
ToString
(
"N0"
)
)
{
awaitingCount
=
storageConnection
.
GetSetCount
(
"awaiting"
);
}
}
return
new
Metric
(
awaitingCount
.
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"
))
{
Style
=
awaitingCount
>
0
?
MetricStyle
.
Info
:
MetricStyle
.
Default
};
IntValue
=
page
.
Statistics
.
ReceivedFailed
,
Style
=
page
.
Statistics
.
ReceivedFailed
>
0
?
MetricStyle
.
Danger
:
MetricStyle
.
Default
,
Highlighted
=
page
.
Statistics
.
ReceivedFailed
>
0
});
}
}
src/DotNetCore.CAP/Dashboard/DashboardRoutes.cs
View file @
0d165b7e
...
...
@@ -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/(?<Queue>.+)",
// 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/(?<StatusName>.+)"
,
x
=>
new
PublishedPage
(
x
.
Groups
[
"StatusName"
].
Value
));
Routes
.
AddRazorPage
(
"/received/(?<StatusName>.+)"
,
x
=>
new
ReceivedPage
(
x
.
Groups
[
"StatusName"
].
Value
));
//Routes.AddClientBatchCommand(
// "/jobs/succeeded/requeue",
// (client, jobId) => client.ChangeState(jobId, CreateEnqueuedState(), SucceededState.StateName));
...
...
src/DotNetCore.CAP/Dashboard/HtmlHelper.cs
View file @
0d165b7e
...
...
@@ -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
<
Func
<
RazorPage
,
MenuItem
>>
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
)
{
...
...
src/DotNetCore.CAP/Dashboard/IMonitoringApi.cs
View file @
0d165b7e
...
...
@@ -6,32 +6,23 @@ namespace DotNetCore.CAP.Dashboard
{
public
interface
IMonitoringApi
{
IList
<
QueueWithTopEnqueuedJobsDto
>
Queues
();
IList
<
ServerDto
>
Servers
();
JobDetailsDto
JobDetails
(
string
jobId
);
StatisticsDto
GetStatistics
();
JobList
<
EnqueuedJobDto
>
EnqueuedJobs
(
string
queue
,
int
from
,
int
perPage
);
JobList
<
FetchedJobDto
>
FetchedJobs
(
string
queue
,
int
from
,
int
perPage
);
StatisticsDto
GetStatistics
();
JobList
<
ProcessingJobDto
>
ProcessingJobs
(
int
from
,
int
count
);
JobList
<
ScheduledJobDto
>
ScheduledJobs
(
int
from
,
int
count
);
JobList
<
SucceededJobDto
>
SucceededJobs
(
int
from
,
int
count
);
JobList
<
FailedJobDto
>
FailedJobs
(
int
from
,
int
count
);
JobList
<
DeletedJobDto
>
DeletedJobs
(
int
from
,
int
count
);
IList
<
MessageDto
>
Messages
(
MessageQueryDto
queryDto
);
long
ScheduledCount
();
long
EnqueuedCount
(
string
queue
);
long
FetchedCount
(
string
queue
);
long
FailedCount
();
long
ProcessingCount
();
int
PublishedFailedCount
();
int
PublishedProcessingCount
();
int
PublishedSucceededCount
();
long
SucceededListCount
();
long
DeletedListCount
();
int
ReceivedFailedCount
();
int
ReceivedProcessingCount
();
int
ReceivedSucceededCount
();
IDictionary
<
DateTime
,
long
>
SucceededByDatesCount
();
IDictionary
<
DateTime
,
long
>
FailedByDatesCount
();
IDictionary
<
DateTime
,
long
>
HourlySucceededJobs
();
IDictionary
<
DateTime
,
long
>
HourlyFailedJobs
();
IDictionary
<
DateTime
,
int
>
SucceededByDatesCount
();
IDictionary
<
DateTime
,
int
>
FailedByDatesCount
();
IDictionary
<
DateTime
,
int
>
HourlySucceededJobs
();
IDictionary
<
DateTime
,
int
>
HourlyFailedJobs
();
}
}
\ No newline at end of file
src/DotNetCore.CAP/Dashboard/JobHistoryRenderer.cs
View file @
0d165b7e
...
...
@@ -20,7 +20,7 @@ namespace DotNetCore.CAP.Dashboard
[
System
.
Diagnostics
.
CodeAnalysis
.
SuppressMessage
(
"Microsoft.Performance"
,
"CA1810:InitializeReferenceTypeStaticFieldsInline"
)]
static
JobHistoryRenderer
()
{
Register
(
Succe
ss
edState
.
StateName
,
SucceededRenderer
);
Register
(
Succe
ed
edState
.
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
(
Succe
ss
edState
.
StateName
,
"#EDF7ED"
);
BackgroundStateColors
.
Add
(
Succe
ed
edState
.
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
(
Succe
ss
edState
.
StateName
,
"#5cb85c"
);
ForegroundStateColors
.
Add
(
Succe
ed
edState
.
StateName
,
"#5cb85c"
);
ForegroundStateColors
.
Add
(
FailedState
.
StateName
,
"#d9534f"
);
ForegroundStateColors
.
Add
(
ProcessingState
.
StateName
,
"#f0ad4e"
);
ForegroundStateColors
.
Add
(
ScheduledState
.
StateName
,
"#5bc0de"
);
...
...
src/DotNetCore.CAP/Dashboard/MessagesSidebarMenu.cs
0 → 100644
View file @
0d165b7e
using
System
;
using
System.Collections.Generic
;
using
DotNetCore.CAP.Dashboard.Resources
;
namespace
DotNetCore.CAP.Dashboard
{
public
static
class
MessagesSidebarMenu
{
public
static
readonly
List
<
Func
<
RazorPage
,
MenuItem
>>
PublishedItems
=
new
List
<
Func
<
RazorPage
,
MenuItem
>>();
public
static
readonly
List
<
Func
<
RazorPage
,
MenuItem
>>
ReceivedItems
=
new
List
<
Func
<
RazorPage
,
MenuItem
>>();
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
src/DotNetCore.CAP/Dashboard/Monitoring/DeletedJobDto.cs
deleted
100644 → 0
View file @
c3a6a11b
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
;
}
}
}
src/DotNetCore.CAP/Dashboard/Monitoring/MessageDto.cs
0 → 100644
View file @
0d165b7e
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
src/DotNetCore.CAP/Dashboard/Monitoring/MessageQueryDto.cs
0 → 100644
View file @
0d165b7e
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
;
}
}
}
src/DotNetCore.CAP/Dashboard/Monitoring/QueueWithTopEnqueuedJobsDto.cs
deleted
100644 → 0
View file @
c3a6a11b
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
<
EnqueuedJobDto
>
FirstJobs
{
get
;
set
;
}
}
}
src/DotNetCore.CAP/Dashboard/Monitoring/StatisticsDto.cs
View file @
0d165b7e
...
...
@@ -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
;
}
}
}
src/DotNetCore.CAP/Dashboard/NavigationMenu.cs
View file @
0d165b7e
...
...
@@ -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
.
Published
FailedCountOrNull
}
});
Items
.
Add
(
page
=>
new
MenuItem
(
Strings
.
NavigationMenu_Re
tries
,
page
.
Url
.
To
(
"/retries"
))
Items
.
Add
(
page
=>
new
MenuItem
(
Strings
.
NavigationMenu_Re
ceived
,
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_Re
curringJobs
,
page
.
Url
.
To
(
"/recurring
"
))
Items
.
Add
(
page
=>
new
MenuItem
(
Strings
.
NavigationMenu_Re
tries
,
page
.
Url
.
To
(
"/retries
"
))
{
Active
=
page
.
RequestPath
.
StartsWith
(
"/re
curring
"
),
Metric
=
DashboardMetrics
.
Re
curringJob
Count
Active
=
page
.
RequestPath
.
StartsWith
(
"/re
tries
"
),
Metric
=
DashboardMetrics
.
Re
tries
Count
});
Items
.
Add
(
page
=>
new
MenuItem
(
Strings
.
NavigationMenu_Servers
,
page
.
Url
.
To
(
"/servers"
))
...
...
src/DotNetCore.CAP/Dashboard/Pages/AwaitingJobsPage.cshtml
deleted
100644 → 0
View file @
c3a6a11b
@* 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<string> 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);
}
}
}
<div class="row">
<div class="col-md-3">
@Html.JobsSidebar()
</div>
<div class="col-md-9">
<h1 class="page-header">@Strings.AwaitingJobsPage_Title</h1>
@if (jobIds == null)
{
<div class="alert alert-warning">
<h4>@Strings.AwaitingJobsPage_ContinuationsWarning_Title</h4>
<p>@Strings.AwaitingJobsPage_ContinuationsWarning_Text</p>
</div>
}
else if (jobIds.Count > 0)
{
<div class="js-jobs-list">
<div class="btn-toolbar btn-toolbar-top">
<button class="js-jobs-list-command btn btn-sm btn-primary"
data-url="@Url.To("/jobs/awaiting/enqueue")"
data-loading-text="@Strings.Common_Enqueueing">
<span class="glyphicon glyphicon-repeat"></span>
@Strings.Common_EnqueueButton_Text
</button>
<button class="js-jobs-list-command btn btn-sm btn-default"
data-url="@Url.To("/jobs/awaiting/delete")"
data-loading-text="@Strings.Common_Deleting"
data-confirm="@Strings.Common_DeleteConfirm">
<span class="glyphicon glyphicon-remove"></span>
@Strings.Common_DeleteSelected
</button>
@Html.PerPageSelector(pager)
</div>
<div class="table-responsive">
<table class="table table-hover">
<thead>
<tr>
<th class="min-width">
<input type="checkbox" class="js-jobs-list-select-all" />
</th>
<th class="min-width">@Strings.Common_Id</th>
<th>@Strings.Common_Job</th>
<th class="min-width">@Strings.AwaitingJobsPage_Table_Options</th>
<th class="min-width">@Strings.AwaitingJobsPage_Table_Parent</th>
<th class="align-right">@Strings.Common_Created</th>
</tr>
</thead>
<tbody>
@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"]);
//}
}
<tr class="js-jobs-list-row @(jobData != null ? "hover" : null)">
<td>
<input type="checkbox" class="js-jobs-list-checkbox" name="jobs[]" value="@jobId" />
</td>
<td class="min-width">
@Html.JobIdLink(jobId)
</td>
@if (jobData == null)
{
<td colspan="2"><em>@Strings.Common_JobExpired</em></td>
}
else
{
<td class="word-break">
@Html.JobNameLink(jobId, jobData.Message)
</td>
<td class="min-width">
@if (stateData != null && stateData.Data.ContainsKey("Options") && !String.IsNullOrWhiteSpace(stateData.Data["Options"]))
{
<code>@stateData.Data["Options"]</code>
}
else
{
<em>@Strings.Common_NotAvailable</em>
}
</td>
<td class="min-width">
@if (parentStateData != null)
{
<a href="@Url.JobDetails(stateData.Data["ParentId"])">
<span class="label label-default label-hover" style="@($"background-color: {JobHistoryRenderer.GetForegroundStateColor(parentStateData.Name)};")">
@parentStateData.Name
</span>
</a>
}
else
{
<em>@Strings.Common_NotAvailable</em>
}
</td>
<td class="min-width align-right">
@Html.RelativeTime(jobData.CreatedAt)
</td>
}
</tr>
}
</tbody>
</table>
</div>
@Html.Paginator(pager)
</div>
}
else
{
<div class="alert alert-info">
@Strings.AwaitingJobsPage_NoJobs
</div>
}
</div>
</div>
src/DotNetCore.CAP/Dashboard/Pages/HomePage.cshtml
View file @
0d165b7e
...
...
@@ -8,8 +8,8 @@
@inherits RazorPage
@{
Layout = new LayoutPage(Strings.HomePage_Title);
IDictionary<DateTime,
long
> succeeded = null;
IDictionary<DateTime,
long
> failed = null;
IDictionary<DateTime,
int
> succeeded = null;
IDictionary<DateTime,
int
> failed = null;
var period = Query("period") ?? "day";
...
...
@@ -41,12 +41,12 @@
</div>
}
<h3>@Strings.HomePage_RealtimeGraph</h3>
<div id="realtimeGraph" data-succeeded="@Statistics.
Succeeded" data-failed="@Statistics.
Failed"
<div id="realtimeGraph" data-succeeded="@Statistics.
PublishedSucceeded" data-failed="@Statistics.Published
Failed"
data-succeeded-string="@Strings.HomePage_GraphHover_Succeeded"
data-failed-string="@Strings.HomePage_GraphHover_Failed"></div>
<div style="display: none;">
<span data-metric="succeeded:count"></span>
<span data-metric="failed:count"></span>
<span data-metric="
published_
succeeded:count"></span>
<span data-metric="
published_
failed:count"></span>
</div>
<h3>
...
...
src/DotNetCore.CAP/Dashboard/Pages/HomePage.generated.cs
View file @
0d165b7e
...
...
@@ -73,8 +73,8 @@ WriteLiteral("\r\n");
#
line
9
"..\..\Dashboard\Pages\HomePage.cshtml"
Layout
=
new
LayoutPage
(
Strings
.
HomePage_Title
);
IDictionary
<
DateTime
,
long
>
succeeded
=
null
;
IDictionary
<
DateTime
,
long
>
failed
=
null
;
IDictionary
<
DateTime
,
int
>
succeeded
=
null
;
IDictionary
<
DateTime
,
int
>
failed
=
null
;
var
period
=
Query
(
"period"
)
??
"day"
;
...
...
@@ -172,7 +172,7 @@ WriteLiteral("</h3>\r\n <div id=\"realtimeGraph\" data-succeeded=\"");
#
line
44
"..\..\Dashboard\Pages\HomePage.cshtml"
Write
(
Statistics
.
Succeeded
);
Write
(
Statistics
.
Published
Succeeded
);
#
line
default
...
...
@@ -182,7 +182,7 @@ WriteLiteral("\" data-failed=\"");
#
line
44
"..\..\Dashboard\Pages\HomePage.cshtml"
Write
(
Statistics
.
Failed
);
Write
(
Statistics
.
Published
Failed
);
#
line
default
...
...
@@ -209,8 +209,8 @@ WriteLiteral("\"\r\n data-failed-string=\"");
#
line
hidden
WriteLiteral
(
@"""></div>
<div style=""display: none;"">
<span data-metric=""succeeded:count""></span>
<span data-metric=""failed:count""></span>
<span data-metric=""
published_
succeeded:count""></span>
<span data-metric=""
published_
failed:count""></span>
</div>
<h3>
...
...
src/DotNetCore.CAP/Dashboard/Pages/PublishedPage.cs
0 → 100644
View file @
0d165b7e
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
();
}
}
}
}
src/DotNetCore.CAP/Dashboard/Pages/P
rocessingJobs
Page.cshtml
→
src/DotNetCore.CAP/Dashboard/Pages/P
ublished
Page.cshtml
View file @
0d165b7e
@* Generator: Template TypeVisibility: Internal GeneratePrettyNames: True *@
@using System
@using
System.Linq
@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.
ProcessingJob
sPage_Title);
Layout = new LayoutPage(Strings.
SucceededMessage
sPage_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, monitor.ProcessingCount());
var processingJobs = monitor.ProcessingJobs(pager.FromRecord, pager.RecordsPerPage);
var servers = monitor.Servers();
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);
}
<div class="row">
<div class="col-md-3">
@Html.JobsSidebar()
@Html.JobsSidebar(
MessageType.Publish
)
</div>
<div class="col-md-9">
<h1 class="page-header">@Strings.
ProcessingJob
sPage_Title</h1>
<h1 class="page-header">@Strings.
SucceededMessage
sPage_Title</h1>
@if (
pager.TotalPage
Count == 0)
@if (
succeededMessages.
Count == 0)
{
<div class="alert alert-info">
@Strings.
Processing
JobsPage_NoJobs
@Strings.
Succeeded
JobsPage_NoJobs
</div>
}
else
{
<div class="js-jobs-list">
<div class="btn-toolbar btn-toolbar-top">
<form class="row">
<span class="col-md-3">
<input type="text" class="form-control" name="name" value="@Query("name")" placeholder="消息名称" />
</span>
<div class="col-md-5">
<div class="input-group">
<input type="text" class="form-control" name="content" value="@Query("content")" placeholder="消息内容" />
<span class="input-group-btn">
<button class="btn btn-info">查找</button>
</span>
</div>
</div>
</form>
</div>
<div class="btn-toolbar btn-toolbar-top">
<button class="js-jobs-list-command btn btn-sm btn-primary"
data-url="@Url.To("/
jobs/processing
/requeue")"
data-url="@Url.To("/
published
/requeue")"
data-loading-text="@Strings.Common_Enqueueing"
disabled="disabled">
<span class="glyphicon glyphicon-repeat"></span>
@Strings.Common_RequeueJobs
</button>
<button class="js-jobs-list-command btn btn-sm btn-default"
data-url="@Url.To("/jobs/processing/delete")"
data-loading-text="@Strings.Common_Deleting"
data-confirm="@Strings.Common_DeleteConfirm"
disabled="disabled">
<span class="glyphicon glyphicon-remove"></span>
@Strings.Common_DeleteSelected
</button>
@Html.PerPageSelector(pager)
</div>
...
...
@@ -60,62 +78,43 @@
<table class="table">
<thead>
<tr>
<th
class="min-width
">
<th
style="width:60px;
">
<input type="checkbox" class="js-jobs-list-select-all" />
</th>
<th
class="min-width">@Strings.Common_Id
</th>
<th
class="min-width">@Strings.Common_Server
</th>
<th
>@Strings.Common_Job
</th>
<th class="
align-right">@Strings.ProcessingJobsPage_Table_Started
</th>
<th
>名称
</th>
<th
>内容
</th>
<th
class="min-width">重试次数
</th>
<th class="
min-width align-right">过期时间
</th>
</tr>
</thead>
<tbody>
@foreach (var
job in processingJob
s)
@foreach (var
message in succeededMessage
s)
{
<tr class="js-jobs-list-row
@(!job.Value.InProcessingState ? "obsolete-data" : null) @(job.Value.InProcessingState ? "hover" : null)
">
<tr class="js-jobs-list-row
hover
">
<td>
@if (job.Value.InProcessingState)
{
<input type="checkbox" class="js-jobs-list-checkbox" name="jobs[]" value="@job.Key" />
}
<input type="checkbox" class="js-jobs-list-checkbox" name="jobs[]" value="@message.Id" />
</td>
<td class="min-width">
@Html.JobIdLink(job.Key)
@if (!job.Value.InProcessingState)
{
<span title="@Strings.Common_JobStateChanged_Text" class="glyphicon glyphicon-question-sign"></span>
}
<td class="word-break">
@message.Name
</td>
@if (!job.Value.InProcessingState)
{
<td colspan="3">@Strings.Common_JobStateChanged_Text</td>
}
else
{
<td class="min-width">
@Html.ServerId(job.Value.ServerId)
<td>
@message.Content
</td>
<td class="word-break">
@if (servers.All(x => x.Name != job.Value.ServerId || x.Heartbeat < DateTime.UtcNow.AddMinutes(-1)))
{
<span title="@Strings.ProcessingJobsPage_Aborted" class="glyphicon glyphicon-warning-sign" style="font-size: 10px;"></span>
}
@Html.JobNameLink(job.Key, job.Value.Job)
<td>
@message.Retries
</td>
<td class="align-right">
@if (job.Value.Started
At.HasValue)
@if (message.Expires
At.HasValue)
{
@Html.RelativeTime(job.Value.Started
At.Value)
@Html.RelativeTime(message.Expires
At.Value)
}
</td>
}
</tr>
}
</tbody>
</table>
</div>
@Html.Paginator(pager)
</div>
}
...
...
src/DotNetCore.CAP/Dashboard/Pages/PublishedPage1.generated.cs
0 → 100644
View file @
0d165b7e
This diff is collapsed.
Click to expand it.
src/DotNetCore.CAP/Dashboard/Pages/ReceivedPage.cs
0 → 100644
View file @
0d165b7e
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
();
}
}
}
}
src/DotNetCore.CAP/Dashboard/Pages/ReceivedPage.cshtml
0 → 100644
View file @
0d165b7e
@* 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);
}
<div class="row">
<div class="col-md-3">
@Html.JobsSidebar(MessageType.Subscribe)
</div>
<div class="col-md-9">
<h1 class="page-header">@Strings.SucceededMessagesPage_Title</h1>
@if (succeededMessages.Count == 0)
{
<div class="alert alert-info">
@Strings.SucceededJobsPage_NoJobs
</div>
}
else
{
<div class="js-jobs-list">
<div class="btn-toolbar btn-toolbar-top">
<form class="row">
<span class="col-md-3">
<input type="text" class="form-control" name="name" value="@Query("name")" placeholder="消息名称" />
</span>
<div class="col-md-5">
<div class="input-group">
<input type="text" class="form-control" name="content" value="@Query("content")" placeholder="消息内容" />
<span class="input-group-btn">
<button class="btn btn-info">查找</button>
</span>
</div>
</div>
</form>
</div>
<div class="btn-toolbar btn-toolbar-top">
<button class="js-jobs-list-command btn btn-sm btn-primary"
data-url="@Url.To("/received/requeue")"
data-loading-text="@Strings.Common_Enqueueing"
disabled="disabled">
<span class="glyphicon glyphicon-repeat"></span>
@Strings.Common_RequeueJobs
</button>
@Html.PerPageSelector(pager)
</div>
<div class="table-responsive">
<table class="table">
<thead>
<tr>
<th style="width:60px;">
<input type="checkbox" class="js-jobs-list-select-all" />
</th>
<th>名称</th>
<th>内容</th>
<th class="min-width">重试次数</th>
<th class="min-width align-right">过期时间</th>
</tr>
</thead>
<tbody>
@foreach (var message in succeededMessages)
{
<tr class="js-jobs-list-row hover">
<td>
<input type="checkbox" class="js-jobs-list-checkbox" name="jobs[]" value="@message.Id" />
</td>
<td class="word-break">
@message.Name
</td>
<td>
@message.Content
</td>
<td>
@message.Retries
</td>
<td class="align-right">
@if (message.ExpiresAt.HasValue)
{
@Html.RelativeTime(message.ExpiresAt.Value)
}
</td>
</tr>
}
</tbody>
</table>
</div>
@Html.Paginator(pager)
</div>
}
</div>
</div>
\ No newline at end of file
src/DotNetCore.CAP/Dashboard/Pages/ReceivedPage.generated.cs
0 → 100644
View file @
0d165b7e
This diff is collapsed.
Click to expand it.
src/DotNetCore.CAP/Dashboard/Pages/_Paginator.generated.cs
0 → 100644
View file @
0d165b7e
#
pragma
warning
disable
1591
//------------------------------------------------------------------------------
// <auto-generated>
// 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.
// </auto-generated>
//------------------------------------------------------------------------------
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
(
"<div class=\"btn-toolbar\">\r\n"
);
#
line
7
"..\..\Dashboard\Pages\_Paginator.cshtml"
if
(
_pager
.
TotalPageCount
>
1
)
{
#
line
default
#
line
hidden
WriteLiteral
(
" <div class=\"btn-group paginator\">\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
(
" <a href=\""
);
#
line
15
"..\..\Dashboard\Pages\_Paginator.cshtml"
Write
(
_pager
.
PageUrl
(
page
.
PageIndex
));
#
line
default
#
line
hidden
WriteLiteral
(
"\" class=\"btn btn-default "
);
#
line
15
"..\..\Dashboard\Pages\_Paginator.cshtml"
Write
(
_pager
.
CurrentPage
==
page
.
PageIndex
?
"active"
:
null
);
#
line
default
#
line
hidden
WriteLiteral
(
"\">\r\n "
);
#
line
16
"..\..\Dashboard\Pages\_Paginator.cshtml"
Write
(
page
.
PageIndex
);
#
line
default
#
line
hidden
WriteLiteral
(
" \r\n </a>\r\n"
);
#
line
18
"..\..\Dashboard\Pages\_Paginator.cshtml"
break
;
case
Pager
.
ItemType
.
NextPage
:
#
line
default
#
line
hidden
WriteLiteral
(
" <a href=\""
);
#
line
20
"..\..\Dashboard\Pages\_Paginator.cshtml"
Write
(
_pager
.
PageUrl
(
page
.
PageIndex
));
#
line
default
#
line
hidden
WriteLiteral
(
"\" class=\"btn btn-default "
);
#
line
20
"..\..\Dashboard\Pages\_Paginator.cshtml"
Write
(
page
.
Disabled
?
"disabled"
:
null
);
#
line
default
#
line
hidden
WriteLiteral
(
"\">\r\n "
);
#
line
21
"..\..\Dashboard\Pages\_Paginator.cshtml"
Write
(
Strings
.
Paginator_Next
);
#
line
default
#
line
hidden
WriteLiteral
(
"\r\n </a>\r\n"
);
#
line
23
"..\..\Dashboard\Pages\_Paginator.cshtml"
break
;
case
Pager
.
ItemType
.
PrevPage
:
#
line
default
#
line
hidden
WriteLiteral
(
" <a href=\""
);
#
line
25
"..\..\Dashboard\Pages\_Paginator.cshtml"
Write
(
_pager
.
PageUrl
(
page
.
PageIndex
));
#
line
default
#
line
hidden
WriteLiteral
(
"\" class=\"btn btn-default "
);
#
line
25
"..\..\Dashboard\Pages\_Paginator.cshtml"
Write
(
page
.
Disabled
?
"disabled"
:
null
);
#
line
default
#
line
hidden
WriteLiteral
(
"\">\r\n "
);
#
line
26
"..\..\Dashboard\Pages\_Paginator.cshtml"
Write
(
Strings
.
Paginator_Prev
);
#
line
default
#
line
hidden
WriteLiteral
(
"\r\n </a>\r\n"
);
#
line
28
"..\..\Dashboard\Pages\_Paginator.cshtml"
break
;
case
Pager
.
ItemType
.
MorePage
:
#
line
default
#
line
hidden
WriteLiteral
(
" <a href=\"#\" class=\"btn btn-default disabled\">\r\n "
+
" …\r\n </a>\r\n"
);
#
line
33
"..\..\Dashboard\Pages\_Paginator.cshtml"
break
;
}
}
#
line
default
#
line
hidden
WriteLiteral
(
" </div>\r\n"
);
WriteLiteral
(
" <div class=\"btn-toolbar-spacer\"></div>\r\n"
);
#
line
38
"..\..\Dashboard\Pages\_Paginator.cshtml"
}
#
line
default
#
line
hidden
WriteLiteral
(
"\r\n <div class=\"btn-toolbar-label\">\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 </div>\r\n</div>\r\n"
);
}
}
}
#pragma warning restore 1591
src/DotNetCore.CAP/Dashboard/Pages/_PerPageSelector.generated.cs
0 → 100644
View file @
0d165b7e
#
pragma
warning
disable
1591
//------------------------------------------------------------------------------
// <auto-generated>
// 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.
// </auto-generated>
//------------------------------------------------------------------------------
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 <div class=\"btn-group pull-right paginator\">\r\n"
);
#
line
6
"..\..\Dashboard\Pages\_PerPageSelector.cshtml"
foreach
(
var
count
in
new
[]
{
10
,
20
,
50
,
100
,
500
})
{
#
line
default
#
line
hidden
WriteLiteral
(
" <a class=\"btn btn-sm btn-default "
);
#
line
8
"..\..\Dashboard\Pages\_PerPageSelector.cshtml"
Write
(
count
==
_pager
.
RecordsPerPage
?
"active"
:
null
);
#
line
default
#
line
hidden
WriteLiteral
(
"\" \r\n href=\""
);
#
line
9
"..\..\Dashboard\Pages\_PerPageSelector.cshtml"
Write
(
_pager
.
RecordsPerPageUrl
(
count
));
#
line
default
#
line
hidden
WriteLiteral
(
"\">"
);
#
line
9
"..\..\Dashboard\Pages\_PerPageSelector.cshtml"
Write
(
count
);
#
line
default
#
line
hidden
WriteLiteral
(
"</a> \r\n"
);
#
line
10
"..\..\Dashboard\Pages\_PerPageSelector.cshtml"
}
#
line
default
#
line
hidden
WriteLiteral
(
" </div>\r\n <div class=\"btn-toolbar-spacer pull-right\"></div>\r\n <div class"
+
"=\"btn-toolbar-label btn-toolbar-label-sm pull-right\">\r\n "
);
#
line
14
"..\..\Dashboard\Pages\_PerPageSelector.cshtml"
Write
(
Strings
.
PerPageSelector_ItemsPerPage
);
#
line
default
#
line
hidden
WriteLiteral
(
":\r\n </div>\r\n"
);
}
}
}
#pragma warning restore 1591
src/DotNetCore.CAP/Dashboard/UrlHelper.cs
View file @
0d165b7e
...
...
@@ -31,9 +31,14 @@ namespace DotNetCore.CAP.Dashboard
return
To
(
"/jobs/details/"
+
jobId
);
}
public
string
LinkTo
Queues
()
public
string
LinkTo
Published
()
{
return
To
(
"/jobs/enqueued"
);
return
To
(
"/published/succeeded"
);
}
public
string
LinkToReceived
()
{
return
To
(
"/received/succeeded"
);
}
public
string
Queue
(
string
queue
)
...
...
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