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
Expand all
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
This diff is collapsed.
Click to expand it.
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