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
12e04037
Commit
12e04037
authored
Sep 01, 2017
by
yangxiaodong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add pages.
parent
45816b74
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
956 additions
and
16 deletions
+956
-16
DashboardRoutes.cs
src/DotNetCore.CAP/Dashboard/DashboardRoutes.cs
+2
-2
HtmlHelper.cs
src/DotNetCore.CAP/Dashboard/HtmlHelper.cs
+14
-14
QueuesPage.cshtml
src/DotNetCore.CAP/Dashboard/Pages/QueuesPage.cshtml
+122
-0
QueuesPage.generated.cs
src/DotNetCore.CAP/Dashboard/Pages/QueuesPage.generated.cs
+574
-0
_Breadcrumbs.generated.cs
src/DotNetCore.CAP/Dashboard/Pages/_Breadcrumbs.generated.cs
+105
-0
_SidebarMenu.generated.cs
src/DotNetCore.CAP/Dashboard/Pages/_SidebarMenu.generated.cs
+139
-0
No files found.
src/DotNetCore.CAP/Dashboard/DashboardRoutes.cs
View file @
12e04037
...
...
@@ -74,10 +74,10 @@ 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));
//
x => new FetchedJobsPage(x.Groups["Queue"].Value));
//Routes.AddClientBatchCommand("/jobs/enqueued/delete", (client, jobId) => client.ChangeState(jobId, CreateDeletedState()));
//Routes.AddClientBatchCommand("/jobs/enqueued/requeue", (client, jobId) => client.ChangeState(jobId, CreateEnqueuedState()));
...
...
src/DotNetCore.CAP/Dashboard/HtmlHelper.cs
View file @
12e04037
...
...
@@ -23,22 +23,22 @@ namespace DotNetCore.CAP.Dashboard
_page
=
page
;
}
//
public NonEscapedString Breadcrumbs(string title, IDictionary<string, string> items)
//
{
//
if (items == null) throw new ArgumentNullException(nameof(items));
//
return RenderPartial(new Breadcrumbs(title, items));
//
}
public
NonEscapedString
Breadcrumbs
(
string
title
,
IDictionary
<
string
,
string
>
items
)
{
if
(
items
==
null
)
throw
new
ArgumentNullException
(
nameof
(
items
));
return
RenderPartial
(
new
Breadcrumbs
(
title
,
items
));
}
//
public NonEscapedString JobsSidebar()
//
{
//
return RenderPartial(new SidebarMenu(JobsSidebarMenu.Items));
//
}
public
NonEscapedString
JobsSidebar
()
{
return
RenderPartial
(
new
SidebarMenu
(
JobsSidebarMenu
.
Items
));
}
//
public NonEscapedString SidebarMenu(IEnumerable<Func<RazorPage, MenuItem>> items)
//
{
//
if (items == null) throw new ArgumentNullException(nameof(items));
//
return RenderPartial(new SidebarMenu(items));
//
}
public
NonEscapedString
SidebarMenu
(
IEnumerable
<
Func
<
RazorPage
,
MenuItem
>>
items
)
{
if
(
items
==
null
)
throw
new
ArgumentNullException
(
nameof
(
items
));
return
RenderPartial
(
new
SidebarMenu
(
items
));
}
public
NonEscapedString
BlockMetric
(
DashboardMetric
metric
)
{
...
...
src/DotNetCore.CAP/Dashboard/Pages/QueuesPage.cshtml
0 → 100644
View file @
12e04037
@* Generator: Template TypeVisibility: Internal GeneratePrettyNames: True *@
@using System.Linq
@using DotNetCore.CAP.Dashboard
@using DotNetCore.CAP.Dashboard.Pages
@using DotNetCore.CAP.Dashboard.Resources
@inherits RazorPage
@{
Layout = new LayoutPage(Strings.QueuesPage_Title);
var monitor = Storage.GetMonitoringApi();
var queues = monitor.Queues();
}
<div class="row">
<div class="col-md-3">
@Html.JobsSidebar()
</div>
<div class="col-md-9">
<h1 class="page-header">@Strings.QueuesPage_Title</h1>
@if (queues.Count == 0)
{
<div class="alert alert-warning">
@Strings.QueuesPage_NoQueues
</div>
}
else
{
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th style="min-width: 200px;">@Strings.QueuesPage_Table_Queue</th>
<th>@Strings.QueuesPage_Table_Length</th>
<th>@Strings.Common_Fetched</th>
<th>@Strings.QueuesPage_Table_NextsJobs</th>
</tr>
</thead>
<tbody>
@foreach (var queue in queues)
{
<tr>
<td>@Html.QueueLabel(queue.Name)</td>
<td>@queue.Length</td>
<td>
@if (queue.Fetched.HasValue)
{
<a href="@Url.To("/jobs/enqueued/fetched/" + queue.Name)">
@queue.Fetched
</a>
}
else
{
<em>@Strings.Common_NotAvailable</em>
}
</td>
<td>
@if (queue.FirstJobs.Count == 0)
{
<em>
@Strings.QueuesPage_NoJobs
</em>
}
else
{
<table class="table table-condensed table-inner">
<thead>
<tr>
<th class="min-width">@Strings.Common_Id</th>
<th class="min-width">@Strings.Common_State</th>
<th>@Strings.Common_Job</th>
<th class="align-right min-width">@Strings.Common_Enqueued</th>
</tr>
</thead>
<tbody>
@foreach (var job in queue.FirstJobs)
{
<tr class="@(job.Value == null || !job.Value.InEnqueuedState ? "obsolete-data" : null)">
<td class="min-width">
@Html.JobIdLink(job.Key)
@if (job.Value != null && !job.Value.InEnqueuedState)
{
<span title="@Strings.Common_JobStateChanged_Text" class="glyphicon glyphicon-question-sign"></span>
}
</td>
@if (job.Value == null)
{
<td colspan="3"><em>@Strings.Common_JobExpired</em></td>
}
else
{
<td class="min-width">
@Html.StateLabel(job.Value.State)
</td>
<td class="word-break">
@Html.JobNameLink(job.Key, job.Value.Message)
</td>
<td class="align-right min-width">
@if (job.Value.EnqueuedAt.HasValue)
{
@Html.RelativeTime(job.Value.EnqueuedAt.Value)
}
else
{
<em>@Strings.Common_NotAvailable</em>
}
</td>
}
</tr>
}
</tbody>
</table>
}
</td>
</tr>
}
</tbody>
</table>
</div>
}
</div>
</div>
\ No newline at end of file
src/DotNetCore.CAP/Dashboard/Pages/QueuesPage.generated.cs
0 → 100644
View file @
12e04037
This diff is collapsed.
Click to expand it.
src/DotNetCore.CAP/Dashboard/Pages/_Breadcrumbs.generated.cs
0 → 100644
View file @
12e04037
#
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\_Breadcrumbs.cshtml"
using
DotNetCore.CAP.Dashboard
;
#
line
default
#
line
hidden
[
System
.
CodeDom
.
Compiler
.
GeneratedCodeAttribute
(
"RazorGenerator"
,
"2.0.0.0"
)]
internal
partial
class
Breadcrumbs
:
RazorPage
{
#line hidden
public
override
void
Execute
()
{
WriteLiteral
(
"\r\n"
);
WriteLiteral
(
"\r\n<ol class=\"breadcrumb\">\r\n <li><a href=\""
);
#
line
6
"..\..\Dashboard\Pages\_Breadcrumbs.cshtml"
Write
(
Url
.
Home
());
#
line
default
#
line
hidden
WriteLiteral
(
"\"><span class=\"glyphicon glyphicon-home\"></span></a></li>\r\n"
);
#
line
7
"..\..\Dashboard\Pages\_Breadcrumbs.cshtml"
foreach
(
var
item
in
Items
)
{
#
line
default
#
line
hidden
WriteLiteral
(
" <li><a href=\""
);
#
line
9
"..\..\Dashboard\Pages\_Breadcrumbs.cshtml"
Write
(
item
.
Value
);
#
line
default
#
line
hidden
WriteLiteral
(
"\">"
);
#
line
9
"..\..\Dashboard\Pages\_Breadcrumbs.cshtml"
Write
(
item
.
Key
);
#
line
default
#
line
hidden
WriteLiteral
(
"</a></li>\r\n"
);
#
line
10
"..\..\Dashboard\Pages\_Breadcrumbs.cshtml"
}
#
line
default
#
line
hidden
WriteLiteral
(
" <li class=\"active\">"
);
#
line
11
"..\..\Dashboard\Pages\_Breadcrumbs.cshtml"
Write
(
Title
);
#
line
default
#
line
hidden
WriteLiteral
(
"</li>\r\n</ol>"
);
}
}
}
#pragma warning restore 1591
src/DotNetCore.CAP/Dashboard/Pages/_SidebarMenu.generated.cs
0 → 100644
View file @
12e04037
#
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\_SidebarMenu.cshtml"
using
DotNetCore.CAP.Dashboard
;
#
line
default
#
line
hidden
[
System
.
CodeDom
.
Compiler
.
GeneratedCodeAttribute
(
"RazorGenerator"
,
"2.0.0.0"
)]
internal
partial
class
SidebarMenu
:
RazorPage
{
#line hidden
public
override
void
Execute
()
{
WriteLiteral
(
"\r\n"
);
#
line
4
"..\..\Dashboard\Pages\_SidebarMenu.cshtml"
if
(
Items
.
Any
())
{
#
line
default
#
line
hidden
WriteLiteral
(
" <div id=\"stats\" class=\"list-group\">\r\n"
);
#
line
7
"..\..\Dashboard\Pages\_SidebarMenu.cshtml"
foreach
(
var
item
in
Items
)
{
var
itemValue
=
item
(
this
);
#
line
default
#
line
hidden
WriteLiteral
(
" <a href=\""
);
#
line
10
"..\..\Dashboard\Pages\_SidebarMenu.cshtml"
Write
(
itemValue
.
Url
);
#
line
default
#
line
hidden
WriteLiteral
(
"\" class=\"list-group-item "
);
#
line
10
"..\..\Dashboard\Pages\_SidebarMenu.cshtml"
Write
(
itemValue
.
Active
?
"active"
:
null
);
#
line
default
#
line
hidden
WriteLiteral
(
"\">\r\n "
);
#
line
11
"..\..\Dashboard\Pages\_SidebarMenu.cshtml"
Write
(
itemValue
.
Text
);
#
line
default
#
line
hidden
WriteLiteral
(
"\r\n <span class=\"pull-right\">\r\n"
);
#
line
13
"..\..\Dashboard\Pages\_SidebarMenu.cshtml"
foreach
(
var
metric
in
itemValue
.
GetAllMetrics
())
{
#
line
default
#
line
hidden
#
line
15
"..\..\Dashboard\Pages\_SidebarMenu.cshtml"
Write
(
Html
.
InlineMetric
(
metric
));
#
line
default
#
line
hidden
#
line
15
"..\..\Dashboard\Pages\_SidebarMenu.cshtml"
}
#
line
default
#
line
hidden
WriteLiteral
(
" </span>\r\n </a>\r\n"
);
#
line
19
"..\..\Dashboard\Pages\_SidebarMenu.cshtml"
}
#
line
default
#
line
hidden
WriteLiteral
(
" </div>\r\n"
);
#
line
21
"..\..\Dashboard\Pages\_SidebarMenu.cshtml"
}
#
line
default
#
line
hidden
}
}
}
#pragma warning restore 1591
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