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.net;
|
||||
using ln.http;
|
||||
using ln.http.router;
|
||||
using ln.manage.http;
|
||||
|
||||
namespace ln.provider
|
||||
{
|
||||
|
@ -27,15 +29,28 @@ namespace ln.provider
|
|||
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
SimpleHttpRouter restRouter = new SimpleHttpRouter();
|
||||
restRouter.AddSimpleRoute("/:arg1/:arg2", new RouterTarget(LogRequest));
|
||||
//StaticRouter staticRouter = new StaticRouter("www");
|
||||
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();
|
||||
simpleHttpRouter.AddSimpleRoute("/*", new RouterTarget(LogRequest));
|
||||
simpleHttpRouter.AddSimpleRoute("/api/v1/*", restRouter);
|
||||
SimpleRouter simpleHttpRouter = new SimpleRouter();
|
||||
simpleHttpRouter.AddSimpleRoute("/*", staticRouter);
|
||||
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();
|
||||
|
||||
//new ProviderApplication().Start(args);
|
||||
|
@ -46,6 +61,9 @@ namespace ln.provider
|
|||
ManagedNativeContainer<Layer2Segment> layer2segments = new ManagedNativeContainer<Layer2Segment>(managedRoot);
|
||||
ManagedNativeContainer<NetworkDevice> networkDevices = new ManagedNativeContainer<NetworkDevice>(managedRoot);
|
||||
|
||||
ContainerRouter restRouter = new ContainerRouter(managedRoot);
|
||||
simpleHttpRouter.AddSimpleRoute("/api/v1/*", restRouter);
|
||||
|
||||
IManagedObject nd0 = networkDevices.CreateManagedObject();
|
||||
nd0.Enabled = true;
|
||||
IManagedObject nd1 = networkDevices.CreateManagedObject();
|
||||
|
|
|
@ -78,20 +78,37 @@
|
|||
<Project>{D4E4FD39-6C21-4FCC-8DE0-6494FBE82CEA}</Project>
|
||||
<Name>ln.manage</Name>
|
||||
</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>
|
||||
<Folder Include="www\" />
|
||||
<Folder Include="www\css\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="www\index.html">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="www\style.css" />
|
||||
<None Include="www\ln.provider.js" />
|
||||
<None Include="www\page.layout.css" />
|
||||
<None Include="www\ln.provider.pool.js" />
|
||||
<None Include="www\ln.provider.pool.html" />
|
||||
<None Include="www\ln.provider.components.js" />
|
||||
<None Include="www\ln.provider.js">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="www\ln.provider.pool.js">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</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>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
|
@ -25,6 +25,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ln.provider.netwatch", "..\
|
|||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ln.manage", "..\ln.manage\ln.manage.csproj", "{D4E4FD39-6C21-4FCC-8DE0-6494FBE82CEA}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ln.manage.http", "..\ln.manage.http\ln.manage.http.csproj", "{90B8D805-E60A-4986-ADAA-1753BE248EB1}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
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}.Release|x86.ActiveCfg = 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
|
||||
EndGlobal
|
||||
|
|
|
@ -4,19 +4,14 @@
|
|||
<meta charset="utf-8" />
|
||||
<title>ln.provider Web Interface</title>
|
||||
|
||||
<link href="/css/ln.vue.css"/>
|
||||
<link href="/style.css" rel="stylesheet" />
|
||||
<link href="/page.layout.css" rel="stylesheet" />
|
||||
<link href="/tables.layout.css" rel="stylesheet" />
|
||||
<link href="/css/ln.vue.css" rel="stylesheet" />
|
||||
<link href="/css/style.css" rel="stylesheet" />
|
||||
<link href="/css/page.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-router.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>
|
||||
<script type="text/javascript" src="/js/ln.vue.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="body">
|
||||
|
@ -27,12 +22,17 @@
|
|||
<ln-identity></ln-identity>
|
||||
</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">
|
||||
<router-view
|
||||
v-bind="{ LNP: LNP }"
|
||||
></router-view>
|
||||
<router-view></router-view>
|
||||
</section>
|
||||
|
||||
<section id="footer" class="flex row">
|
||||
|
@ -40,8 +40,14 @@
|
|||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var LNP = new LNVue();
|
||||
LNP.Start();
|
||||
LN
|
||||
.$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>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Reference in New Issue