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 @@
<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"
>
...
...
@@ -52,9 +52,9 @@
<div
class=
"container"
style=
"margin-bottom: 20px;"
>
@RenderBody()
</div>
</div>
</div>
<div
id=
"footer"
>
<div
id=
"footer"
>
<div
class=
"container"
>
<ul
class=
"list-inline credit"
>
<li>
...
...
@@ -65,15 +65,19 @@
<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"
<div
id=
"capConfig"
data-pollinterval=
"@StatsPollingInterval"
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>
</html>
\ No newline at end of file
src/DotNetCore.CAP/Dashboard/Pages/LayoutPage.generated.cs
View file @
02d90b1c
...
...
@@ -12,47 +12,41 @@
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 default
#line hidden
#
line
7
"..\..\Dashboard\Pages
\LayoutPage.cshtml"
#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,8 +54,7 @@ namespace DotNetCore.CAP.Dashboard.Pages
{
WriteLiteral
(
"\r\n"
);
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
);
#
line
default
#
line
hidden
WriteLiteral
(
"\">\r\n<head>\r\n <title>"
);
#line default
#line hidden
WriteLiteral
(
"\">\r\n<head>\r\n <title>"
);
#
line
12
"..\..\Dashboard\Pages
\LayoutPage.cshtml"
#line 11 "..\..
\LayoutPage.cshtml"
Write
(
Title
);
#
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
(
" - 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
16
"..\..\Dashboard\Pages
\LayoutPage.cshtml"
#line 15 "..\..
\LayoutPage.cshtml"
var
version
=
GetType
().
GetTypeInfo
().
Assembly
.
GetName
().
Version
;
#
line
default
#
line
hidden
WriteLiteral
(
" <link rel=\"stylesheet\" href=\""
);
#line default
#line hidden
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
}
"
));
#
line
default
#
line
hidden
WriteLiteral
(
@""">
#line default
#line hidden
WriteLiteral
(
@""">
</head>
<body>
<body>
<!-- Wrap all page content here -->
<div id=""wrap"">
...
...
@@ -130,80 +123,80 @@ WriteLiteral(@""">
#
line
32
"..\..\Dashboard\Pages
\LayoutPage.cshtml"
#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 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"
#line 34 "..\..
\LayoutPage.cshtml"
Write
(
Html
.
RenderPartial
(
new
Navigation
()));
#
line
default
#
line
hidden
WriteLiteral
(
"\r\n"
);
#line default
#line hidden
WriteLiteral
(
"\r\n"
);
#
line
36
"..\..\Dashboard\Pages\LayoutPage.cshtml"
if
(
@AppPath
!=
null
)
{
#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 default
#line hidden
WriteLiteral
(
" <ul class=\"nav navbar-nav navbar-right\">\r\n
"
+
" <li>\r\n
<a href=\""
);
#
line
39
"..\..\Dashboard\Pages
\LayoutPage.cshtml"
#line 39 "..\..
\LayoutPage.cshtml"
Write
(
AppPath
);
#
line
default
#
line
hidden
WriteLiteral
(
"\">\r\n <span class=\"glyphicon glyphicon-log-
"
+
"out\"></span>\r\n
"
);
#line default
#line hidden
WriteLiteral
(
"\">\r\n <span class=\"glyphicon glyphicon-log-out\"
"
+
"></span>\r\n
"
);
#
line
41
"..\..\Dashboard\Pages
\LayoutPage.cshtml"
#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 default
#line hidden
WriteLiteral
(
"\r\n </a>\r\n </li>\r\n
"
+
"
</ul>\r\n"
);
#
line
45
"..\..\Dashboard\Pages
\LayoutPage.cshtml"
#line 45 "..\..
\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 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
53
"..\..\Dashboard\Pages
\LayoutPage.cshtml"
#line 53 "..\..
\LayoutPage.cshtml"
Write
(
RenderBody
());
#
line
default
#
line
hidden
WriteLiteral
(
@"
#line default
#line hidden
WriteLiteral
(
@"
</div>
</div>
...
...
@@ -211,89 +204,120 @@ WriteLiteral(@"
<div class=""container"">
<ul class=""list-inline credit"">
<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
}
"
);
#
line
default
#
line
hidden
WriteLiteral
(
"\r\n </a>\r\n </li>\r\n <l"
+
"i>"
);
#line default
#line hidden
WriteLiteral
(
"\r\n </a>\r\n </li>\r\n <li>"
);
#
line
64
"..\..\Dashboard\Pages
\LayoutPage.cshtml"
#line 65 "..\..
\LayoutPage.cshtml"
Write
(
Storage
);
#
line
default
#
line
hidden
WriteLiteral
(
"</li>\r\n
<li>"
);
#line default
#line hidden
WriteLiteral
(
"</li>\r\n
<li>"
);
#
line
65
"..\..\Dashboard\Pages
\LayoutPage.cshtml"
#line 66 "..\..
\LayoutPage.cshtml"
Write
(
Strings
.
LayoutPage_Footer_Time
);
#
line
default
#
line
hidden
WriteLiteral
(
" "
);
#line default
#line hidden
WriteLiteral
(
" "
);
#
line
65
"..\..\Dashboard\Pages
\LayoutPage.cshtml"
#line 66 "..\..
\LayoutPage.cshtml"
Write
(
Html
.
LocalTime
(
DateTime
.
UtcNow
));
#
line
default
#
line
hidden
WriteLiteral
(
"</li>\r\n <li>"
);
#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 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"
Write
(
String
.
Format
(
Strings
.
LayoutPage_Footer_Generatedms
,
GenerationTime
.
Elapsed
.
TotalMilliseconds
.
ToString
(
"N"
)));
#line 71 "..\..
\LayoutPage.cshtml"
}
#
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 default
#line hidden
WriteLiteral
(
" </ul>\r\n </div>\r\n </div>\r\n\r\n <div id=\"capConfig\"\r\n
"
+
"
data-pollinterval=\""
);
#
line
72
"..\..\Dashboard\Pages
\LayoutPage.cshtml"
#line 77 "..\..
\LayoutPage.cshtml"
Write
(
StatsPollingInterval
);
#
line
default
#
line
hidden
WriteLiteral
(
"\"\r\n
data-pollurl=\""
);
#line default
#line hidden
WriteLiteral
(
"\"\r\n
data-pollurl=\""
);
#
line
73
"..\..\Dashboard\Pages
\LayoutPage.cshtml"
#line 78 "..\..
\LayoutPage.cshtml"
Write
(
Url
.
To
(
"/stats"
));
#
line
default
#
line
hidden
WriteLiteral
(
"\">\r\n </div>\r\n\r\n
<script src=\""
);
#line default
#line hidden
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
}
"
));
#
line
default
#
line
hidden
WriteLiteral
(
"\"></script>\r\n </body>\r\n</html>\r\n
"
);
#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