WIP
parent
4390953eb2
commit
ea9ace5928
30
Program.cs
30
Program.cs
|
@ -9,6 +9,8 @@ using System.Threading;
|
||||||
using ln.types.threads;
|
using ln.types.threads;
|
||||||
using ln.types.net;
|
using ln.types.net;
|
||||||
using ln.http;
|
using ln.http;
|
||||||
|
using ln.http.router;
|
||||||
|
using ln.manage.http;
|
||||||
|
|
||||||
namespace ln.provider
|
namespace ln.provider
|
||||||
{
|
{
|
||||||
|
@ -27,15 +29,28 @@ namespace ln.provider
|
||||||
|
|
||||||
public static void Main(string[] args)
|
public static void Main(string[] args)
|
||||||
{
|
{
|
||||||
SimpleHttpRouter restRouter = new SimpleHttpRouter();
|
//StaticRouter staticRouter = new StaticRouter("www");
|
||||||
restRouter.AddSimpleRoute("/:arg1/:arg2", new RouterTarget(LogRequest));
|
StaticRouter staticRouter = new StaticRouter("../../www");
|
||||||
|
StaticRouter manageRouter = new StaticRouter("../../../ln.manage/www");
|
||||||
|
StaticRouter vueRouter = new StaticRouter("/home/haraldwolff/src/www/ln.vue");
|
||||||
|
|
||||||
SimpleHttpRouter simpleHttpRouter = new SimpleHttpRouter();
|
SimpleRouter simpleHttpRouter = new SimpleRouter();
|
||||||
simpleHttpRouter.AddSimpleRoute("/*", new RouterTarget(LogRequest));
|
simpleHttpRouter.AddSimpleRoute("/*", staticRouter);
|
||||||
simpleHttpRouter.AddSimpleRoute("/api/v1/*", restRouter);
|
simpleHttpRouter.AddSimpleRoute("/*", vueRouter, 10);
|
||||||
|
simpleHttpRouter.AddSimpleRoute("/*", manageRouter, 9);
|
||||||
|
simpleHttpRouter.AddSimpleRoute("/*", new RouterTarget((request) =>
|
||||||
|
{
|
||||||
|
return staticRouter.Route("/", request);
|
||||||
|
//HttpResponse response = new HttpResponse(request);
|
||||||
|
//response.StatusCode = 404;
|
||||||
|
//response.SetHeader("content-type", "text/plain");
|
||||||
|
//response.ContentWriter.WriteLine("404 Not Found");
|
||||||
|
//response.ContentWriter.Flush();
|
||||||
|
//return response;
|
||||||
|
}), -1);
|
||||||
|
|
||||||
|
|
||||||
HTTPServer hTTPServer = new HTTPServer(new Endpoint(IPv6.ANY,8888),simpleHttpRouter);
|
HTTPServer hTTPServer = new HTTPServer(new Endpoint(IPv6.ANY,8888),new LoggingRouter(simpleHttpRouter));
|
||||||
hTTPServer.Start();
|
hTTPServer.Start();
|
||||||
|
|
||||||
//new ProviderApplication().Start(args);
|
//new ProviderApplication().Start(args);
|
||||||
|
@ -46,6 +61,9 @@ namespace ln.provider
|
||||||
ManagedNativeContainer<Layer2Segment> layer2segments = new ManagedNativeContainer<Layer2Segment>(managedRoot);
|
ManagedNativeContainer<Layer2Segment> layer2segments = new ManagedNativeContainer<Layer2Segment>(managedRoot);
|
||||||
ManagedNativeContainer<NetworkDevice> networkDevices = new ManagedNativeContainer<NetworkDevice>(managedRoot);
|
ManagedNativeContainer<NetworkDevice> networkDevices = new ManagedNativeContainer<NetworkDevice>(managedRoot);
|
||||||
|
|
||||||
|
ContainerRouter restRouter = new ContainerRouter(managedRoot);
|
||||||
|
simpleHttpRouter.AddSimpleRoute("/api/v1/*", restRouter);
|
||||||
|
|
||||||
IManagedObject nd0 = networkDevices.CreateManagedObject();
|
IManagedObject nd0 = networkDevices.CreateManagedObject();
|
||||||
nd0.Enabled = true;
|
nd0.Enabled = true;
|
||||||
IManagedObject nd1 = networkDevices.CreateManagedObject();
|
IManagedObject nd1 = networkDevices.CreateManagedObject();
|
||||||
|
|
|
@ -78,20 +78,37 @@
|
||||||
<Project>{D4E4FD39-6C21-4FCC-8DE0-6494FBE82CEA}</Project>
|
<Project>{D4E4FD39-6C21-4FCC-8DE0-6494FBE82CEA}</Project>
|
||||||
<Name>ln.manage</Name>
|
<Name>ln.manage</Name>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\ln.manage.http\ln.manage.http.csproj">
|
||||||
|
<Project>{90B8D805-E60A-4986-ADAA-1753BE248EB1}</Project>
|
||||||
|
<Name>ln.manage.http</Name>
|
||||||
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Folder Include="www\" />
|
<Folder Include="www\" />
|
||||||
|
<Folder Include="www\css\" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="www\index.html">
|
<None Include="www\index.html">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
<None Include="www\style.css" />
|
<None Include="www\ln.provider.js">
|
||||||
<None Include="www\ln.provider.js" />
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
<None Include="www\page.layout.css" />
|
</None>
|
||||||
<None Include="www\ln.provider.pool.js" />
|
<None Include="www\ln.provider.pool.js">
|
||||||
<None Include="www\ln.provider.pool.html" />
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
<None Include="www\ln.provider.components.js" />
|
</None>
|
||||||
|
<None Include="www\ln.provider.pool.html">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
|
<None Include="www\ln.provider.components.js">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
|
<None Include="www\css\style.css">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
|
<None Include="www\css\page.layout.css">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||||
</Project>
|
</Project>
|
|
@ -25,6 +25,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ln.provider.netwatch", "..\
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ln.manage", "..\ln.manage\ln.manage.csproj", "{D4E4FD39-6C21-4FCC-8DE0-6494FBE82CEA}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ln.manage", "..\ln.manage\ln.manage.csproj", "{D4E4FD39-6C21-4FCC-8DE0-6494FBE82CEA}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ln.manage.http", "..\ln.manage.http\ln.manage.http.csproj", "{90B8D805-E60A-4986-ADAA-1753BE248EB1}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|x86 = Debug|x86
|
Debug|x86 = Debug|x86
|
||||||
|
@ -79,5 +81,9 @@ Global
|
||||||
{D4E4FD39-6C21-4FCC-8DE0-6494FBE82CEA}.Debug|x86.Build.0 = Debug|Any CPU
|
{D4E4FD39-6C21-4FCC-8DE0-6494FBE82CEA}.Debug|x86.Build.0 = Debug|Any CPU
|
||||||
{D4E4FD39-6C21-4FCC-8DE0-6494FBE82CEA}.Release|x86.ActiveCfg = Release|Any CPU
|
{D4E4FD39-6C21-4FCC-8DE0-6494FBE82CEA}.Release|x86.ActiveCfg = Release|Any CPU
|
||||||
{D4E4FD39-6C21-4FCC-8DE0-6494FBE82CEA}.Release|x86.Build.0 = Release|Any CPU
|
{D4E4FD39-6C21-4FCC-8DE0-6494FBE82CEA}.Release|x86.Build.0 = Release|Any CPU
|
||||||
|
{90B8D805-E60A-4986-ADAA-1753BE248EB1}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||||
|
{90B8D805-E60A-4986-ADAA-1753BE248EB1}.Debug|x86.Build.0 = Debug|Any CPU
|
||||||
|
{90B8D805-E60A-4986-ADAA-1753BE248EB1}.Release|x86.ActiveCfg = Release|Any CPU
|
||||||
|
{90B8D805-E60A-4986-ADAA-1753BE248EB1}.Release|x86.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
EndGlobal
|
EndGlobal
|
||||||
|
|
|
@ -4,19 +4,14 @@
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<title>ln.provider Web Interface</title>
|
<title>ln.provider Web Interface</title>
|
||||||
|
|
||||||
<link href="/css/ln.vue.css"/>
|
<link href="/css/ln.vue.css" rel="stylesheet" />
|
||||||
<link href="/style.css" rel="stylesheet" />
|
<link href="/css/style.css" rel="stylesheet" />
|
||||||
<link href="/page.layout.css" rel="stylesheet" />
|
<link href="/css/page.layout.css" rel="stylesheet" />
|
||||||
<link href="/tables.layout.css" rel="stylesheet" />
|
<link href="/css/tables.layout.css" rel="stylesheet" />
|
||||||
|
|
||||||
<script type="text/javascript" src="/js/vue.js"></script>
|
<script type="text/javascript" src="/js/vue.js"></script>
|
||||||
<script type="text/javascript" src="/js/vue-router.js"></script>
|
<script type="text/javascript" src="/js/vue-router.js"></script>
|
||||||
<script type="text/javascript" src="/js/ln.vue.js"></script>
|
<script type="text/javascript" src="/js/ln.vue.js"></script>
|
||||||
<script type="text/javascript" src="/js/ln.vue.components.js"></script>
|
|
||||||
|
|
||||||
<script type="text/javascript" src="/ln.provider.components.js"></script>
|
|
||||||
<script type="text/javascript" src="/ln.provider.js"></script>
|
|
||||||
<script type="text/javascript" src="/ln.provider.pool.js"></script>
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="body">
|
<div id="body">
|
||||||
|
@ -27,12 +22,17 @@
|
||||||
<ln-identity></ln-identity>
|
<ln-identity></ln-identity>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<ln-navbar></ln-navbar>
|
<section id="modselection">
|
||||||
|
<div
|
||||||
|
v-for="component in LNVue.components"
|
||||||
|
>
|
||||||
|
<router-link :to="component.basepath">{{ component.label }}</router-link>
|
||||||
|
</div
|
||||||
|
>
|
||||||
|
</section>
|
||||||
|
|
||||||
<section id="page">
|
<section id="page">
|
||||||
<router-view
|
<router-view></router-view>
|
||||||
v-bind="{ LNP: LNP }"
|
|
||||||
></router-view>
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section id="footer" class="flex row">
|
<section id="footer" class="flex row">
|
||||||
|
@ -40,8 +40,14 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var LNP = new LNVue();
|
LN
|
||||||
LNP.Start();
|
.$import("ln.vue.components","ln.identities","ln.vue.table","ln.manage")
|
||||||
|
.then(()=>{
|
||||||
|
let app = new LN.Vue('#body');
|
||||||
|
app.addComponent(new LN.Manager());
|
||||||
|
app.Start();
|
||||||
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in New Issue