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
Hide 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,64 +16,68 @@
<link
rel=
"stylesheet"
href=
"@Url.To($"
/
css
{
version
.
Major
}{
version
.
Minor
}{
version
.
Build
}")"
>
</head>
<body>
<!-- Wrap all page content here -->
<div
id=
"wrap"
>
<!-- Wrap all page content here -->
<div
id=
"wrap"
>
<!-- Fixed navbar -->
<div
class=
"navbar navbar-default navbar-fixed-top"
>
<div
class=
"container"
>
<div
class=
"navbar-header"
>
<button
type=
"button"
class=
"navbar-toggle"
data-toggle=
"collapse"
data-target=
".navbar-collapse"
>
<span
class=
"icon-bar"
></span>
<span
class=
"icon-bar"
></span>
<span
class=
"icon-bar"
></span>
</button>
<a
class=
"navbar-brand"
href=
"@Url.Home()"
>
CAP Dashboard
</a>
</div>
<div
class=
"collapse navbar-collapse"
>
@Html.RenderPartial(new Navigation())
@if (AppPath != null)
{
<ul
class=
"nav navbar-nav navbar-right"
>
<li>
<a
href=
"@AppPath"
>
<span
class=
"glyphicon glyphicon-log-out"
></span>
@Strings.LayoutPage_Back
</a>
</li>
</ul>
}
<!-- Fixed navbar -->
<div
class=
"navbar navbar-default navbar-fixed-top"
>
<div
class=
"container"
>
<div
class=
"navbar-header"
>
<button
type=
"button"
class=
"navbar-toggle"
data-toggle=
"collapse"
data-target=
".navbar-collapse"
>
<span
class=
"icon-bar"
></span>
<span
class=
"icon-bar"
></span>
<span
class=
"icon-bar"
></span>
</button>
<a
class=
"navbar-brand"
href=
"@Url.Home()"
>
CAP Dashboard
</a>
</div>
<div
class=
"collapse navbar-collapse"
>
@Html.RenderPartial(new Navigation())
@if (AppPath != null)
{
<ul
class=
"nav navbar-nav navbar-right"
>
<li>
<a
href=
"@AppPath"
>
<span
class=
"glyphicon glyphicon-log-out"
></span>
@Strings.LayoutPage_Back
</a>
</li>
</ul>
}
</div>
<!--/.nav-collapse -->
</div>
<!--/.nav-collapse -->
</div>
</div>
<!-- Begin page content -->
<div
class=
"container"
style=
"margin-bottom: 20px;"
>
@RenderBody()
<!-- Begin page content -->
<div
class=
"container"
style=
"margin-bottom: 20px;"
>
@RenderBody()
</div>
</div>
</div>
<div
id=
"footer"
>
<div
class=
"container"
>
<ul
class=
"list-inline credit"
>
<li>
<a
href=
"https://github.com/dotnetcore/cap/"
target=
"_blank"
>
CAP @($"{version.Major}.{version.Minor}.{version.Build}")
</a>
</li>
<li>
@Storage
</li>
<li>
@Strings.LayoutPage_Footer_Time @Html.LocalTime(DateTime.UtcNow)
</li>
<li>
@string.Format(Strings.LayoutPage_Footer_Generatedms, GenerationTime.Elapsed.TotalMilliseconds.ToString("N"))
</li>
</ul>
<div
id=
"footer"
>
<div
class=
"container"
>
<ul
class=
"list-inline credit"
>
<li>
<a
href=
"https://github.com/dotnetcore/cap/"
target=
"_blank"
>
CAP @($"{version.Major}.{version.Minor}.{version.Build}")
</a>
</li>
<li>
@Storage
</li>
<li>
@Strings.LayoutPage_Footer_Time @Html.LocalTime(DateTime.UtcNow)
</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>
</div>
</div>
</div>
<div
id=
"capConfig"
data-pollinterval=
"@StatsPollingInterval"
data-pollurl=
"@(Url.To("
/
stats
"))"
>
</div>
<div
id=
"capConfig"
data-pollinterval=
"@StatsPollingInterval"
data-pollurl=
"@(Url.To("
/
stats
"))"
>
</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>
</html>
\ No newline at end of file
src/DotNetCore.CAP/Dashboard/Pages/LayoutPage.generated.cs
View file @
02d90b1c
...
...
@@ -11,48 +11,42 @@
namespace
DotNetCore.CAP.Dashboard.Pages
{
#
line
2
"..\..\Dashboard\Pages
\LayoutPage.cshtml"
#line 2 "..\..
\LayoutPage.cshtml"
using
System
;
#
line
default
#
line
hidden
#line default
#line hidden
using
System.Collections.Generic
;
#
line
3
"..\..\Dashboard\Pages
\LayoutPage.cshtml"
#line 3 "..\..
\LayoutPage.cshtml"
using
System.Globalization
;
#
line
default
#
line
hidden
#line default
#line hidden
using
System.Linq
;
#
line
4
"..\..\Dashboard\Pages
\LayoutPage.cshtml"
#line 4 "..\..
\LayoutPage.cshtml"
using
System.Reflection
;
#
line
default
#
line
hidden
#line default
#line hidden
using
System.Text
;
#
line
5
"..\..\Dashboard\Pages\LayoutPage.cshtml"
using
DotNetCore.CAP.Dashboard
;
#
line
default
#
line
hidden
#
line
6
"..\..\Dashboard\Pages\LayoutPage.cshtml"
#line 5 "..\..\LayoutPage.cshtml"
using
DotNetCore.CAP.Dashboard.Pages
;
#
line
default
#
line
hidden
#
line
7
"..\..\Dashboard\Pages
\LayoutPage.cshtml"
#line default
#line hidden
#line 6 "..\..
\LayoutPage.cshtml"
using
DotNetCore.CAP.Dashboard.Resources
;
#
line
default
#
line
hidden
#line default
#line hidden
[
System
.
CodeDom
.
Compiler
.
GeneratedCodeAttribute
(
"RazorGenerator"
,
"2.0.0.0"
)]
public
partial
class
LayoutPage
:
RazorPage
public
partial
class
LayoutPage
:
DotNetCore
.
CAP
.
Dashboard
.
RazorPage
{
#line hidden
...
...
@@ -60,240 +54,270 @@ namespace DotNetCore.CAP.Dashboard.Pages
{
WriteLiteral
(
"\r\n"
);
WriteLiteral
(
"\r\n"
);
WriteLiteral
(
"<!DOCTYPE html>\r\n<html lang=\""
);
#line 9 "..\..\LayoutPage.cshtml"
Write
(
CultureInfo
.
CurrentUICulture
.
TwoLetterISOLanguageName
);
#line default
#line hidden
WriteLiteral
(
"\">\r\n<head>\r\n <title>"
);
WriteLiteral
(
"<!DOCTYPE html>\r\n<html lang=\""
);
#line 11 "..\..\LayoutPage.cshtml"
Write
(
Title
);
#
line
10
"..\..\Dashboard\Pages\LayoutPage.cshtml"
Write
(
CultureInfo
.
CurrentUICulture
.
TwoLetterISOLanguageName
);
#line default
#line hidden
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"
+
"tial-scale=1.0\">\r\n"
);
#
line
default
#
line
hidden
WriteLiteral
(
"\">\r\n<head>\r\n <title>"
);
#
line
12
"..\..\Dashboard\Pages\LayoutPage.cshtml"
Write
(
Title
);
#line 15 "..\..\LayoutPage.cshtml"
var
version
=
GetType
().
GetTypeInfo
().
Assembly
.
GetName
().
Version
;
#
line
default
#
line
hidden
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"
+
"tial-scale=1.0\">\r\n"
);
#line default
#line hidden
WriteLiteral
(
" <link rel=\"stylesheet\" href=\""
);
#
line
16
"..\..\Dashboard\Pages\LayoutPage.cshtml"
var
version
=
GetType
().
GetTypeInfo
().
Assembly
.
GetName
().
Version
;
#
line
default
#
line
hidden
WriteLiteral
(
" <link rel=\"stylesheet\" href=\""
);
#line 16 "..\..\LayoutPage.cshtml"
Write
(
Url
.
To
(
$"/css
{
version
.
Major
}{
version
.
Minor
}{
version
.
Build
}
"
));
#
line
17
"..\..\Dashboard\Pages\LayoutPage.cshtml"
Write
(
Url
.
To
(
$"/css
{
version
.
Major
}{
version
.
Minor
}{
version
.
Build
}
"
));
#
line
default
#
line
hidden
WriteLiteral
(
@""">
#line default
#line hidden
WriteLiteral
(
@""">
</head>
<body>
<!-- Wrap all page content here -->
<div id=""wrap"">
<!-- Fixed navbar -->
<div class=""navbar navbar-default navbar-fixed-top"">
<div class=""container"">
<div class=""navbar-header"">
<button type=""button"" class=""navbar-toggle"" data-toggle=""collapse"" data-target="".navbar-collapse"">
<span class=""icon-bar""></span>
<span class=""icon-bar""></span>
<span class=""icon-bar""></span>
</button>
<a class=""navbar-brand"" href="""
);
#
line
32
"..\..\Dashboard\Pages\LayoutPage.cshtml"
Write
(
Url
.
Home
());
#
line
default
#
line
hidden
WriteLiteral
(
"\">CAP Dashboard</a>\r\n </div>\r\n <div class=\""
+
"collapse navbar-collapse\">\r\n "
);
#
line
35
"..\..\Dashboard\Pages\LayoutPage.cshtml"
Write
(
Html
.
RenderPartial
(
new
Navigation
()));
#
line
default
#
line
hidden
WriteLiteral
(
"\r\n"
);
#
line
36
"..\..\Dashboard\Pages\LayoutPage.cshtml"
if
(
@AppPath
!=
null
)
{
#
line
default
#
line
hidden
WriteLiteral
(
" <ul class=\"nav navbar-nav navbar-right\">\r\n "
+
" <li>\r\n <a href=\""
);
#
line
39
"..\..\Dashboard\Pages\LayoutPage.cshtml"
Write
(
AppPath
);
#
line
default
#
line
hidden
WriteLiteral
(
"\">\r\n <span class=\"glyphicon glyphicon-log-"
+
"out\"></span>\r\n "
);
#
line
41
"..\..\Dashboard\Pages\LayoutPage.cshtml"
Write
(
Strings
.
LayoutPage_Back
);
#
line
default
#
line
hidden
WriteLiteral
(
"\r\n </a>\r\n </li>"
+
"\r\n </ul>\r\n"
);
#
line
45
"..\..\Dashboard\Pages\LayoutPage.cshtml"
}
#
line
default
#
line
hidden
WriteLiteral
(
" </div>\r\n <!--/.nav-collapse -->\r\n "
+
" </div>\r\n </div>\r\n\r\n <!-- Begin page content -->\r\n "
+
" <div class=\"container\" style=\"margin-bottom: 20px;\">\r\n "
+
""
);
#
line
53
"..\..\Dashboard\Pages\LayoutPage.cshtml"
Write
(
RenderBody
());
#
line
default
#
line
hidden
WriteLiteral
(
@"
</div>
</div>
<body>
<!-- Wrap all page content here -->
<div id=""wrap"">
<div id=""footer"">
<!-- Fixed navbar -->
<div class=""navbar navbar-default navbar-fixed-top"">
<div class=""container"">
<ul class=""list-inline credit"">
<li>
<a href=""https://github.com/dotnetcore/cap/"" target=""_blank"">CAP "
);
<div class=""navbar-header"">
<button type=""button"" class=""navbar-toggle"" data-toggle=""collapse"" data-target="".navbar-collapse"">
<span class=""icon-bar""></span>
<span class=""icon-bar""></span>
<span class=""icon-bar""></span>
</button>
<a class=""navbar-brand"" href="""
);
#line 31 "..\..\LayoutPage.cshtml"
Write
(
Url
.
Home
());
#line default
#line hidden
WriteLiteral
(
"\">CAP Dashboard</a>\r\n </div>\r\n <div class=\"collapse"
+
" navbar-collapse\">\r\n "
);
#line 34 "..\..\LayoutPage.cshtml"
Write
(
Html
.
RenderPartial
(
new
Navigation
()));
#line default
#line hidden
WriteLiteral
(
"\r\n"
);
#line 35 "..\..\LayoutPage.cshtml"
if
(
AppPath
!=
null
)
{
#line default
#line hidden
WriteLiteral
(
" <ul class=\"nav navbar-nav navbar-right\">\r\n "
+
" <li>\r\n <a href=\""
);
#line 39 "..\..\LayoutPage.cshtml"
Write
(
AppPath
);
#line default
#line hidden
WriteLiteral
(
"\">\r\n <span class=\"glyphicon glyphicon-log-out\""
+
"></span>\r\n "
);
#line 41 "..\..\LayoutPage.cshtml"
Write
(
Strings
.
LayoutPage_Back
);
#line default
#line hidden
WriteLiteral
(
"\r\n </a>\r\n </li>\r\n "
+
" </ul>\r\n"
);
#line 45 "..\..\LayoutPage.cshtml"
}
#
line
61
"..\..\Dashboard\Pages\LayoutPage.cshtml"
Write
(
$"
{
version
.
Major
}
.
{
version
.
Minor
}
.
{
version
.
Build
}
"
);
#line default
#line hidden
WriteLiteral
(
" </div>\r\n <!--/.nav-collapse -->\r\n </div"
+
">\r\n </div>\r\n\r\n <!-- Begin page content -->\r\n <div class=\"co"
+
"ntainer\" style=\"margin-bottom: 20px;\">\r\n "
);
#
line
default
#
line
hidden
WriteLiteral
(
"\r\n </a>\r\n </li>\r\n <l"
+
"i>"
);
#
line
64
"..\..\Dashboard\Pages\LayoutPage.cshtml"
Write
(
Storage
);
#line 53 "..\..\LayoutPage.cshtml"
Write
(
RenderBody
());
#
line
default
#
line
hidden
WriteLiteral
(
"</li>\r\n <li>"
);
#line default
#line hidden
WriteLiteral
(
@"
</div>
</div>
#
line
65
"..\..\Dashboard\Pages\LayoutPage.cshtml"
Write
(
Strings
.
LayoutPage_Footer_Time
);
<div id=""footer"">
<div class=""container"">
<ul class=""list-inline credit"">
<li>
<a href=""https://github.com/dotnetcore/cap/"" target=""_blank"">
CAP "
);
#
line
default
#
line
hidden
WriteLiteral
(
" "
);
#
line
65
"..\..\Dashboard\Pages\LayoutPage.cshtml"
Write
(
Html
.
LocalTime
(
DateTime
.
UtcNow
));
#line 62 "..\..\LayoutPage.cshtml"
Write
(
$"
{
version
.
Major
}
.
{
version
.
Minor
}
.
{
version
.
Build
}
"
);
#
line
default
#
line
hidden
WriteLiteral
(
"</li>\r\n <li>"
);
#line default
#line hidden
WriteLiteral
(
"\r\n </a>\r\n </li>\r\n <li>"
);
#
line
66
"..\..\Dashboard\Pages\LayoutPage.cshtml"
Write
(
String
.
Format
(
Strings
.
LayoutPage_Footer_Generatedms
,
GenerationTime
.
Elapsed
.
TotalMilliseconds
.
ToString
(
"N"
)));
#
line
default
#
line
hidden
WriteLiteral
(
"</li>\r\n </ul>\r\n </div>\r\n </div>\r\n \r\n "
+
" <div id=\"capConfig\"\r\n data-pollinterval=\""
);
#line 65 "..\..\LayoutPage.cshtml"
Write
(
Storage
);
#
line
72
"..\..\Dashboard\Pages\LayoutPage.cshtml"
Write
(
StatsPollingInterval
);
#
line
default
#
line
hidden
WriteLiteral
(
"\"\r\n data-pollurl=\""
);
#line default
#line hidden
WriteLiteral
(
"</li>\r\n <li>"
);
#line 66 "..\..\LayoutPage.cshtml"
Write
(
Strings
.
LayoutPage_Footer_Time
);
#line default
#line hidden
WriteLiteral
(
" "
);
#
line
73
"..\..\Dashboard\Pages\LayoutPage.cshtml"
Write
(
Url
.
To
(
"/stats"
));
#
line
default
#
line
hidden
WriteLiteral
(
"\">\r\n </div>\r\n\r\n <script src=\""
);
#line 66 "..\..\LayoutPage.cshtml"
Write
(
Html
.
LocalTime
(
DateTime
.
UtcNow
));
#
line
76
"..\..\Dashboard\Pages\LayoutPage.cshtml"
Write
(
Url
.
To
(
$"/js
{
version
.
Major
}{
version
.
Minor
}{
version
.
Build
}
"
));
#line default
#line hidden
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
default
#
line
hidden
WriteLiteral
(
"\"></script>\r\n </body>\r\n</html>\r\n"
);
#line 70 "..\..\LayoutPage.cshtml"
Write
(
string
.
Format
(
Strings
.
LayoutPage_Footer_NodeCurrent
,
NodeName
));
#line default
#line hidden
WriteLiteral
(
"</li>\r\n"
);
#line 71 "..\..\LayoutPage.cshtml"
}
#line default
#line hidden
WriteLiteral
(
" </ul>\r\n </div>\r\n </div>\r\n\r\n <div id=\"capConfig\"\r\n "
+
" data-pollinterval=\""
);
#line 77 "..\..\LayoutPage.cshtml"
Write
(
StatsPollingInterval
);
#line default
#line hidden
WriteLiteral
(
"\"\r\n data-pollurl=\""
);
#line 78 "..\..\LayoutPage.cshtml"
Write
(
Url
.
To
(
"/stats"
));
#line default
#line hidden
WriteLiteral
(
"\">\r\n </div>\r\n\r\n <script src=\""
);
#line 81 "..\..\LayoutPage.cshtml"
Write
(
Url
.
To
(
$"/js
{
version
.
Major
}{
version
.
Minor
}{
version
.
Build
}
"
));
#line default
#line hidden
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
public
IStorage
Storage
{
get
;
internal
set
;
}
public
string
AppPath
{
get
;
internal
set
;
}
public
string
NodeName
{
get
;
internal
set
;
}
public
int
StatsPollingInterval
{
get
;
internal
set
;
}
public
Stopwatch
GenerationTime
{
get
;
private
set
;
}
...
...
@@ -64,10 +66,10 @@ namespace DotNetCore.CAP.Dashboard
Response
=
parentPage
.
Response
;
Storage
=
parentPage
.
Storage
;
AppPath
=
parentPage
.
AppPath
;
NodeName
=
parentPage
.
NodeName
;
StatsPollingInterval
=
parentPage
.
StatsPollingInterval
;
Url
=
parentPage
.
Url
;
RequestServices
=
parentPage
.
RequestServices
;
GenerationTime
=
parentPage
.
GenerationTime
;
_statisticsLazy
=
parentPage
.
_statisticsLazy
;
}
...
...
@@ -79,6 +81,7 @@ namespace DotNetCore.CAP.Dashboard
RequestServices
=
context
.
RequestServices
;
Storage
=
context
.
Storage
;
AppPath
=
context
.
Options
.
AppPath
;
NodeName
=
GetNodeName
();
StatsPollingInterval
=
context
.
Options
.
StatsPollingInterval
;
Url
=
new
UrlHelper
(
context
);
...
...
@@ -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
)
{
if
(
CapCache
.
Global
.
TryGet
(
"cap.nodes.count"
,
out
var
count
))
{
dto
.
Servers
=
(
int
)
count
;
dto
.
Servers
=
(
int
)
count
;
}
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