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
02d90b1c
Commit
02d90b1c
authored
Oct 15, 2017
by
Savorboard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add current node name to layout page if user enabled node discovery
parent
bbe09e42
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
313 additions
and
272 deletions
+313
-272
LayoutPage.cshtml
src/DotNetCore.CAP/Dashboard/Pages/LayoutPage.cshtml
+54
-50
LayoutPage.generated.cs
src/DotNetCore.CAP/Dashboard/Pages/LayoutPage.generated.cs
+244
-220
RazorPage.cs
src/DotNetCore.CAP/Dashboard/RazorPage.cs
+15
-2
No files found.
src/DotNetCore.CAP/Dashboard/Pages/LayoutPage.cshtml
View file @
02d90b1c
...
@@ -16,8 +16,8 @@
...
@@ -16,8 +16,8 @@
<link
rel=
"stylesheet"
href=
"@Url.To($"
/
css
{
version
.
Major
}{
version
.
Minor
}{
version
.
Build
}")"
>
<link
rel=
"stylesheet"
href=
"@Url.To($"
/
css
{
version
.
Major
}{
version
.
Minor
}{
version
.
Build
}")"
>
</head>
</head>
<body>
<body>
<!-- Wrap all page content here -->
<!-- Wrap all page content here -->
<div
id=
"wrap"
>
<div
id=
"wrap"
>
<!-- Fixed navbar -->
<!-- Fixed navbar -->
<div
class=
"navbar navbar-default navbar-fixed-top"
>
<div
class=
"navbar navbar-default navbar-fixed-top"
>
...
@@ -52,9 +52,9 @@
...
@@ -52,9 +52,9 @@
<div
class=
"container"
style=
"margin-bottom: 20px;"
>
<div
class=
"container"
style=
"margin-bottom: 20px;"
>
@RenderBody()
@RenderBody()
</div>
</div>
</div>
</div>
<div
id=
"footer"
>
<div
id=
"footer"
>
<div
class=
"container"
>
<div
class=
"container"
>
<ul
class=
"list-inline credit"
>
<ul
class=
"list-inline credit"
>
<li>
<li>
...
@@ -65,15 +65,19 @@
...
@@ -65,15 +65,19 @@
<li>
@Storage
</li>
<li>
@Storage
</li>
<li>
@Strings.LayoutPage_Footer_Time @Html.LocalTime(DateTime.UtcNow)
</li>
<li>
@Strings.LayoutPage_Footer_Time @Html.LocalTime(DateTime.UtcNow)
</li>
<li>
@string.Format(Strings.LayoutPage_Footer_Generatedms, GenerationTime.Elapsed.TotalMilliseconds.ToString("N"))
</li>
<li>
@string.Format(Strings.LayoutPage_Footer_Generatedms, GenerationTime.Elapsed.TotalMilliseconds.ToString("N"))
</li>
@if (NodeName != null)
{
<li>
@string.Format(Strings.LayoutPage_Footer_NodeCurrent, NodeName)
</li>
}
</ul>
</ul>
</div>
</div>
</div>
</div>
<div
id=
"capConfig"
<div
id=
"capConfig"
data-pollinterval=
"@StatsPollingInterval"
data-pollinterval=
"@StatsPollingInterval"
data-pollurl=
"@(Url.To("
/
stats
"))"
>
data-pollurl=
"@(Url.To("
/
stats
"))"
>
</div>
</div>
<script
src=
"@Url.To($"
/
js
{
version
.
Major
}{
version
.
Minor
}{
version
.
Build
}")"
></script>
<script
src=
"@Url.To($"
/
js
{
version
.
Major
}{
version
.
Minor
}{
version
.
Build
}")"
></script>
</body>
</body>
</html>
</html>
\ No newline at end of file
src/DotNetCore.CAP/Dashboard/Pages/LayoutPage.generated.cs
View file @
02d90b1c
...
@@ -12,47 +12,41 @@
...
@@ -12,47 +12,41 @@
namespace
DotNetCore.CAP.Dashboard.Pages
namespace
DotNetCore.CAP.Dashboard.Pages
{
{
#
line
2
"..\..\Dashboard\Pages
\LayoutPage.cshtml"
#line 2 "..\..
\LayoutPage.cshtml"
using
System
;
using
System
;
#
line
default
#line default
#
line
hidden
#line hidden
using
System.Collections.Generic
;
using
System.Collections.Generic
;
#
line
3
"..\..\Dashboard\Pages
\LayoutPage.cshtml"
#line 3 "..\..
\LayoutPage.cshtml"
using
System.Globalization
;
using
System.Globalization
;
#
line
default
#line default
#
line
hidden
#line hidden
using
System.Linq
;
using
System.Linq
;
#
line
4
"..\..\Dashboard\Pages
\LayoutPage.cshtml"
#line 4 "..\..
\LayoutPage.cshtml"
using
System.Reflection
;
using
System.Reflection
;
#
line
default
#line default
#
line
hidden
#line hidden
using
System.Text
;
using
System.Text
;
#
line
5
"..\..\Dashboard\Pages\LayoutPage.cshtml"
#line 5 "..\..\LayoutPage.cshtml"
using
DotNetCore.CAP.Dashboard
;
#
line
default
#
line
hidden
#
line
6
"..\..\Dashboard\Pages\LayoutPage.cshtml"
using
DotNetCore.CAP.Dashboard.Pages
;
using
DotNetCore.CAP.Dashboard.Pages
;
#
line
default
#line default
#
line
hidden
#line hidden
#
line
7
"..\..\Dashboard\Pages
\LayoutPage.cshtml"
#line 6 "..\..
\LayoutPage.cshtml"
using
DotNetCore.CAP.Dashboard.Resources
;
using
DotNetCore.CAP.Dashboard.Resources
;
#
line
default
#line default
#
line
hidden
#line hidden
[
System
.
CodeDom
.
Compiler
.
GeneratedCodeAttribute
(
"RazorGenerator"
,
"2.0.0.0"
)]
[
System
.
CodeDom
.
Compiler
.
GeneratedCodeAttribute
(
"RazorGenerator"
,
"2.0.0.0"
)]
public
partial
class
LayoutPage
:
RazorPage
public
partial
class
LayoutPage
:
DotNetCore
.
CAP
.
Dashboard
.
RazorPage
{
{
#line hidden
#line hidden
...
@@ -60,8 +54,7 @@ namespace DotNetCore.CAP.Dashboard.Pages
...
@@ -60,8 +54,7 @@ namespace DotNetCore.CAP.Dashboard.Pages
{
{
WriteLiteral
(
"\r\n"
);
WriteLiteral
(
"\r\n"
);
...
@@ -69,51 +62,51 @@ WriteLiteral("\r\n");
...
@@ -69,51 +62,51 @@ WriteLiteral("\r\n");
WriteLiteral
(
"<!DOCTYPE html>\r\n<html lang=\""
);
WriteLiteral
(
"<!DOCTYPE html>\r\n<html lang=\""
);
#
line
10
"..\..\Dashboard\Pages
\LayoutPage.cshtml"
#line 9 "..\..
\LayoutPage.cshtml"
Write
(
CultureInfo
.
CurrentUICulture
.
TwoLetterISOLanguageName
);
Write
(
CultureInfo
.
CurrentUICulture
.
TwoLetterISOLanguageName
);
#
line
default
#line default
#
line
hidden
#line hidden
WriteLiteral
(
"\">\r\n<head>\r\n <title>"
);
WriteLiteral
(
"\">\r\n<head>\r\n <title>"
);
#
line
12
"..\..\Dashboard\Pages
\LayoutPage.cshtml"
#line 11 "..\..
\LayoutPage.cshtml"
Write
(
Title
);
Write
(
Title
);
#
line
default
#line default
#
line
hidden
#line hidden
WriteLiteral
(
" - CAP</title>\r\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\r\n <m"
+
WriteLiteral
(
" - CAP</title>\r\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\r\n <m"
+
"eta charset=\"utf-8\">\r\n <meta name=\"viewport\" content=\"width=device-width, ini"
+
"eta charset=\"utf-8\">\r\n <meta name=\"viewport\" content=\"width=device-width, ini"
+
"tial-scale=1.0\">\r\n"
);
"tial-scale=1.0\">\r\n"
);
#
line
16
"..\..\Dashboard\Pages
\LayoutPage.cshtml"
#line 15 "..\..
\LayoutPage.cshtml"
var
version
=
GetType
().
GetTypeInfo
().
Assembly
.
GetName
().
Version
;
var
version
=
GetType
().
GetTypeInfo
().
Assembly
.
GetName
().
Version
;
#
line
default
#line default
#
line
hidden
#line hidden
WriteLiteral
(
" <link rel=\"stylesheet\" href=\""
);
WriteLiteral
(
" <link rel=\"stylesheet\" href=\""
);
#
line
17
"..\..\Dashboard\Pages
\LayoutPage.cshtml"
#line 16 "..\..
\LayoutPage.cshtml"
Write
(
Url
.
To
(
$"/css
{
version
.
Major
}{
version
.
Minor
}{
version
.
Build
}
"
));
Write
(
Url
.
To
(
$"/css
{
version
.
Major
}{
version
.
Minor
}{
version
.
Build
}
"
));
#
line
default
#line default
#
line
hidden
#line hidden
WriteLiteral
(
@""">
WriteLiteral
(
@""">
</head>
</head>
<body>
<body>
<!-- Wrap all page content here -->
<!-- Wrap all page content here -->
<div id=""wrap"">
<div id=""wrap"">
...
@@ -130,80 +123,80 @@ WriteLiteral(@""">
...
@@ -130,80 +123,80 @@ WriteLiteral(@""">
#
line
32
"..\..\Dashboard\Pages
\LayoutPage.cshtml"
#line 31 "..\..
\LayoutPage.cshtml"
Write
(
Url
.
Home
());
Write
(
Url
.
Home
());
#
line
default
#line default
#
line
hidden
#line hidden
WriteLiteral
(
"\">CAP Dashboard</a>\r\n </div>\r\n <div class=\"
"
+
WriteLiteral
(
"\">CAP Dashboard</a>\r\n </div>\r\n <div class=\"collapse
"
+
"collapse navbar-collapse\">\r\n
"
);
" navbar-collapse\">\r\n
"
);
#
line
35
"..\..\Dashboard\Pages
\LayoutPage.cshtml"
#line 34 "..\..
\LayoutPage.cshtml"
Write
(
Html
.
RenderPartial
(
new
Navigation
()));
Write
(
Html
.
RenderPartial
(
new
Navigation
()));
#
line
default
#line default
#
line
hidden
#line hidden
WriteLiteral
(
"\r\n"
);
WriteLiteral
(
"\r\n"
);
#
line
36
"..\..\Dashboard\Pages\LayoutPage.cshtml"
#line 35 "..\..\LayoutPage.cshtml"
if
(
@AppPath
!=
null
)
{
if
(
AppPath
!=
null
)
{
#
line
default
#line default
#
line
hidden
#line hidden
WriteLiteral
(
" <ul class=\"nav navbar-nav navbar-right\">\r\n
"
+
WriteLiteral
(
" <ul class=\"nav navbar-nav navbar-right\">\r\n
"
+
" <li>\r\n
<a href=\""
);
" <li>\r\n
<a href=\""
);
#
line
39
"..\..\Dashboard\Pages
\LayoutPage.cshtml"
#line 39 "..\..
\LayoutPage.cshtml"
Write
(
AppPath
);
Write
(
AppPath
);
#
line
default
#line default
#
line
hidden
#line hidden
WriteLiteral
(
"\">\r\n <span class=\"glyphicon glyphicon-log-
"
+
WriteLiteral
(
"\">\r\n <span class=\"glyphicon glyphicon-log-out\"
"
+
"out\"></span>\r\n
"
);
"></span>\r\n
"
);
#
line
41
"..\..\Dashboard\Pages
\LayoutPage.cshtml"
#line 41 "..\..
\LayoutPage.cshtml"
Write
(
Strings
.
LayoutPage_Back
);
Write
(
Strings
.
LayoutPage_Back
);
#
line
default
#line default
#
line
hidden
#line hidden
WriteLiteral
(
"\r\n </a>\r\n </li>
"
+
WriteLiteral
(
"\r\n </a>\r\n </li>\r\n
"
+
"\r\n
</ul>\r\n"
);
"
</ul>\r\n"
);
#
line
45
"..\..\Dashboard\Pages
\LayoutPage.cshtml"
#line 45 "..\..
\LayoutPage.cshtml"
}
}
#
line
default
#line default
#
line
hidden
#line hidden
WriteLiteral
(
" </div>\r\n <!--/.nav-collapse -->\r\n "
+
WriteLiteral
(
" </div>\r\n <!--/.nav-collapse -->\r\n </div"
+
" </div>\r\n </div>\r\n\r\n <!-- Begin page content -->\r\n "
+
">\r\n </div>\r\n\r\n <!-- Begin page content -->\r\n <div class=\"co"
+
" <div class=\"container\" style=\"margin-bottom: 20px;\">\r\n "
+
"ntainer\" style=\"margin-bottom: 20px;\">\r\n "
);
""
);
#
line
53
"..\..\Dashboard\Pages
\LayoutPage.cshtml"
#line 53 "..\..
\LayoutPage.cshtml"
Write
(
RenderBody
());
Write
(
RenderBody
());
#
line
default
#line default
#
line
hidden
#line hidden
WriteLiteral
(
@"
WriteLiteral
(
@"
</div>
</div>
</div>
</div>
...
@@ -211,89 +204,120 @@ WriteLiteral(@"
...
@@ -211,89 +204,120 @@ WriteLiteral(@"
<div class=""container"">
<div class=""container"">
<ul class=""list-inline credit"">
<ul class=""list-inline credit"">
<li>
<li>
<a href=""https://github.com/dotnetcore/cap/"" target=""_blank"">CAP "
);
<a href=""https://github.com/dotnetcore/cap/"" target=""_blank"">
CAP "
);
#
line
61
"..\..\Dashboard\Pages
\LayoutPage.cshtml"
#line 62 "..\..
\LayoutPage.cshtml"
Write
(
$"
{
version
.
Major
}
.
{
version
.
Minor
}
.
{
version
.
Build
}
"
);
Write
(
$"
{
version
.
Major
}
.
{
version
.
Minor
}
.
{
version
.
Build
}
"
);
#
line
default
#line default
#
line
hidden
#line hidden
WriteLiteral
(
"\r\n </a>\r\n </li>\r\n <l"
+
WriteLiteral
(
"\r\n </a>\r\n </li>\r\n <li>"
);
"i>"
);
#
line
64
"..\..\Dashboard\Pages
\LayoutPage.cshtml"
#line 65 "..\..
\LayoutPage.cshtml"
Write
(
Storage
);
Write
(
Storage
);
#
line
default
#line default
#
line
hidden
#line hidden
WriteLiteral
(
"</li>\r\n
<li>"
);
WriteLiteral
(
"</li>\r\n
<li>"
);
#
line
65
"..\..\Dashboard\Pages
\LayoutPage.cshtml"
#line 66 "..\..
\LayoutPage.cshtml"
Write
(
Strings
.
LayoutPage_Footer_Time
);
Write
(
Strings
.
LayoutPage_Footer_Time
);
#
line
default
#line default
#
line
hidden
#line hidden
WriteLiteral
(
" "
);
WriteLiteral
(
" "
);
#
line
65
"..\..\Dashboard\Pages
\LayoutPage.cshtml"
#line 66 "..\..
\LayoutPage.cshtml"
Write
(
Html
.
LocalTime
(
DateTime
.
UtcNow
));
Write
(
Html
.
LocalTime
(
DateTime
.
UtcNow
));
#
line
default
#line default
#
line
hidden
#line hidden
WriteLiteral
(
"</li>\r\n <li>"
);
WriteLiteral
(
"</li>\r\n <li>"
);
#line 67 "..\..\LayoutPage.cshtml"
Write
(
string
.
Format
(
Strings
.
LayoutPage_Footer_Generatedms
,
GenerationTime
.
Elapsed
.
TotalMilliseconds
.
ToString
(
"N"
)));
#line default
#line hidden
WriteLiteral
(
"</li>\r\n"
);
#line 68 "..\..\LayoutPage.cshtml"
if
(
NodeName
!=
null
)
{
#line default
#line hidden
WriteLiteral
(
" <li>"
);
#line 70 "..\..\LayoutPage.cshtml"
Write
(
string
.
Format
(
Strings
.
LayoutPage_Footer_NodeCurrent
,
NodeName
));
#line default
#line hidden
WriteLiteral
(
"</li>\r\n"
);
#
line
66
"..\..\Dashboard\Pages
\LayoutPage.cshtml"
#line 71 "..\..
\LayoutPage.cshtml"
Write
(
String
.
Format
(
Strings
.
LayoutPage_Footer_Generatedms
,
GenerationTime
.
Elapsed
.
TotalMilliseconds
.
ToString
(
"N"
)));
}
#
line
default
#line default
#
line
hidden
#line hidden
WriteLiteral
(
"</li>\r\n </ul>\r\n </div>\r\n </div>\r\n \r\n
"
+
WriteLiteral
(
" </ul>\r\n </div>\r\n </div>\r\n\r\n <div id=\"capConfig\"\r\n
"
+
" <div id=\"capConfig\"\r\n
data-pollinterval=\""
);
"
data-pollinterval=\""
);
#
line
72
"..\..\Dashboard\Pages
\LayoutPage.cshtml"
#line 77 "..\..
\LayoutPage.cshtml"
Write
(
StatsPollingInterval
);
Write
(
StatsPollingInterval
);
#
line
default
#line default
#
line
hidden
#line hidden
WriteLiteral
(
"\"\r\n
data-pollurl=\""
);
WriteLiteral
(
"\"\r\n
data-pollurl=\""
);
#
line
73
"..\..\Dashboard\Pages
\LayoutPage.cshtml"
#line 78 "..\..
\LayoutPage.cshtml"
Write
(
Url
.
To
(
"/stats"
));
Write
(
Url
.
To
(
"/stats"
));
#
line
default
#line default
#
line
hidden
#line hidden
WriteLiteral
(
"\">\r\n </div>\r\n\r\n
<script src=\""
);
WriteLiteral
(
"\">\r\n </div>\r\n\r\n
<script src=\""
);
#
line
76
"..\..\Dashboard\Pages
\LayoutPage.cshtml"
#line 81 "..\..
\LayoutPage.cshtml"
Write
(
Url
.
To
(
$"/js
{
version
.
Major
}{
version
.
Minor
}{
version
.
Build
}
"
));
Write
(
Url
.
To
(
$"/js
{
version
.
Major
}{
version
.
Minor
}{
version
.
Build
}
"
));
#
line
default
#line default
#
line
hidden
#line hidden
WriteLiteral
(
"\"></script>\r\n </body>\r\n</html>\r\n
"
);
WriteLiteral
(
"\"></script>\r\n</body>\r\n</html>
"
);
}
}
...
...
src/DotNetCore.CAP/Dashboard/RazorPage.cs
View file @
02d90b1c
...
@@ -26,6 +26,8 @@ namespace DotNetCore.CAP.Dashboard
...
@@ -26,6 +26,8 @@ namespace DotNetCore.CAP.Dashboard
public
IStorage
Storage
{
get
;
internal
set
;
}
public
IStorage
Storage
{
get
;
internal
set
;
}
public
string
AppPath
{
get
;
internal
set
;
}
public
string
AppPath
{
get
;
internal
set
;
}
public
string
NodeName
{
get
;
internal
set
;
}
public
int
StatsPollingInterval
{
get
;
internal
set
;
}
public
int
StatsPollingInterval
{
get
;
internal
set
;
}
public
Stopwatch
GenerationTime
{
get
;
private
set
;
}
public
Stopwatch
GenerationTime
{
get
;
private
set
;
}
...
@@ -64,10 +66,10 @@ namespace DotNetCore.CAP.Dashboard
...
@@ -64,10 +66,10 @@ namespace DotNetCore.CAP.Dashboard
Response
=
parentPage
.
Response
;
Response
=
parentPage
.
Response
;
Storage
=
parentPage
.
Storage
;
Storage
=
parentPage
.
Storage
;
AppPath
=
parentPage
.
AppPath
;
AppPath
=
parentPage
.
AppPath
;
NodeName
=
parentPage
.
NodeName
;
StatsPollingInterval
=
parentPage
.
StatsPollingInterval
;
StatsPollingInterval
=
parentPage
.
StatsPollingInterval
;
Url
=
parentPage
.
Url
;
Url
=
parentPage
.
Url
;
RequestServices
=
parentPage
.
RequestServices
;
RequestServices
=
parentPage
.
RequestServices
;
GenerationTime
=
parentPage
.
GenerationTime
;
GenerationTime
=
parentPage
.
GenerationTime
;
_statisticsLazy
=
parentPage
.
_statisticsLazy
;
_statisticsLazy
=
parentPage
.
_statisticsLazy
;
}
}
...
@@ -79,6 +81,7 @@ namespace DotNetCore.CAP.Dashboard
...
@@ -79,6 +81,7 @@ namespace DotNetCore.CAP.Dashboard
RequestServices
=
context
.
RequestServices
;
RequestServices
=
context
.
RequestServices
;
Storage
=
context
.
Storage
;
Storage
=
context
.
Storage
;
AppPath
=
context
.
Options
.
AppPath
;
AppPath
=
context
.
Options
.
AppPath
;
NodeName
=
GetNodeName
();
StatsPollingInterval
=
context
.
Options
.
StatsPollingInterval
;
StatsPollingInterval
=
context
.
Options
.
StatsPollingInterval
;
Url
=
new
UrlHelper
(
context
);
Url
=
new
UrlHelper
(
context
);
...
@@ -93,11 +96,21 @@ namespace DotNetCore.CAP.Dashboard
...
@@ -93,11 +96,21 @@ namespace DotNetCore.CAP.Dashboard
});
});
}
}
private
string
GetNodeName
()
{
var
discoveryOptions
=
RequestServices
.
GetService
<
DiscoveryOptions
>();
if
(
discoveryOptions
!=
null
)
{
return
$"
{
discoveryOptions
.
NodeName
}
(
{
discoveryOptions
.
NodeId
}
)"
;
}
return
null
;
}
private
void
SetServersCount
(
StatisticsDto
dto
)
private
void
SetServersCount
(
StatisticsDto
dto
)
{
{
if
(
CapCache
.
Global
.
TryGet
(
"cap.nodes.count"
,
out
var
count
))
if
(
CapCache
.
Global
.
TryGet
(
"cap.nodes.count"
,
out
var
count
))
{
{
dto
.
Servers
=
(
int
)
count
;
dto
.
Servers
=
(
int
)
count
;
}
}
else
else
{
{
...
...
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