Przeglądaj źródła

modify node and subscriber pages

master
yangxiaodong 7 lat temu
rodzic
commit
ab48d3a992
5 zmienionych plików z 55 dodań i 28 usunięć
  1. +4
    -5
      src/DotNetCore.CAP/Dashboard/Pages/NodePage.cs
  2. +4
    -2
      src/DotNetCore.CAP/Dashboard/Pages/NodePage.cshtml
  3. +32
    -8
      src/DotNetCore.CAP/Dashboard/Pages/NodePage1.generated.cs
  4. +2
    -1
      src/DotNetCore.CAP/Dashboard/Pages/SubscriberPage.cshtml
  5. +13
    -12
      src/DotNetCore.CAP/Dashboard/Pages/SubscriberPage.generated.cs

+ 4
- 5
src/DotNetCore.CAP/Dashboard/Pages/NodePage.cs Wyświetl plik

@@ -15,13 +15,12 @@ namespace DotNetCore.CAP.Dashboard.Pages
{ {
if (_nodes == null) 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 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;


+ 4
- 2
src/DotNetCore.CAP/Dashboard/Pages/NodePage.cshtml Wyświetl plik

@@ -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 @@
<tr> <tr>
<td>@node.Name</td> <td>@node.Name</td>
<td>@node.Address</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> </tr>
} }
</tbody> </tbody>


src/DotNetCore.CAP/Dashboard/Pages/NodePage.generated.cs → src/DotNetCore.CAP/Dashboard/Pages/NodePage1.generated.cs Wyświetl plik

@@ -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=""50%"">IP地址</th>
<th width=""20%"">节点名称</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"">




#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




#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>");




#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




#line 40 "..\..\Dashboard\Pages\NodePage.cshtml"
#line 46 "..\..\Dashboard\Pages\NodePage.cshtml"
} }



+ 2
- 1
src/DotNetCore.CAP/Dashboard/Pages/SubscriberPage.cshtml Wyświetl plik

@@ -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>


+ 13
- 12
src/DotNetCore.CAP/Dashboard/Pages/SubscriberPage.generated.cs Wyświetl plik

@@ -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");




#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=\"");




#line 46 "..\..\Dashboard\Pages\SubscriberPage.cshtml"
Write(subscriber.Value.Count);
#line 47 "..\..\Dashboard\Pages\SubscriberPage.cshtml"
Write(rowCount);


#line default #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 #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); 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); 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)); 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++; i++;
} }
} }
@@ -260,7 +261,7 @@ WriteLiteral(" </tbody>\r\n </table>\r\n




#line 64 "..\..\Dashboard\Pages\SubscriberPage.cshtml"
#line 65 "..\..\Dashboard\Pages\SubscriberPage.cshtml"
} }




Ładowanie…
Anuluj
Zapisz