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
e6343e3d
Commit
e6343e3d
authored
Sep 19, 2017
by
yangxiaodong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add node page.
parent
69c69f4c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
250 additions
and
2 deletions
+250
-2
NodePage.cs
src/DotNetCore.CAP/Dashboard/Pages/NodePage.cs
+31
-0
NodePage.cshtml
src/DotNetCore.CAP/Dashboard/Pages/NodePage.cshtml
+46
-0
NodePage.generated.cs
src/DotNetCore.CAP/Dashboard/Pages/NodePage.generated.cs
+171
-0
SubscriberPage.cshtml
src/DotNetCore.CAP/Dashboard/Pages/SubscriberPage.cshtml
+1
-1
SubscriberPage.generated.cs
...otNetCore.CAP/Dashboard/Pages/SubscriberPage.generated.cs
+1
-1
No files found.
src/DotNetCore.CAP/Dashboard/Pages/NodePage.cs
0 → 100644
View file @
e6343e3d
using
System
;
using
System.Collections.Generic
;
using
DotNetCore.CAP.NodeDiscovery
;
using
Microsoft.Extensions.DependencyInjection
;
namespace
DotNetCore.CAP.Dashboard.Pages
{
partial
class
NodePage
{
private
IList
<
Node
>
_nodes
=
null
;
public
IList
<
Node
>
Nodes
{
get
{
if
(
_nodes
==
null
)
{
var
configOptions
=
RequestServices
.
GetService
<
DashboardOptions
>();
var
discoveryServer
=
configOptions
.
Discovery
;
if
(
discoveryServer
==
null
)
return
null
;
var
factory
=
RequestServices
.
GetService
<
IDiscoveryProviderFactory
>();
var
discoryProvider
=
factory
.
Get
(
discoveryServer
);
_nodes
=
discoryProvider
.
GetNodes
().
GetAwaiter
().
GetResult
();
}
return
_nodes
;
}
}
}
}
src/DotNetCore.CAP/Dashboard/Pages/NodePage.cshtml
0 → 100644
View file @
e6343e3d
@* Generator: Template TypeVisibility: Internal GeneratePrettyNames: True *@
@using DotNetCore.CAP.Dashboard
@using DotNetCore.CAP.Dashboard.Pages
@using DotNetCore.CAP.Dashboard.Resources
@inherits RazorPage
@{
Layout = new LayoutPage(Strings.NodePage_Title);
}
<div class="row">
<div class="col-md-12">
<h1 class="page-header">@Strings.NodePage_Title</h1>
@if (Nodes == null || Nodes.Count==0)
{
<div class="alert alert-warning">
@Strings.NodePage_NoNodes
</div>
}
else
{
<div class="table-responsive">
<table class="table">
<thead>
<tr>
<th width="20%">节点名称</th>
<th width="20%">IP地址</th>
<th>Tags</th>
<th width="20%">操作</th>
</tr>
</thead>
<tbody>
@foreach (var node in Nodes)
{
<tr>
<td>@node.Name</td>
<td>@node.Address</td>
<td><a class="btn">切换到</a></td>
</tr>
}
</tbody>
</table>
</div>
}
</div>
</div>
\ No newline at end of file
src/DotNetCore.CAP/Dashboard/Pages/NodePage.generated.cs
0 → 100644
View file @
e6343e3d
#
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\NodePage.cshtml"
using
DotNetCore.CAP.Dashboard
;
#
line
default
#
line
hidden
#
line
3
"..\..\Dashboard\Pages\NodePage.cshtml"
using
DotNetCore.CAP.Dashboard.Pages
;
#
line
default
#
line
hidden
#
line
4
"..\..\Dashboard\Pages\NodePage.cshtml"
using
DotNetCore.CAP.Dashboard.Resources
;
#
line
default
#
line
hidden
[
System
.
CodeDom
.
Compiler
.
GeneratedCodeAttribute
(
"RazorGenerator"
,
"2.0.0.0"
)]
internal
partial
class
NodePage
:
RazorPage
{
#line hidden
public
override
void
Execute
()
{
WriteLiteral
(
"\r\n"
);
#
line
6
"..\..\Dashboard\Pages\NodePage.cshtml"
Layout
=
new
LayoutPage
(
Strings
.
NodePage_Title
);
#
line
default
#
line
hidden
WriteLiteral
(
"<div class=\"row\">\r\n <div class=\"col-md-12\">\r\n <h1 class=\"page-header\">"
);
#
line
11
"..\..\Dashboard\Pages\NodePage.cshtml"
Write
(
Strings
.
NodePage_Title
);
#
line
default
#
line
hidden
WriteLiteral
(
"</h1>\r\n\r\n"
);
#
line
13
"..\..\Dashboard\Pages\NodePage.cshtml"
if
(
Nodes
==
null
||
Nodes
.
Count
==
0
)
{
#
line
default
#
line
hidden
WriteLiteral
(
" <div class=\"alert alert-warning\">\r\n "
);
#
line
16
"..\..\Dashboard\Pages\NodePage.cshtml"
Write
(
Strings
.
NodePage_NoNodes
);
#
line
default
#
line
hidden
WriteLiteral
(
"\r\n </div>\r\n"
);
#
line
18
"..\..\Dashboard\Pages\NodePage.cshtml"
}
else
{
#
line
default
#
line
hidden
WriteLiteral
(
@" <div class=""table-responsive"">
<table class=""table"">
<thead>
<tr>
<th width=""50%"">节点名称</th>
<th width=""50%"">IP地址</th>
</tr>
</thead>
<tbody>
"
);
#
line
30
"..\..\Dashboard\Pages\NodePage.cshtml"
foreach
(
var
node
in
Nodes
)
{
#
line
default
#
line
hidden
WriteLiteral
(
" <tr>\r\n <td>"
);
#
line
33
"..\..\Dashboard\Pages\NodePage.cshtml"
Write
(
node
.
Name
);
#
line
default
#
line
hidden
WriteLiteral
(
"</td>\r\n <td>"
);
#
line
34
"..\..\Dashboard\Pages\NodePage.cshtml"
Write
(
node
.
Address
);
#
line
default
#
line
hidden
WriteLiteral
(
"</td>\r\n </tr>\r\n"
);
#
line
36
"..\..\Dashboard\Pages\NodePage.cshtml"
}
#
line
default
#
line
hidden
WriteLiteral
(
" </tbody>\r\n </table>\r\n </div>\r\n"
);
#
line
40
"..\..\Dashboard\Pages\NodePage.cshtml"
}
#
line
default
#
line
hidden
WriteLiteral
(
" </div>\r\n</div>"
);
}
}
}
#pragma warning restore 1591
src/DotNetCore.CAP/Dashboard/Pages/SubscriberPage.cshtml
View file @
e6343e3d
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
@if (subscribers.Count == 0)
@if (subscribers.Count == 0)
{
{
<div class="alert alert-warning">
<div class="alert alert-warning">
@Strings.S
erversPage_NoServ
ers
@Strings.S
ubscribersPage_NoSubscrib
ers
</div>
</div>
}
}
else
else
...
...
src/DotNetCore.CAP/Dashboard/Pages/SubscriberPage.generated.cs
View file @
e6343e3d
...
@@ -96,7 +96,7 @@ WriteLiteral(" <div class=\"alert alert-warning\">\r\n
...
@@ -96,7 +96,7 @@ WriteLiteral(" <div class=\"alert alert-warning\">\r\n
#
line
21
"..\..\Dashboard\Pages\SubscriberPage.cshtml"
#
line
21
"..\..\Dashboard\Pages\SubscriberPage.cshtml"
Write
(
Strings
.
S
erversPage_NoServ
ers
);
Write
(
Strings
.
S
ubscribersPage_NoSubscrib
ers
);
#
line
default
#
line
default
...
...
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