Browse Source

node discovery

master
yangxiaodong 7 years ago
parent
commit
07427f7f78
3 changed files with 14 additions and 1 deletions
  1. +3
    -0
      src/DotNetCore.CAP/CAP.DashboardOptions.cs
  2. +4
    -1
      src/DotNetCore.CAP/CAP.DashboardOptionsExtensions.cs
  3. +7
    -0
      src/DotNetCore.CAP/DotNetCore.CAP.csproj

+ 3
- 0
src/DotNetCore.CAP/CAP.DashboardOptions.cs View File

@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Text;
using DotNetCore.CAP.Dashboard;
using DotNetCore.CAP.NodeDiscovery;

namespace DotNetCore.CAP
{
@@ -19,6 +20,8 @@ namespace DotNetCore.CAP
/// </summary>
public string AppPath { get; set; }

public NodeConfiguration Discovery { get; set; }

public IEnumerable<IDashboardAuthorizationFilter> Authorization { get; set; }

/// <summary>


+ 4
- 1
src/DotNetCore.CAP/CAP.DashboardOptionsExtensions.cs View File

@@ -5,6 +5,7 @@ using System.Text;
namespace DotNetCore.CAP
{
using DotNetCore.CAP.Dashboard;
using DotNetCore.CAP.NodeDiscovery;
using Microsoft.Extensions.DependencyInjection;

internal sealed class DashboardOptionsExtension : ICapOptionsExtension
@@ -20,8 +21,10 @@ namespace DotNetCore.CAP
{
var dashboardOptions = new DashboardOptions();
_options?.Invoke(dashboardOptions);
services.AddSingleton(dashboardOptions);
services.AddSingleton(dashboardOptions);
services.AddSingleton(DashboardRoutes.Routes);
services.AddSingleton<IDiscoveryProviderFactory, DiscoveryProviderFactory>();
services.AddSingleton<IProcessingServer, ConsulProcessingNodeServer>();
}
}
}


+ 7
- 0
src/DotNetCore.CAP/DotNetCore.CAP.csproj View File

@@ -44,6 +44,7 @@
<EmbeddedResource Include="Dashboard\Content\js\rickshaw.min.js" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Consul" Version="0.7.2.3" />
<PackageReference Include="Microsoft.AspNetCore.Hosting.Abstractions" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="2.0.0" />
@@ -126,6 +127,9 @@
<Compile Update="Dashboard\Pages\SubscriberPage.generated.cs">
<DependentUpon>SubscriberPage.cshtml</DependentUpon>
</Compile>
<Compile Update="Dashboard\Pages\NodePage*.cs">
<DependentUpon>NodePage.cshtml</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Dashboard\Content\resx\Strings.resx">
@@ -139,4 +143,7 @@
<Generator>RazorGenerator</Generator>
</None>
</ItemGroup>
<ItemGroup>
<Folder Include="Dashboard\Consul\" />
</ItemGroup>
</Project>

Loading…
Cancel
Save