Commit ab48d3a9 authored by yangxiaodong's avatar yangxiaodong

modify node and subscriber pages

parent e0de7a16
...@@ -15,13 +15,12 @@ namespace DotNetCore.CAP.Dashboard.Pages ...@@ -15,13 +15,12 @@ namespace DotNetCore.CAP.Dashboard.Pages
{ {
if (_nodes == null) if (_nodes == null)
{ {
var configOptions = RequestServices.GetService<DashboardOptions>(); var configOptions = RequestServices.GetService<DiscoveryOptions>();
var discoveryServer = configOptions.Discovery;
if (discoveryServer == null)
return null;
var factory = RequestServices.GetService<IDiscoveryProviderFactory>(); var factory = RequestServices.GetService<IDiscoveryProviderFactory>();
var discoryProvider = factory.Get(discoveryServer);
var discoryProvider = factory.Create(configOptions);
_nodes = discoryProvider.GetNodes().GetAwaiter().GetResult(); _nodes = discoryProvider.GetNodes().GetAwaiter().GetResult();
} }
return _nodes; return _nodes;
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
<tr> <tr>
<th width="20%">节点名称</th> <th width="20%">节点名称</th>
<th width="20%">IP地址</th> <th width="20%">IP地址</th>
<th width="7%">端口号</th>
<th>Tags</th> <th>Tags</th>
<th width="20%">操作</th> <th width="20%">操作</th>
</tr> </tr>
...@@ -34,8 +35,9 @@ ...@@ -34,8 +35,9 @@
<tr> <tr>
<td>@node.Name</td> <td>@node.Name</td>
<td>@node.Address</td> <td>@node.Address</td>
<td>@node.Port</td>
<td><a class="btn">切换到</a></td> <td>@node.Tags</td>
<td><a href="javascript:;" class="btn-link">切换到</a></td>
</tr> </tr>
} }
</tbody> </tbody>
......
...@@ -106,8 +106,11 @@ WriteLiteral(@" <div class=""table-responsive""> ...@@ -106,8 +106,11 @@ WriteLiteral(@" <div class=""table-responsive"">
<table class=""table""> <table class=""table"">
<thead> <thead>
<tr> <tr>
<th width=""50%"">节点名称</th> <th width=""20%"">节点名称</th>
<th width=""50%"">IP地址</th> <th width=""20%"">IP地址</th>
<th width=""7%"">端口号</th>
<th>Tags</th>
<th width=""20%"">操作</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
...@@ -115,7 +118,7 @@ WriteLiteral(@" <div class=""table-responsive""> ...@@ -115,7 +118,7 @@ WriteLiteral(@" <div class=""table-responsive"">
#line 30 "..\..\Dashboard\Pages\NodePage.cshtml" #line 33 "..\..\Dashboard\Pages\NodePage.cshtml"
foreach (var node in Nodes) foreach (var node in Nodes)
{ {
...@@ -126,7 +129,7 @@ WriteLiteral(" <tr>\r\n ...@@ -126,7 +129,7 @@ WriteLiteral(" <tr>\r\n
#line 33 "..\..\Dashboard\Pages\NodePage.cshtml" #line 36 "..\..\Dashboard\Pages\NodePage.cshtml"
Write(node.Name); Write(node.Name);
...@@ -136,17 +139,38 @@ WriteLiteral("</td>\r\n <td>"); ...@@ -136,17 +139,38 @@ WriteLiteral("</td>\r\n <td>");
#line 34 "..\..\Dashboard\Pages\NodePage.cshtml" #line 37 "..\..\Dashboard\Pages\NodePage.cshtml"
Write(node.Address); Write(node.Address);
#line default #line default
#line hidden #line hidden
WriteLiteral("</td>\r\n </tr>\r\n"); WriteLiteral("</td>\r\n <td>");
#line 36 "..\..\Dashboard\Pages\NodePage.cshtml" #line 38 "..\..\Dashboard\Pages\NodePage.cshtml"
Write(node.Port);
#line default
#line hidden
WriteLiteral("</td>\r\n <td>");
#line 39 "..\..\Dashboard\Pages\NodePage.cshtml"
Write(node.Tags);
#line default
#line hidden
WriteLiteral("</td>\r\n <td><a class=\"btn\">切换到</a></td>\r\n " +
" </tr>\r\n");
#line 42 "..\..\Dashboard\Pages\NodePage.cshtml"
} }
...@@ -156,7 +180,7 @@ WriteLiteral(" </tbody>\r\n </table>\r\n ...@@ -156,7 +180,7 @@ WriteLiteral(" </tbody>\r\n </table>\r\n
#line 40 "..\..\Dashboard\Pages\NodePage.cshtml" #line 46 "..\..\Dashboard\Pages\NodePage.cshtml"
} }
......
...@@ -38,12 +38,13 @@ ...@@ -38,12 +38,13 @@
@foreach (var subscriber in subscribers) @foreach (var subscriber in subscribers)
{ {
var i = 0; var i = 0;
var rowCount = subscriber.Value.Count;
@foreach (var column in subscriber.Value) @foreach (var column in subscriber.Value)
{ {
<tr> <tr>
@if (i == 0) @if (i == 0)
{ {
<td rowspan="@subscriber.Value.Count">@subscriber.Key</td> <td rowspan="@rowCount">@subscriber.Key</td>
} }
<td>@column.Attribute.Name</td> <td>@column.Attribute.Name</td>
<td> <td>
......
...@@ -155,12 +155,13 @@ WriteLiteral("</th>\r\n </tr>\r\n </th ...@@ -155,12 +155,13 @@ WriteLiteral("</th>\r\n </tr>\r\n </th
foreach (var subscriber in subscribers) foreach (var subscriber in subscribers)
{ {
var i = 0; var i = 0;
var rowCount = subscriber.Value.Count;
#line default #line default
#line hidden #line hidden
#line 41 "..\..\Dashboard\Pages\SubscriberPage.cshtml" #line 42 "..\..\Dashboard\Pages\SubscriberPage.cshtml"
foreach (var column in subscriber.Value) foreach (var column in subscriber.Value)
{ {
...@@ -171,7 +172,7 @@ WriteLiteral(" <tr>\r\n"); ...@@ -171,7 +172,7 @@ WriteLiteral(" <tr>\r\n");
#line 44 "..\..\Dashboard\Pages\SubscriberPage.cshtml" #line 45 "..\..\Dashboard\Pages\SubscriberPage.cshtml"
if (i == 0) if (i == 0)
{ {
...@@ -182,8 +183,8 @@ WriteLiteral(" <td rowspan=\""); ...@@ -182,8 +183,8 @@ WriteLiteral(" <td rowspan=\"");
#line 46 "..\..\Dashboard\Pages\SubscriberPage.cshtml" #line 47 "..\..\Dashboard\Pages\SubscriberPage.cshtml"
Write(subscriber.Value.Count); Write(rowCount);
#line default #line default
...@@ -192,7 +193,7 @@ WriteLiteral("\">"); ...@@ -192,7 +193,7 @@ WriteLiteral("\">");
#line 46 "..\..\Dashboard\Pages\SubscriberPage.cshtml" #line 47 "..\..\Dashboard\Pages\SubscriberPage.cshtml"
Write(subscriber.Key); Write(subscriber.Key);
...@@ -202,7 +203,7 @@ WriteLiteral("</td>\r\n"); ...@@ -202,7 +203,7 @@ WriteLiteral("</td>\r\n");
#line 47 "..\..\Dashboard\Pages\SubscriberPage.cshtml" #line 48 "..\..\Dashboard\Pages\SubscriberPage.cshtml"
} }
...@@ -212,7 +213,7 @@ WriteLiteral(" <td>"); ...@@ -212,7 +213,7 @@ WriteLiteral(" <td>");
#line 48 "..\..\Dashboard\Pages\SubscriberPage.cshtml" #line 49 "..\..\Dashboard\Pages\SubscriberPage.cshtml"
Write(column.Attribute.Name); Write(column.Attribute.Name);
...@@ -223,7 +224,7 @@ WriteLiteral("</td>\r\n <td>\r\n ...@@ -223,7 +224,7 @@ WriteLiteral("</td>\r\n <td>\r\n
#line 50 "..\..\Dashboard\Pages\SubscriberPage.cshtml" #line 51 "..\..\Dashboard\Pages\SubscriberPage.cshtml"
Write(column.ImplTypeInfo.Name); Write(column.ImplTypeInfo.Name);
...@@ -235,7 +236,7 @@ WriteLiteral("</span>:\r\n <div class=\ ...@@ -235,7 +236,7 @@ WriteLiteral("</span>:\r\n <div class=\
#line 53 "..\..\Dashboard\Pages\SubscriberPage.cshtml" #line 54 "..\..\Dashboard\Pages\SubscriberPage.cshtml"
Write(Html.MethodEscaped(column.MethodInfo)); Write(Html.MethodEscaped(column.MethodInfo));
...@@ -248,7 +249,7 @@ WriteLiteral("</pre>\r\n </code>\r\n ...@@ -248,7 +249,7 @@ WriteLiteral("</pre>\r\n </code>\r\n
#line 58 "..\..\Dashboard\Pages\SubscriberPage.cshtml" #line 59 "..\..\Dashboard\Pages\SubscriberPage.cshtml"
i++; i++;
} }
} }
...@@ -260,7 +261,7 @@ WriteLiteral(" </tbody>\r\n </table>\r\n ...@@ -260,7 +261,7 @@ WriteLiteral(" </tbody>\r\n </table>\r\n
#line 64 "..\..\Dashboard\Pages\SubscriberPage.cshtml" #line 65 "..\..\Dashboard\Pages\SubscriberPage.cshtml"
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment