@@ -15,13 +15,12 @@ namespace DotNetCore.CAP.Dashboard.Pages | |||
{ | |||
if (_nodes == null) | |||
{ | |||
var configOptions = RequestServices.GetService<DashboardOptions>(); | |||
var discoveryServer = configOptions.Discovery; | |||
if (discoveryServer == null) | |||
return null; | |||
var configOptions = RequestServices.GetService<DiscoveryOptions>(); | |||
var factory = RequestServices.GetService<IDiscoveryProviderFactory>(); | |||
var discoryProvider = factory.Get(discoveryServer); | |||
var discoryProvider = factory.Create(configOptions); | |||
_nodes = discoryProvider.GetNodes().GetAwaiter().GetResult(); | |||
} | |||
return _nodes; | |||
@@ -24,6 +24,7 @@ | |||
<tr> | |||
<th width="20%">节点名称</th> | |||
<th width="20%">IP地址</th> | |||
<th width="7%">端口号</th> | |||
<th>Tags</th> | |||
<th width="20%">操作</th> | |||
</tr> | |||
@@ -34,8 +35,9 @@ | |||
<tr> | |||
<td>@node.Name</td> | |||
<td>@node.Address</td> | |||
<td><a class="btn">切换到</a></td> | |||
<td>@node.Port</td> | |||
<td>@node.Tags</td> | |||
<td><a href="javascript:;" class="btn-link">切换到</a></td> | |||
</tr> | |||
} | |||
</tbody> | |||
@@ -106,8 +106,11 @@ WriteLiteral(@" <div class=""table-responsive""> | |||
<table class=""table""> | |||
<thead> | |||
<tr> | |||
<th width=""50%"">节点名称</th> | |||
<th width=""50%"">IP地址</th> | |||
<th width=""20%"">节点名称</th> | |||
<th width=""20%"">IP地址</th> | |||
<th width=""7%"">端口号</th> | |||
<th>Tags</th> | |||
<th width=""20%"">操作</th> | |||
</tr> | |||
</thead> | |||
<tbody> | |||
@@ -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) | |||
{ | |||
@@ -126,7 +129,7 @@ WriteLiteral(" <tr>\r\n | |||
#line 33 "..\..\Dashboard\Pages\NodePage.cshtml" | |||
#line 36 "..\..\Dashboard\Pages\NodePage.cshtml" | |||
Write(node.Name); | |||
@@ -136,17 +139,38 @@ WriteLiteral("</td>\r\n <td>"); | |||
#line 34 "..\..\Dashboard\Pages\NodePage.cshtml" | |||
#line 37 "..\..\Dashboard\Pages\NodePage.cshtml" | |||
Write(node.Address); | |||
#line default | |||
#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 | |||
#line 40 "..\..\Dashboard\Pages\NodePage.cshtml" | |||
#line 46 "..\..\Dashboard\Pages\NodePage.cshtml" | |||
} | |||
@@ -38,12 +38,13 @@ | |||
@foreach (var subscriber in subscribers) | |||
{ | |||
var i = 0; | |||
var rowCount = subscriber.Value.Count; | |||
@foreach (var column in subscriber.Value) | |||
{ | |||
<tr> | |||
@if (i == 0) | |||
{ | |||
<td rowspan="@subscriber.Value.Count">@subscriber.Key</td> | |||
<td rowspan="@rowCount">@subscriber.Key</td> | |||
} | |||
<td>@column.Attribute.Name</td> | |||
<td> | |||
@@ -155,12 +155,13 @@ WriteLiteral("</th>\r\n </tr>\r\n </th | |||
foreach (var subscriber in subscribers) | |||
{ | |||
var i = 0; | |||
var rowCount = subscriber.Value.Count; | |||
#line default | |||
#line hidden | |||
#line 41 "..\..\Dashboard\Pages\SubscriberPage.cshtml" | |||
#line 42 "..\..\Dashboard\Pages\SubscriberPage.cshtml" | |||
foreach (var column in subscriber.Value) | |||
{ | |||
@@ -171,7 +172,7 @@ WriteLiteral(" <tr>\r\n"); | |||
#line 44 "..\..\Dashboard\Pages\SubscriberPage.cshtml" | |||
#line 45 "..\..\Dashboard\Pages\SubscriberPage.cshtml" | |||
if (i == 0) | |||
{ | |||
@@ -182,8 +183,8 @@ WriteLiteral(" <td rowspan=\""); | |||
#line 46 "..\..\Dashboard\Pages\SubscriberPage.cshtml" | |||
Write(subscriber.Value.Count); | |||
#line 47 "..\..\Dashboard\Pages\SubscriberPage.cshtml" | |||
Write(rowCount); | |||
#line default | |||
@@ -192,8 +193,8 @@ WriteLiteral("\">"); | |||
#line 46 "..\..\Dashboard\Pages\SubscriberPage.cshtml" | |||
Write(subscriber.Key); | |||
#line 47 "..\..\Dashboard\Pages\SubscriberPage.cshtml" | |||
Write(subscriber.Key); | |||
#line default | |||
@@ -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>"); | |||
#line 48 "..\..\Dashboard\Pages\SubscriberPage.cshtml" | |||
#line 49 "..\..\Dashboard\Pages\SubscriberPage.cshtml" | |||
Write(column.Attribute.Name); | |||
@@ -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); | |||
@@ -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)); | |||
@@ -248,7 +249,7 @@ WriteLiteral("</pre>\r\n </code>\r\n | |||
#line 58 "..\..\Dashboard\Pages\SubscriberPage.cshtml" | |||
#line 59 "..\..\Dashboard\Pages\SubscriberPage.cshtml" | |||
i++; | |||
} | |||
} | |||
@@ -260,7 +261,7 @@ WriteLiteral(" </tbody>\r\n </table>\r\n | |||
#line 64 "..\..\Dashboard\Pages\SubscriberPage.cshtml" | |||
#line 65 "..\..\Dashboard\Pages\SubscriberPage.cshtml" | |||
} | |||