Commit 07427f7f authored by yangxiaodong's avatar yangxiaodong

node discovery

parent c63dc682
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
using DotNetCore.CAP.Dashboard; using DotNetCore.CAP.Dashboard;
using DotNetCore.CAP.NodeDiscovery;
namespace DotNetCore.CAP namespace DotNetCore.CAP
{ {
...@@ -19,6 +20,8 @@ namespace DotNetCore.CAP ...@@ -19,6 +20,8 @@ namespace DotNetCore.CAP
/// </summary> /// </summary>
public string AppPath { get; set; } public string AppPath { get; set; }
public NodeConfiguration Discovery { get; set; }
public IEnumerable<IDashboardAuthorizationFilter> Authorization { get; set; } public IEnumerable<IDashboardAuthorizationFilter> Authorization { get; set; }
/// <summary> /// <summary>
......
...@@ -5,6 +5,7 @@ using System.Text; ...@@ -5,6 +5,7 @@ using System.Text;
namespace DotNetCore.CAP namespace DotNetCore.CAP
{ {
using DotNetCore.CAP.Dashboard; using DotNetCore.CAP.Dashboard;
using DotNetCore.CAP.NodeDiscovery;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
internal sealed class DashboardOptionsExtension : ICapOptionsExtension internal sealed class DashboardOptionsExtension : ICapOptionsExtension
...@@ -20,8 +21,10 @@ namespace DotNetCore.CAP ...@@ -20,8 +21,10 @@ namespace DotNetCore.CAP
{ {
var dashboardOptions = new DashboardOptions(); var dashboardOptions = new DashboardOptions();
_options?.Invoke(dashboardOptions); _options?.Invoke(dashboardOptions);
services.AddSingleton(dashboardOptions); services.AddSingleton(dashboardOptions);
services.AddSingleton(DashboardRoutes.Routes); services.AddSingleton(DashboardRoutes.Routes);
services.AddSingleton<IDiscoveryProviderFactory, DiscoveryProviderFactory>();
services.AddSingleton<IProcessingServer, ConsulProcessingNodeServer>();
} }
} }
} }
......
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
<EmbeddedResource Include="Dashboard\Content\js\rickshaw.min.js" /> <EmbeddedResource Include="Dashboard\Content\js\rickshaw.min.js" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Consul" Version="0.7.2.3" />
<PackageReference Include="Microsoft.AspNetCore.Hosting.Abstractions" Version="2.0.0" /> <PackageReference Include="Microsoft.AspNetCore.Hosting.Abstractions" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.0.0" /> <PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="2.0.0" /> <PackageReference Include="Microsoft.Extensions.Options" Version="2.0.0" />
...@@ -126,6 +127,9 @@ ...@@ -126,6 +127,9 @@
<Compile Update="Dashboard\Pages\SubscriberPage.generated.cs"> <Compile Update="Dashboard\Pages\SubscriberPage.generated.cs">
<DependentUpon>SubscriberPage.cshtml</DependentUpon> <DependentUpon>SubscriberPage.cshtml</DependentUpon>
</Compile> </Compile>
<Compile Update="Dashboard\Pages\NodePage*.cs">
<DependentUpon>NodePage.cshtml</DependentUpon>
</Compile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<EmbeddedResource Update="Dashboard\Content\resx\Strings.resx"> <EmbeddedResource Update="Dashboard\Content\resx\Strings.resx">
...@@ -139,4 +143,7 @@ ...@@ -139,4 +143,7 @@
<Generator>RazorGenerator</Generator> <Generator>RazorGenerator</Generator>
</None> </None>
</ItemGroup> </ItemGroup>
<ItemGroup>
<Folder Include="Dashboard\Consul\" />
</ItemGroup>
</Project> </Project>
\ No newline at end of file
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