Browse Source

add routes.

master
yangxiaodong 7 years ago
parent
commit
695777c823
2 changed files with 17 additions and 1 deletions
  1. +13
    -1
      src/DotNetCore.CAP/Dashboard/RouteCollectionExtensions.cs
  2. +4
    -0
      src/DotNetCore.CAP/DotNetCore.CAP.csproj

+ 13
- 1
src/DotNetCore.CAP/Dashboard/RouteCollectionExtensions.cs View File

@@ -29,7 +29,19 @@ namespace DotNetCore.CAP.Dashboard
routes.Add(pathTemplate, new CommandDispatcher(command));
}

public static void AddBatchCommand(
public static void AddJsonResult(
this RouteCollection routes,
string pathTemplate,
Func<DashboardContext, object> func)
{
if (routes == null) throw new ArgumentNullException(nameof(routes));
if (pathTemplate == null) throw new ArgumentNullException(nameof(pathTemplate));
if (func == null) throw new ArgumentNullException(nameof(func));

routes.Add(pathTemplate, new JsonDispatcher(func));
}

public static void AddPublishBatchCommand(
this RouteCollection routes,
string pathTemplate,
Action<DashboardContext, string> command)


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

@@ -10,6 +10,7 @@
<ItemGroup>
<None Remove="Dashboard\Content\css\bootstrap.min.css" />
<None Remove="Dashboard\Content\css\jsonview.min.css" />
<None Remove="Dashboard\Content\css\rickshaw.min.css" />
<None Remove="Dashboard\Content\fonts\glyphicons-halflings-regular.eot" />
<None Remove="Dashboard\Content\fonts\glyphicons-halflings-regular.svg" />
@@ -20,6 +21,7 @@
<None Remove="Dashboard\Content\js\d3.layout.min.js" />
<None Remove="Dashboard\Content\js\d3.min.js" />
<None Remove="Dashboard\Content\js\jquery-2.1.4.min.js" />
<None Remove="Dashboard\Content\js\jsonview.min.js" />
<None Remove="Dashboard\Content\js\moment-with-locales.min.js" />
<None Remove="Dashboard\Content\js\moment.min.js" />
<None Remove="Dashboard\Content\js\rickshaw.min.js" />
@@ -28,6 +30,7 @@
<ItemGroup>
<EmbeddedResource Include="Dashboard\Content\css\bootstrap.min.css" />
<EmbeddedResource Include="Dashboard\Content\css\cap.css" />
<EmbeddedResource Include="Dashboard\Content\css\jsonview.min.css" />
<EmbeddedResource Include="Dashboard\Content\css\rickshaw.min.css" />
<EmbeddedResource Include="Dashboard\Content\fonts\glyphicons-halflings-regular.eot" />
<EmbeddedResource Include="Dashboard\Content\fonts\glyphicons-halflings-regular.svg" />
@@ -39,6 +42,7 @@
<EmbeddedResource Include="Dashboard\Content\js\d3.min.js" />
<EmbeddedResource Include="Dashboard\Content\js\cap.js" />
<EmbeddedResource Include="Dashboard\Content\js\jquery-2.1.4.min.js" />
<EmbeddedResource Include="Dashboard\Content\js\jsonview.min.js" />
<EmbeddedResource Include="Dashboard\Content\js\moment-with-locales.min.js" />
<EmbeddedResource Include="Dashboard\Content\js\moment.min.js" />
<EmbeddedResource Include="Dashboard\Content\js\rickshaw.min.js" />


Loading…
Cancel
Save