master
Harald Wolff 2019-04-24 12:55:33 +02:00
parent e8bdb4fb0b
commit 8ac23dc688
76 changed files with 16959 additions and 22442 deletions

41
.gitignore vendored 100644
View File

@ -0,0 +1,41 @@
# Autosave files
*~
# build
[Oo]bj/
[Bb]in/
packages/
TestResults/
# globs
Makefile.in
*.DS_Store
*.sln.cache
*.suo
*.cache
*.pidb
*.userprefs
*.usertasks
config.log
config.make
config.status
aclocal.m4
install-sh
autom4te.cache/
*.user
*.tar.gz
tarballs/
test-results/
Thumbs.db
.vs/
# Mac bundle stuff
*.dmg
*.app
# resharper
*_Resharper.*
*.Resharper
# dotCover
*.dotCover

View File

@ -27,28 +27,28 @@ namespace skyspot
public static void Main(string[] args)
{
DHCPServer dhcpServer = new DHCPServer();
dhcpServer.EnsureInterface(IPv4.Parse("10.118.200.2"));
dhcpServer.EnsurePool("default", IPv4.Parse("10.118.200.50"), IPv4.Parse("10.118.200.99"));
//dhcpServer.EnsureInterface(IPv4.Parse("10.118.200.2"));
//dhcpServer.EnsurePool("default", IPv4.Parse("10.118.200.50"), IPv4.Parse("10.118.200.99"));
foreach (DHCPServerInterface serverInterface in dhcpServer.Interfaces)
{
if (serverInterface.Pool == null)
{
serverInterface.Pool = dhcpServer.IPPools[0];
dhcpServer.Commit(serverInterface);
}
}
//foreach (DHCPServerInterface serverInterface in dhcpServer.Interfaces)
//{
// if (serverInterface.Pool == null)
// {
// serverInterface.Pool = dhcpServer.IPPools[0];
// dhcpServer.Commit(serverInterface);
// }
//}
dhcpServer.Start();
HTTPServer httpServer = new HTTPServer();
httpServer.AddEndpoint(new IPEndPoint(IPAddress.Any, 80));
ResourceApplication app = new ResourceApplication();
ResourceApplication app = new SkySpotApplication();
httpServer.DefaultApplication = app;
DHCP httpDHCP = new DHCP(app.RootResource, dhcpServer);
DHCP httpDHCP = new DHCP(null,dhcpServer);
(app.RootResource as DirectoryResource).InjectResource(httpDHCP);
httpServer.Start();

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -9,12 +9,38 @@
// **/
using System;
using ln.http.resources;
using System.IO;
namespace skyspot.http
{
public class SkySpotApplication : ResourceApplication
{
public String TemplatePath { get; private set; }
public SkySpotApplication()
:this(Path.Combine(Environment.CurrentDirectory,"www"))
{}
public SkySpotApplication(String templatePath)
{
/* Development Shortcut */
if (Directory.Exists("../../www"))
templatePath = "../../www";
TemplatePath = Path.GetFullPath(templatePath);
DirectoryResource templates = new DirectoryResource(TemplatePath);
templates.ResourceTypeHook = ResourceTypeHook;
RootResource = templates;
}
private Resource ResourceTypeHook(DirectoryResource directoryResource, FileInfo fileInfo)
{
if (fileInfo.Extension.Equals(".html"))
return new TemplateResource(directoryResource, fileInfo.FullName);
return null;
}
}
}

View File

@ -1 +0,0 @@
92af6795df16490c0afe36b1ed1e4fe0e770e10c

View File

@ -1,69 +0,0 @@
/home/haraldwolff/src/skyspot/skyspot/bin/Debug/skyspot.exe
/home/haraldwolff/src/skyspot/skyspot/bin/Debug/skyspot.pdb
/home/haraldwolff/src/skyspot/skyspot/bin/Debug/ln.http.dll
/home/haraldwolff/src/skyspot/skyspot/bin/Debug/ln.http.objects.dll
/home/haraldwolff/src/skyspot/skyspot/bin/Debug/ln.radius.dll
/home/haraldwolff/src/skyspot/skyspot/bin/Debug/ln.types.dll
/home/haraldwolff/src/skyspot/skyspot/bin/Debug/sharp.logging.dll
/home/haraldwolff/src/skyspot/skyspot/bin/Debug/ln.templates.dll
/home/haraldwolff/src/skyspot/skyspot/bin/Debug/Newtonsoft.Json.dll
/home/haraldwolff/src/skyspot/skyspot/bin/Debug/ln.http.pdb
/home/haraldwolff/src/skyspot/skyspot/bin/Debug/ln.http.objects.pdb
/home/haraldwolff/src/skyspot/skyspot/bin/Debug/sharp.logging.pdb
/home/haraldwolff/src/skyspot/skyspot/bin/Debug/ln.radius.pdb
/home/haraldwolff/src/skyspot/skyspot/bin/Debug/ln.types.pdb
/home/haraldwolff/src/skyspot/skyspot/bin/Debug/ln.templates.pdb
/home/haraldwolff/src/skyspot/skyspot/bin/Debug/Newtonsoft.Json.pdb
/home/haraldwolff/src/skyspot/skyspot/bin/Debug/Newtonsoft.Json.xml
/home/haraldwolff/src/skyspot/skyspot/obj/x86/Debug/skyspot.csprojAssemblyReference.cache
/home/haraldwolff/src/skyspot/skyspot/obj/x86/Debug/skyspot.csproj.CoreCompileInputs.cache
/home/haraldwolff/src/skyspot/skyspot/obj/x86/Debug/skyspot.csproj.CopyComplete
/home/haraldwolff/src/skyspot/skyspot/obj/x86/Debug/skyspot.exe
/home/haraldwolff/src/skyspot/skyspot/obj/x86/Debug/skyspot.pdb
/Volumes/HOMES/haraldwolff/src/skyspot/skyspot/bin/Debug/skyspot.exe
/Volumes/HOMES/haraldwolff/src/skyspot/skyspot/bin/Debug/skyspot.pdb
/Volumes/HOMES/haraldwolff/src/skyspot/skyspot/bin/Debug/ln.http.dll
/Volumes/HOMES/haraldwolff/src/skyspot/skyspot/bin/Debug/ln.http.objects.dll
/Volumes/HOMES/haraldwolff/src/skyspot/skyspot/bin/Debug/ln.radius.dll
/Volumes/HOMES/haraldwolff/src/skyspot/skyspot/bin/Debug/ln.types.dll
/Volumes/HOMES/haraldwolff/src/skyspot/skyspot/bin/Debug/sharp.logging.dll
/Volumes/HOMES/haraldwolff/src/skyspot/skyspot/bin/Debug/ln.templates.dll
/Volumes/HOMES/haraldwolff/src/skyspot/skyspot/bin/Debug/Newtonsoft.Json.dll
/Volumes/HOMES/haraldwolff/src/skyspot/skyspot/bin/Debug/ln.http.pdb
/Volumes/HOMES/haraldwolff/src/skyspot/skyspot/bin/Debug/ln.http.objects.pdb
/Volumes/HOMES/haraldwolff/src/skyspot/skyspot/bin/Debug/sharp.logging.pdb
/Volumes/HOMES/haraldwolff/src/skyspot/skyspot/bin/Debug/ln.radius.pdb
/Volumes/HOMES/haraldwolff/src/skyspot/skyspot/bin/Debug/ln.types.pdb
/Volumes/HOMES/haraldwolff/src/skyspot/skyspot/bin/Debug/ln.templates.pdb
/Volumes/HOMES/haraldwolff/src/skyspot/skyspot/bin/Debug/Newtonsoft.Json.pdb
/Volumes/HOMES/haraldwolff/src/skyspot/skyspot/bin/Debug/Newtonsoft.Json.xml
/Volumes/HOMES/haraldwolff/src/skyspot/skyspot/obj/x86/Debug/skyspot.csprojAssemblyReference.cache
/Volumes/HOMES/haraldwolff/src/skyspot/skyspot/obj/x86/Debug/skyspot.csproj.CoreCompileInputs.cache
/Volumes/HOMES/haraldwolff/src/skyspot/skyspot/obj/x86/Debug/skyspot.csproj.CopyComplete
/Volumes/HOMES/haraldwolff/src/skyspot/skyspot/obj/x86/Debug/skyspot.exe
/Volumes/HOMES/haraldwolff/src/skyspot/skyspot/obj/x86/Debug/skyspot.pdb
/Volumes/HOMES/haraldwolff/src/skyspot/skyspot/bin/Debug/ln.dhcp.dll
/Volumes/HOMES/haraldwolff/src/skyspot/skyspot/bin/Debug/ln.dhcp.pdb
/home/haraldwolff/src/ln.skyspot/ln.skyspot/bin/Debug/skyspot.exe
/home/haraldwolff/src/ln.skyspot/ln.skyspot/bin/Debug/skyspot.pdb
/home/haraldwolff/src/ln.skyspot/ln.skyspot/bin/Debug/ln.dhcp.dll
/home/haraldwolff/src/ln.skyspot/ln.skyspot/bin/Debug/ln.http.dll
/home/haraldwolff/src/ln.skyspot/ln.skyspot/bin/Debug/ln.http.objects.dll
/home/haraldwolff/src/ln.skyspot/ln.skyspot/bin/Debug/ln.radius.dll
/home/haraldwolff/src/ln.skyspot/ln.skyspot/bin/Debug/ln.types.dll
/home/haraldwolff/src/ln.skyspot/ln.skyspot/bin/Debug/Newtonsoft.Json.dll
/home/haraldwolff/src/ln.skyspot/ln.skyspot/bin/Debug/sharp.logging.dll
/home/haraldwolff/src/ln.skyspot/ln.skyspot/bin/Debug/ln.templates.dll
/home/haraldwolff/src/ln.skyspot/ln.skyspot/bin/Debug/ln.http.pdb
/home/haraldwolff/src/ln.skyspot/ln.skyspot/bin/Debug/ln.http.objects.pdb
/home/haraldwolff/src/ln.skyspot/ln.skyspot/bin/Debug/sharp.logging.pdb
/home/haraldwolff/src/ln.skyspot/ln.skyspot/bin/Debug/ln.radius.pdb
/home/haraldwolff/src/ln.skyspot/ln.skyspot/bin/Debug/ln.types.pdb
/home/haraldwolff/src/ln.skyspot/ln.skyspot/bin/Debug/ln.dhcp.pdb
/home/haraldwolff/src/ln.skyspot/ln.skyspot/bin/Debug/Newtonsoft.Json.xml
/home/haraldwolff/src/ln.skyspot/ln.skyspot/bin/Debug/ln.templates.pdb
/home/haraldwolff/src/ln.skyspot/ln.skyspot/obj/x86/Debug/skyspot.csprojAssemblyReference.cache
/home/haraldwolff/src/ln.skyspot/ln.skyspot/obj/x86/Debug/skyspot.csproj.CoreCompileInputs.cache
/home/haraldwolff/src/ln.skyspot/ln.skyspot/obj/x86/Debug/skyspot.csproj.CopyComplete
/home/haraldwolff/src/ln.skyspot/ln.skyspot/obj/x86/Debug/skyspot.exe
/home/haraldwolff/src/ln.skyspot/ln.skyspot/obj/x86/Debug/skyspot.pdb

Binary file not shown.

Binary file not shown.

View File

@ -1 +0,0 @@
90cb82de5c66c985c4300357859c223e0bbc5e47

View File

@ -1,14 +0,0 @@
/home/haraldwolff/src/ln.skyspot/ln.skyspot/bin/Release/skyspot.exe
/home/haraldwolff/src/ln.skyspot/ln.skyspot/bin/Release/ln.dhcp.dll
/home/haraldwolff/src/ln.skyspot/ln.skyspot/bin/Release/ln.http.dll
/home/haraldwolff/src/ln.skyspot/ln.skyspot/bin/Release/ln.http.objects.dll
/home/haraldwolff/src/ln.skyspot/ln.skyspot/bin/Release/ln.radius.dll
/home/haraldwolff/src/ln.skyspot/ln.skyspot/bin/Release/ln.types.dll
/home/haraldwolff/src/ln.skyspot/ln.skyspot/bin/Release/Newtonsoft.Json.dll
/home/haraldwolff/src/ln.skyspot/ln.skyspot/bin/Release/sharp.logging.dll
/home/haraldwolff/src/ln.skyspot/ln.skyspot/bin/Release/ln.templates.dll
/home/haraldwolff/src/ln.skyspot/ln.skyspot/bin/Release/Newtonsoft.Json.xml
/home/haraldwolff/src/ln.skyspot/ln.skyspot/obj/x86/Release/skyspot.csprojAssemblyReference.cache
/home/haraldwolff/src/ln.skyspot/ln.skyspot/obj/x86/Release/skyspot.csproj.CoreCompileInputs.cache
/home/haraldwolff/src/ln.skyspot/ln.skyspot/obj/x86/Release/skyspot.csproj.CopyComplete
/home/haraldwolff/src/ln.skyspot/ln.skyspot/obj/x86/Release/skyspot.exe

Binary file not shown.

View File

@ -75,9 +75,110 @@
<Folder Include="session\" />
<Folder Include="users\" />
<Folder Include="http\" />
<Folder Include="www\" />
<Folder Include="www\dhcp\" />
<Folder Include="www\css\" />
<Folder Include="www\dist\" />
<Folder Include="www\system\" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<None Include="www\css\Chart.min.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="www\css\datatables.min.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="www\css\images\ui-icons_444444_256x240.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="www\css\images\ui-icons_555555_256x240.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="www\css\images\ui-icons_6495ED_256x240.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="www\css\images\ui-icons_777620_256x240.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="www\css\images\ui-icons_777777_256x240.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="www\css\images\ui-icons_cc0000_256x240.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="www\css\images\ui-icons_ffffff_256x240.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="www\css\index.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="www\css\jquery-ui.min.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="www\css\select.jqueryui.min.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="www\css\style.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="www\dist\Chart.min.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="www\dist\datatables.min.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="www\dist\dataTables.select.min.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="www\dist\jquery.min.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="www\dist\jquery-ui.min.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="www\dist\moment-with-locales.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="www\dist\percentageBars.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="www\dist\select.jqueryui.min.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="www\frame.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="www\index.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="www\skyapi.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="www\topnav.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="www\dhcp\index.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="www\system\log.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="www\system\index.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="www\dhcp\serverInterfaces.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="www\dhcp\DHCPLeases.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="www\dhcp\IPPools.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="www\dhcp\IPPool.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project>

1
www/css/Chart.min.css vendored 100644
View File

@ -0,0 +1 @@
@keyframes chartjs-render-animation{from{opacity:.99}to{opacity:1}}.chartjs-render-monitor{animation:chartjs-render-animation 1ms}.chartjs-size-monitor,.chartjs-size-monitor-expand,.chartjs-size-monitor-shrink{position:absolute;direction:ltr;left:0;top:0;right:0;bottom:0;overflow:hidden;pointer-events:none;visibility:hidden;z-index:-1}.chartjs-size-monitor-expand>div{position:absolute;width:1000000px;height:1000000px;left:0;top:0}.chartjs-size-monitor-shrink>div{position:absolute;width:200%;height:200%;left:0;top:0}

136
www/css/datatables.min.css vendored 100644

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

127
www/css/index.html 100644
View File

@ -0,0 +1,127 @@
<%frame "frame.html"%>
<h1>Network Overview</h1>
<h2>Hosts / Nodes</h2>
<table id="nodeTable"></table>
<h2>Details</h2>
<div class="flex row">
<fieldset style="max-width: 500px;">
<label for="dName">Bezeichnung</label><input type="text" id="dName"><br>
<label for="dPrimaryIP">Primäre IP</label><input type="text" id="dPrimaryIP"><br>
<label for="dPrimaryMac">Primäre MAC</label><input type="text" id="dPrimaryMac"><br>
<label for="dCreated">Erstellt</label><input type="text" id="dCreated" readonly="true"><br>
<label for="dLastUpdate">Letztes Update</label><input type="text" id="dLastUpdate" readonly="true">
</fieldset>
<fieldset style="max-width: 500px;">
<label for="dVendor">Hersteller</label><input type="text" id="dVendor"><br>
<label for="dProduct">Modell</label><input type="text" id="dProduct"><br>
<label for="dProductLine">Modellzeile</label><input type="text" id="dProductLine"><br>
<label for="dLocation">Lokalisation</label><input type="text" id="dLocation"><br>
</fieldset>
<fieldset id="dURIs">
</fieldset>
<fieldset>
<select id="dInterfaces" size="12">
</select>
</fieldset>
</div>
<script type="text/javascript">
function showNode(node)
{
if (node == null)
{
$("#dName").prop("disabled", true).val("");
$("#dPrimaryIP").prop("disabled", true).val("");
$("#dPrimaryMac").prop("disabled", true).val("");
$("#dCreated").prop("disabled", true).val("");
$("#dLastUpdate").prop("disabled", true).val("");
$("#dVendor").prop("disabled", true).val("");
$("#dProduct").prop("disabled", true).val("");
$("#dProductLine").prop("disabled", true).val("");
$("#dLocation").prop("disabled", true).val("");
$("#dURIs").empty();
$("#dInterfaces").empty();
} else {
$("#dName").prop("disabled", false).val(node.Name);
$("#dPrimaryIP").prop("disabled", true).val(node.PrimaryIP);
$("#dPrimaryMac").prop("disabled", true).val(node.PrimaryMac);
$("#dCreated").prop("disabled", true).val(node.Created);
$("#dLastUpdate").prop("disabled", true).val(node.LastUpdate);
$("#dVendor").prop("disabled", false).val(node.Vendor);
$("#dProduct").prop("disabled", false).val(node.Product);
$("#dProductLine").prop("disabled", false).val(node.ProductLine);
$("#dLocation").prop("disabled", false).val(node.Location.Latitude + " / " + node.Location.Longitude);
$("#dURIs").empty();
$.each( node.URIs, function(){ $("#dURIs").append($("<span>" + this.Scheme + "://" + this.Host + ":" + this.Port + (this.Fragment ? "#" + this.Fragment : "") + "</span><br>")); } );
$("#dInterfaces").empty();
$.each( node.Interfaces, function(){
var intf = this;
$.each( intf.ConfiguredIPs, function(){
$("#dInterfaces").append( $( "<option value='"+ this.Network +"'>" + this.IP + "[ " + intf.Name + " ]</option>" ) );
});
});
skyapi().call("api/network","GetNeighbors", [ node.ID ], function(neighbors){
$("#nodeTable").DataTable().clear().rows.add( neighbors ).draw();
});
}
}
$("#dInterfaces").change( function(e){
skyapi().call("api/network","GetHostsInSubnet", [ $(this).children("option:selected").val() ], function(neighbors){
$("#nodeTable").DataTable().clear().rows.add( neighbors ).draw();
});
});
$("#nodeTable").DataTable({
columns: [
{ title: "", data: null },
{ title: "Bezeichnung", data: "Name" },
{ title: "Primäre IP", data: "PrimaryIP" },
{ title: "Primäre MAC", data: "PrimaryMac" },
{ title: "Erstellt", data: "Created" },
{ title: "Letztes Update", data: "LastUpdate" },
{ title: "Hersteller", data: "Vendor" },
{ title: "Produkt", data: "Product" },
{ title: "Standort", data: "Location", render: function(d,t,r){ return d.Latitude + "/" + d.Longitude; } }
],
columnDefs: [
{ targets: 0, data: null, defaultContent: "<button>?</button>" }
],
select: "single",
height: 300,
fixedHeader: true
})
.on( "select", function(e,dt,type,indexes){
if (indexes.length > 0)
{
var selNode = dt.rows( indexes ).data()[0];
showNode(selNode);
};
})
.on( "deselect", function(e,dt,type,indexes){
showNode(null);
});
function refreshNodeTable()
{
skyapi().getJson("entities/Nodes",
function(rows){
$("#nodeTable").DataTable().clear().rows.add( rows ).draw();
});
}
showNode(null);
refreshNodeTable();
</script>

7
www/css/jquery-ui.min.css vendored 100644

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
table.dataTable tbody>tr.selected,table.dataTable tbody>tr>.selected{background-color:#B0BED9}table.dataTable.stripe tbody>tr.odd.selected,table.dataTable.stripe tbody>tr.odd>.selected,table.dataTable.display tbody>tr.odd.selected,table.dataTable.display tbody>tr.odd>.selected{background-color:#acbad4}table.dataTable.hover tbody>tr.selected:hover,table.dataTable.hover tbody>tr>.selected:hover,table.dataTable.display tbody>tr.selected:hover,table.dataTable.display tbody>tr>.selected:hover{background-color:#aab7d1}table.dataTable.order-column tbody>tr.selected>.sorting_1,table.dataTable.order-column tbody>tr.selected>.sorting_2,table.dataTable.order-column tbody>tr.selected>.sorting_3,table.dataTable.order-column tbody>tr>.selected,table.dataTable.display tbody>tr.selected>.sorting_1,table.dataTable.display tbody>tr.selected>.sorting_2,table.dataTable.display tbody>tr.selected>.sorting_3,table.dataTable.display tbody>tr>.selected{background-color:#acbad5}table.dataTable.display tbody>tr.odd.selected>.sorting_1,table.dataTable.order-column.stripe tbody>tr.odd.selected>.sorting_1{background-color:#a6b4cd}table.dataTable.display tbody>tr.odd.selected>.sorting_2,table.dataTable.order-column.stripe tbody>tr.odd.selected>.sorting_2{background-color:#a8b5cf}table.dataTable.display tbody>tr.odd.selected>.sorting_3,table.dataTable.order-column.stripe tbody>tr.odd.selected>.sorting_3{background-color:#a9b7d1}table.dataTable.display tbody>tr.even.selected>.sorting_1,table.dataTable.order-column.stripe tbody>tr.even.selected>.sorting_1{background-color:#acbad5}table.dataTable.display tbody>tr.even.selected>.sorting_2,table.dataTable.order-column.stripe tbody>tr.even.selected>.sorting_2{background-color:#aebcd6}table.dataTable.display tbody>tr.even.selected>.sorting_3,table.dataTable.order-column.stripe tbody>tr.even.selected>.sorting_3{background-color:#afbdd8}table.dataTable.display tbody>tr.odd>.selected,table.dataTable.order-column.stripe tbody>tr.odd>.selected{background-color:#a6b4cd}table.dataTable.display tbody>tr.even>.selected,table.dataTable.order-column.stripe tbody>tr.even>.selected{background-color:#acbad5}table.dataTable.display tbody>tr.selected:hover>.sorting_1,table.dataTable.order-column.hover tbody>tr.selected:hover>.sorting_1{background-color:#a2aec7}table.dataTable.display tbody>tr.selected:hover>.sorting_2,table.dataTable.order-column.hover tbody>tr.selected:hover>.sorting_2{background-color:#a3b0c9}table.dataTable.display tbody>tr.selected:hover>.sorting_3,table.dataTable.order-column.hover tbody>tr.selected:hover>.sorting_3{background-color:#a5b2cb}table.dataTable.display tbody>tr:hover>.selected,table.dataTable.display tbody>tr>.selected:hover,table.dataTable.order-column.hover tbody>tr:hover>.selected,table.dataTable.order-column.hover tbody>tr>.selected:hover{background-color:#a2aec7}table.dataTable tbody td.select-checkbox,table.dataTable tbody th.select-checkbox{position:relative}table.dataTable tbody td.select-checkbox:before,table.dataTable tbody td.select-checkbox:after,table.dataTable tbody th.select-checkbox:before,table.dataTable tbody th.select-checkbox:after{display:block;position:absolute;top:1.2em;left:50%;width:12px;height:12px;box-sizing:border-box}table.dataTable tbody td.select-checkbox:before,table.dataTable tbody th.select-checkbox:before{content:' ';margin-top:-6px;margin-left:-6px;border:1px solid black;border-radius:3px}table.dataTable tr.selected td.select-checkbox:after,table.dataTable tr.selected th.select-checkbox:after{content:'\2714';margin-top:-11px;margin-left:-4px;text-align:center;text-shadow:1px 1px #B0BED9, -1px -1px #B0BED9, 1px -1px #B0BED9, -1px 1px #B0BED9}div.dataTables_wrapper span.select-info,div.dataTables_wrapper span.select-item{margin-left:0.5em}@media screen and (max-width: 640px){div.dataTables_wrapper span.select-info,div.dataTables_wrapper span.select-item{margin-left:0;display:block}}

433
www/css/style.css 100644
View File

@ -0,0 +1,433 @@
body {
padding: 0px;
margin: 0px;
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
display: block;
position: absolute;
top: 0px;
bottom: 0px;
left: 0px;
right: 0px;
}
div {
margin: 0px;
padding: 0px;
flex-grow: 0;
}
div#body {
display: flex;
height: 100%;
width: 100%;
flex-direction: column;
}
h1,h2,h3,h4,h5,h6 {
margin: 0px;
padding:2px;
}
table {
width: 98%;
}
h1 > div {
display: inline;
}
h1 {
font-size: 18px;
border-bottom: 1px solid black;
}
h2 {
font-size: 14px;
}
a {
text-decoration: none;
color: inherit;
}
/*!
button {
border: 1px solid black;
border-radius: 4px;
padding: 6px;
width: 140px;
font-weight: 800;
}
*/
#header {
top: 0px;
left: 0px;
right: 0px;
border-bottom: 1px solid black;
background-color: #c7def5;
padding: 4px;
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
#header > div {
margin: 4px;
}
#footer {
height: 20px;
padding: 6px;
padding-left: 24px;
background-color: #c7def5;
border-top: 1px solid black;
flex-grow: 0;
flex-shrink: 0;
}
#page {
display: flex;
top: 56px;
bottom: 32px;
left: 0px;
right: 0px;
flex-grow: 1;
flex-direction: row;
}
#nav {
display: flex;
left: 0px;
top: 0px;
bottom: 0px;
padding: 6px;
flex-grow: 0;
}
#content {
padding: 8px;
padding-top: 16px;
overflow: auto;
flex-grow: 1;
}
.scroll {
display: inline-block;
overflow: scroll;
}
.fill {
flex-grow: 1;
flex-shrink: 1;
}
.right {
float: right;
right: 0px;
}
.flex {
display: flex;
position: relative;
}
.flex.row {
flex-direction: row;
}
.flex.column {
flex-direction: column;
}
.flex > div {
margin: 4px;
display: inline-block;
}
.skylogo {
display: inline-block;
border: 1px solid black;
font-size: 18px;
font-weight: 800;
flex-grow: 0;
flex-shrink: 0;
}
.skylogo > div {
display: inline-block;
padding: 4px;
}
.indicator {
margin-left: 4px;
margin-right: 4px;
padding-top: 5px;
padding-left: 5px;
display: inline-block;
font-size: 12px;
width: 140px;
height: 18px;
border-radius: 8px;
color: #C0C0C0;
background-color: #009ee3;
}
.indicator > div {
border-radius: 50%;
background-color: #404040;
display: inline-block;
width: 11px;
height: 11px;
margin-bottom: -1px;
margin-right: 4px;
}
.indicator[state="STOPPING"] > div {
background-color: #C0C000;
}
.indicator[state="STARTED"] > div {
background-color: #00D000;
}
.indicator[state="FAILED"] > div {
background-color: #D00000;
}
.indicator[state="INITIALIZED"] > div {
background-color: #00D0D0;
}
.group {
min-width: 240px;
}
.group.right {
width: 24%;
border-left: 1px solid black;
padding-left: 8px;
top: 0px;
bottom: 0px;
}
#navigation h1 {
font-size: 14px;
border: none;
}
#navigation > div {
display: block;
margin-right: 16px;
}
#navigation > div > h1 {
margin-top: 8px;
margin-bottom: 4px;
}
#navigation > div > div {
margin-left: 8px;
}
#content > div {
margin: 6px;
}
fieldset {
display: inline-grid;
grid-template-columns: auto auto;
}
fieldset > * {
align-self: center;
margin-left: 6px;
margin-right: 6px;
margin-top: 4px;
margin-bottom: 2px;
}
.popup {
border: 2px solid rgba(0,0,0,0);
position: relative;
display: inline-block;
padding: 4px;
z-index: 1;
font-size: 16px;
transition: background-color 250ms;
}
.popup:hover {
border: 1px solid black;
border-bottom: 3px solid white;
border-radius: 6px 6px 0px 0px;
background-color: #dbe7f3;
transition: background-color 250ms;
}
.popup > div {
visibility: hidden;
opacity: 0;
transition: opacity 250ms;
display: block;
position: absolute;
z-index: -1;
left: -1px;
top: 26px;
min-width: 140px;
max-width: 240px;
background-color: white;
border: 1px solid black;
border-radius: 0px 6px 6px 6px;
padding: 8px;
}
.popup:hover > div {
visibility: visible;
opacity: 1;
transition: opacity 250ms;
}
.popup > div > div {
position: relative;
display: block;
padding: 4px;
white-space: nowrap;
}
.popup > div > div:hover {
background-color: #dbe7f3;
}
.ui-icon {
background-image: url(images/ui-icons_6495ED_256x240.png);
}
.issue-box {
display: block;
border-radius: 6px 6px 0px 0px;
border: 3px solid silver;
}
.issue-box > h2 {
font-size: 18px;
}
.issue-box > div {
background-color: white;
color: black;
font-size: 14px;
padding: 4px;
}
.issue-box #History {
max-height: 80px;
overflow-x: hidden;
overflow-y: auto;
}
.issue-WARN {
border-color: #C0C000;
background-color: #C0C000;
color: black;
}
.issue-CRITICAL {
border-color: red;
background-color: red;
color: white;
}
#CheckState {
font-size: 20px;
}
#CheckState.WARN, span#nWARN {
color: #C0C000;
}
#CheckState.CRITICAL, span#nCRITICAL{
color: RED;
margin-right: 12px;
}
#PerfValues > span, #History > span {
display: inline-block;
width: 100%;
}
#History > span {
color: green;
margin-right: 24px;
}
#PerfValues > .WARN, #History > .WARN {
color: #C0C000;
}
#PerfValues > .CRITICAL, #History > .CRITICAL {
color: white;
background-color: red;
}
span#nWARN, span#nCRITICAL {
font-size: 24px;
}
.performance-value > div {
display: inline-block;
margin-right: 8px;
white-space: nowrap;
}
.performance-value > div:last {
margin-right: 0px;
}
.performance-value {
border-bottom: 1px solid black;
}
.issue-box .performance-value > #chartBox {
position: relative;
width: 100%;
height: 100%;
}
.issue-box .performance-value {
position: relative;
height: 100px;
}
.issue-box:hover .performance-value {
height: 250px;
}
#content a::before {
content: '\25B8';
color: blue;
padding-right: 2px;
}

View File

@ -0,0 +1,33 @@
<%frame "frame.html"%>
<h2>Leases</h2>
<div>
<table id="DHCPLeases"></table>
</div>
<script type="text/javascript">
$("#DHCPLeases").DataTable({
columns: [
{ title: "Client MAC", data: "ClientMAC.Bytes", render: function(d,t,r){ return DecodeMAC(d); } },
{ title: "Client IP", data: "ClientIP" },
{ title: "Client Name", data: "ClientName" },
{ title: "Status", data: "LeaseState" },
{ title: "Erstellt", data: "Created" },
{ title: "Gültig bis", data: "ValidThrough" },
{ title: "Letzte Änderung", data: "LastUpdate" },
{ title: "Freigegeben", data: "Released" },
],
columnDefs: [
],
select: "single",
ajax: {
url: "/DHCP/collections/DHCPLease",
dataSrc: ''
},
serverSide: false,
})
</script>

View File

@ -0,0 +1,22 @@
<%frame "frame.html"%>
<h2>Address Pool (<%=__path__[0]%>)</h2>
<div>
<fieldset>
<label>Bezeichnung</label>
<input type="text" id="Name">
<label>Erste IP</label>
<input type="text" id="FirstIP">
<label>Letzte IP</label>
<input type="text" id="LastIP">
<label>Standard Gültigkeit</label>
<input type="text" id="DefaultLeaseTime">
</fieldset>
</div>
<script type="text/javascript">
skyapi().getJson( "/DHCP/collections/IPPool/<%=__path__[0]%>", function(ippool){
PopulateForm( ippool );
} );
</script>

View File

@ -0,0 +1,30 @@
<%frame "frame.html"%>
<h2>Address Pools</h2>
<div>
<table id="IPPools"></table>
</div>
<script type="text/javascript">
$("#IPPools").DataTable({
columns: [
{ title: "Bezeichnung", data: "Name", render: function(d,t,r){ return `<a href="/dhcp/IPPool.html/${d}">${d}</a>`; } },
{ title: "Erste IP", data: "FirstIP" },
{ title: "Letzte IP", data: "LastIP" },
{ title: "Nächste IP", data: "NextIP" },
{ title: "Standard Gültigkeit", data: "DefaultLeaseTime" },
],
columnDefs: [
],
select: "single",
ajax: {
url: "/DHCP/collections/IPPool",
dataSrc: ''
},
serverSide: false,
})
</script>

View File

@ -0,0 +1,4 @@
<%frame "frame.html"%>
<script type="text/javascript">
</script>

View File

@ -0,0 +1,28 @@
<%frame "frame.html"%>
<h2>Konfigurierte Schnittstellen</h2>
<div>
<table id="serverInterfaces"></table>
</div>
<script type="text/javascript">
$("#serverInterfaces").DataTable({
columns: [
{ title: "Bezeichnung", data: "Name" },
{ title: "Interface IP", data: "InterfaceAddress" },
{ title: "Pool", data: "Pool.Name", render: function(d,t,r){ return `<a href="/dhcp/IPPool.html/${d}">${d}</a>`; } },
],
columnDefs: [
],
select: "single",
ajax: {
url: "/DHCP/collections/DHCPServerInterface",
dataSrc: ''
},
serverSide: false,
})
</script>

7
www/dist/Chart.min.js vendored 100644

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,37 @@
/*!
Copyright 2015-2018 SpryMedia Ltd.
This source file is free software, available under the following license:
MIT license - http://datatables.net/license/mit
This source file is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.
For details please refer to: http://www.datatables.net/extensions/select
Select for DataTables 1.3.0
2015-2018 SpryMedia Ltd - datatables.net/license/mit
*/
(function(f){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(k){return f(k,window,document)}):"object"===typeof exports?module.exports=function(k,m){k||(k=window);m&&m.fn.dataTable||(m=require("datatables.net")(k,m).$);return f(m,k,k.document)}:f(jQuery,window,document)})(function(f,k,m,h){function z(a,b,c){var d=function(c,b){if(c>b){var d=b;b=c;c=d}var e=!1;return a.columns(":visible").indexes().filter(function(a){a===c&&(e=!0);return a===b?(e=!1,!0):e})};var e=
function(c,b){var d=a.rows({search:"applied"}).indexes();if(d.indexOf(c)>d.indexOf(b)){var e=b;b=c;c=e}var f=!1;return d.filter(function(a){a===c&&(f=!0);return a===b?(f=!1,!0):f})};a.cells({selected:!0}).any()||c?(d=d(c.column,b.column),c=e(c.row,b.row)):(d=d(0,b.column),c=e(0,b.row));c=a.cells(c,d).flatten();a.cells(b,{selected:!0}).any()?a.cells(c).deselect():a.cells(c).select()}function v(a){var b=a.settings()[0]._select.selector;f(a.table().container()).off("mousedown.dtSelect",b).off("mouseup.dtSelect",
b).off("click.dtSelect",b);f("body").off("click.dtSelect"+a.table().node().id)}function A(a){var b=f(a.table().container()),c=a.settings()[0],d=c._select.selector,e;b.on("mousedown.dtSelect",d,function(a){if(a.shiftKey||a.metaKey||a.ctrlKey)b.css("-moz-user-select","none").one("selectstart.dtSelect",d,function(){return!1});k.getSelection&&(e=k.getSelection())}).on("mouseup.dtSelect",d,function(){b.css("-moz-user-select","")}).on("click.dtSelect",d,function(c){var b=a.select.items();if(e){var d=k.getSelection();
if((!d.anchorNode||f(d.anchorNode).closest("table")[0]===a.table().node())&&d!==e)return}d=a.settings()[0];var l=f.trim(a.settings()[0].oClasses.sWrapper).replace(/ +/g,".");if(f(c.target).closest("div."+l)[0]==a.table().container()&&(l=a.cell(f(c.target).closest("td, th")),l.any())){var g=f.Event("user-select.dt");n(a,g,[b,l,c]);g.isDefaultPrevented()||(g=l.index(),"row"===b?(b=g.row,w(c,a,d,"row",b)):"column"===b?(b=l.index().column,w(c,a,d,"column",b)):"cell"===b&&(b=l.index(),w(c,a,d,"cell",b)),
d._select_lastCell=g)}});f("body").on("click.dtSelect"+a.table().node().id,function(b){!c._select.blurable||f(b.target).parents().filter(a.table().container()).length||0===f(b.target).parents("html").length||f(b.target).parents("div.DTE").length||r(c,!0)})}function n(a,b,c,d){if(!d||a.flatten().length)"string"===typeof b&&(b+=".dt"),c.unshift(a),f(a.table().node()).trigger(b,c)}function B(a){var b=a.settings()[0];if(b._select.info&&b.aanFeatures.i&&"api"!==a.select.style()){var c=a.rows({selected:!0}).flatten().length,
d=a.columns({selected:!0}).flatten().length,e=a.cells({selected:!0}).flatten().length,l=function(b,c,d){b.append(f('<span class="select-item"/>').append(a.i18n("select."+c+"s",{_:"%d "+c+"s selected",0:"",1:"1 "+c+" selected"},d)))};f.each(b.aanFeatures.i,function(b,a){a=f(a);b=f('<span class="select-info"/>');l(b,"row",c);l(b,"column",d);l(b,"cell",e);var g=a.children("span.select-info");g.length&&g.remove();""!==b.text()&&a.append(b)})}}function D(a){var b=new g.Api(a);a.aoRowCreatedCallback.push({fn:function(b,
d,e){d=a.aoData[e];d._select_selected&&f(b).addClass(a._select.className);b=0;for(e=a.aoColumns.length;b<e;b++)(a.aoColumns[b]._select_selected||d._selected_cells&&d._selected_cells[b])&&f(d.anCells[b]).addClass(a._select.className)},sName:"select-deferRender"});b.on("preXhr.dt.dtSelect",function(){var a=b.rows({selected:!0}).ids(!0).filter(function(b){return b!==h}),d=b.cells({selected:!0}).eq(0).map(function(a){var c=b.row(a.row).id(!0);return c?{row:c,column:a.column}:h}).filter(function(b){return b!==
h});b.one("draw.dt.dtSelect",function(){b.rows(a).select();d.any()&&d.each(function(a){b.cells(a.row,a.column).select()})})});b.on("draw.dtSelect.dt select.dtSelect.dt deselect.dtSelect.dt info.dt",function(){B(b)});b.on("destroy.dtSelect",function(){v(b);b.off(".dtSelect")})}function C(a,b,c,d){var e=a[b+"s"]({search:"applied"}).indexes();d=f.inArray(d,e);var g=f.inArray(c,e);if(a[b+"s"]({selected:!0}).any()||-1!==d){if(d>g){var u=g;g=d;d=u}e.splice(g+1,e.length);e.splice(0,d)}else e.splice(f.inArray(c,
e)+1,e.length);a[b](c,{selected:!0}).any()?(e.splice(f.inArray(c,e),1),a[b+"s"](e).deselect()):a[b+"s"](e).select()}function r(a,b){if(b||"single"===a._select.style)a=new g.Api(a),a.rows({selected:!0}).deselect(),a.columns({selected:!0}).deselect(),a.cells({selected:!0}).deselect()}function w(a,b,c,d,e){var f=b.select.style(),g=b[d](e,{selected:!0}).any();"os"===f?a.ctrlKey||a.metaKey?b[d](e).select(!g):a.shiftKey?"cell"===d?z(b,e,c._select_lastCell||null):C(b,d,e,c._select_lastCell?c._select_lastCell[d]:
null):(a=b[d+"s"]({selected:!0}),g&&1===a.flatten().length?b[d](e).deselect():(a.deselect(),b[d](e).select())):"multi+shift"==f?a.shiftKey?"cell"===d?z(b,e,c._select_lastCell||null):C(b,d,e,c._select_lastCell?c._select_lastCell[d]:null):b[d](e).select(!g):b[d](e).select(!g)}function t(a,b){return function(c){return c.i18n("buttons."+a,b)}}function x(a){a=a._eventNamespace;return"draw.dt.DT"+a+" select.dt.DT"+a+" deselect.dt.DT"+a}function E(a,b){return-1!==f.inArray("rows",b.limitTo)&&a.rows({selected:!0}).any()||
-1!==f.inArray("columns",b.limitTo)&&a.columns({selected:!0}).any()||-1!==f.inArray("cells",b.limitTo)&&a.cells({selected:!0}).any()?!0:!1}var g=f.fn.dataTable;g.select={};g.select.version="1.3.0";g.select.init=function(a){var b=a.settings()[0],c=b.oInit.select,d=g.defaults.select;c=c===h?d:c;d="row";var e="api",l=!1,u=!0,k="td, th",n="selected",m=!1;b._select={};!0===c?(e="os",m=!0):"string"===typeof c?(e=c,m=!0):f.isPlainObject(c)&&(c.blurable!==h&&(l=c.blurable),c.info!==h&&(u=c.info),c.items!==
h&&(d=c.items),e=c.style!==h?c.style:"os",m=!0,c.selector!==h&&(k=c.selector),c.className!==h&&(n=c.className));a.select.selector(k);a.select.items(d);a.select.style(e);a.select.blurable(l);a.select.info(u);b._select.className=n;f.fn.dataTable.ext.order["select-checkbox"]=function(b,a){return this.api().column(a,{order:"index"}).nodes().map(function(a){return"row"===b._select.items?f(a).parent().hasClass(b._select.className):"cell"===b._select.items?f(a).hasClass(b._select.className):!1})};!m&&f(a.table().node()).hasClass("selectable")&&
a.select.style("os")};f.each([{type:"row",prop:"aoData"},{type:"column",prop:"aoColumns"}],function(a,b){g.ext.selector[b.type].push(function(a,d,e){d=d.selected;var c=[];if(!0!==d&&!1!==d)return e;for(var f=0,g=e.length;f<g;f++){var h=a[b.prop][e[f]];(!0===d&&!0===h._select_selected||!1===d&&!h._select_selected)&&c.push(e[f])}return c})});g.ext.selector.cell.push(function(a,b,c){b=b.selected;var d=[];if(b===h)return c;for(var e=0,f=c.length;e<f;e++){var g=a.aoData[c[e].row];(!0===b&&g._selected_cells&&
!0===g._selected_cells[c[e].column]||!(!1!==b||g._selected_cells&&g._selected_cells[c[e].column]))&&d.push(c[e])}return d});var p=g.Api.register,q=g.Api.registerPlural;p("select()",function(){return this.iterator("table",function(a){g.select.init(new g.Api(a))})});p("select.blurable()",function(a){return a===h?this.context[0]._select.blurable:this.iterator("table",function(b){b._select.blurable=a})});p("select.info()",function(a){return B===h?this.context[0]._select.info:this.iterator("table",function(b){b._select.info=
a})});p("select.items()",function(a){return a===h?this.context[0]._select.items:this.iterator("table",function(b){b._select.items=a;n(new g.Api(b),"selectItems",[a])})});p("select.style()",function(a){return a===h?this.context[0]._select.style:this.iterator("table",function(b){b._select.style=a;b._select_init||D(b);var c=new g.Api(b);v(c);"api"!==a&&A(c);n(new g.Api(b),"selectStyle",[a])})});p("select.selector()",function(a){return a===h?this.context[0]._select.selector:this.iterator("table",function(b){v(new g.Api(b));
b._select.selector=a;"api"!==b._select.style&&A(new g.Api(b))})});q("rows().select()","row().select()",function(a){var b=this;if(!1===a)return this.deselect();this.iterator("row",function(b,a){r(b);b.aoData[a]._select_selected=!0;f(b.aoData[a].nTr).addClass(b._select.className)});this.iterator("table",function(a,d){n(b,"select",["row",b[d]],!0)});return this});q("columns().select()","column().select()",function(a){var b=this;if(!1===a)return this.deselect();this.iterator("column",function(b,a){r(b);
b.aoColumns[a]._select_selected=!0;a=(new g.Api(b)).column(a);f(a.header()).addClass(b._select.className);f(a.footer()).addClass(b._select.className);a.nodes().to$().addClass(b._select.className)});this.iterator("table",function(a,d){n(b,"select",["column",b[d]],!0)});return this});q("cells().select()","cell().select()",function(a){var b=this;if(!1===a)return this.deselect();this.iterator("cell",function(b,a,e){r(b);a=b.aoData[a];a._selected_cells===h&&(a._selected_cells=[]);a._selected_cells[e]=
!0;a.anCells&&f(a.anCells[e]).addClass(b._select.className)});this.iterator("table",function(a,d){n(b,"select",["cell",b[d]],!0)});return this});q("rows().deselect()","row().deselect()",function(){var a=this;this.iterator("row",function(b,a){b.aoData[a]._select_selected=!1;f(b.aoData[a].nTr).removeClass(b._select.className)});this.iterator("table",function(b,c){n(a,"deselect",["row",a[c]],!0)});return this});q("columns().deselect()","column().deselect()",function(){var a=this;this.iterator("column",
function(a,c){a.aoColumns[c]._select_selected=!1;var b=new g.Api(a),e=b.column(c);f(e.header()).removeClass(a._select.className);f(e.footer()).removeClass(a._select.className);b.cells(null,c).indexes().each(function(b){var c=a.aoData[b.row],d=c._selected_cells;!c.anCells||d&&d[b.column]||f(c.anCells[b.column]).removeClass(a._select.className)})});this.iterator("table",function(b,c){n(a,"deselect",["column",a[c]],!0)});return this});q("cells().deselect()","cell().deselect()",function(){var a=this;
this.iterator("cell",function(a,c,d){c=a.aoData[c];c._selected_cells[d]=!1;c.anCells&&!a.aoColumns[d]._select_selected&&f(c.anCells[d]).removeClass(a._select.className)});this.iterator("table",function(b,c){n(a,"deselect",["cell",a[c]],!0)});return this});var y=0;f.extend(g.ext.buttons,{selected:{text:t("selected","Selected"),className:"buttons-selected",limitTo:["rows","columns","cells"],init:function(a,b,c){var d=this;c._eventNamespace=".select"+y++;a.on(x(c),function(){d.enable(E(a,c))});this.disable()},
destroy:function(a,b,c){a.off(c._eventNamespace)}},selectedSingle:{text:t("selectedSingle","Selected single"),className:"buttons-selected-single",init:function(a,b,c){var d=this;c._eventNamespace=".select"+y++;a.on(x(c),function(){var b=a.rows({selected:!0}).flatten().length+a.columns({selected:!0}).flatten().length+a.cells({selected:!0}).flatten().length;d.enable(1===b)});this.disable()},destroy:function(a,b,c){a.off(c._eventNamespace)}},selectAll:{text:t("selectAll","Select all"),className:"buttons-select-all",
action:function(){this[this.select.items()+"s"]().select()}},selectNone:{text:t("selectNone","Deselect all"),className:"buttons-select-none",action:function(){r(this.settings()[0],!0)},init:function(a,b,c){var d=this;c._eventNamespace=".select"+y++;a.on(x(c),function(){var b=a.rows({selected:!0}).flatten().length+a.columns({selected:!0}).flatten().length+a.cells({selected:!0}).flatten().length;d.enable(0<b)});this.disable()},destroy:function(a,b,c){a.off(c._eventNamespace)}}});f.each(["Row","Column",
"Cell"],function(a,b){var c=b.toLowerCase();g.ext.buttons["select"+b+"s"]={text:t("select"+b+"s","Select "+c+"s"),className:"buttons-select-"+c+"s",action:function(){this.select.items(c)},init:function(a){var b=this;a.on("selectItems.dt.DT",function(a,d,e){b.active(e===c)})}}});f(m).on("preInit.dt.dtSelect",function(a,b){"dt"===a.namespace&&g.select.init(new g.Api(b))});return g.select});

722
www/dist/datatables.min.js vendored 100644

File diff suppressed because one or more lines are too long

13
www/dist/jquery-ui.min.js vendored 100644

File diff suppressed because one or more lines are too long

2
www/dist/jquery.min.js vendored 100644

File diff suppressed because one or more lines are too long

14765
www/dist/moment-with-locales.js vendored 100644

File diff suppressed because it is too large Load Diff

89
www/dist/percentageBars.js vendored 100644
View File

@ -0,0 +1,89 @@
/**
* This data rendering helper method will convert percentage values into a bar.
* Values can either have the % sign or not and decimals get rounded to the
* given value. The percentage will have a max value of 100%.
*
* This function should be used with the `dt-init columns.render` configuration
* option of DataTables.
*
* v1.1 Changelog
* - Added a seventh border type parameter.
* - All parameters are now optional.
* - Improved styling.
* - Bug fix: Text is always centered now.
*
* It accepts seven parameters:
*
* 1. `-type string` square as default or round for a rounded bar.
* 2. `-type string` A hex color for the text.
* 3. `-type string` A hex color for the border.
* 4. `-type string` A hex color for the bar.
* 5. `-type string` A hex color for the background.
* 6. `-type integer` A number used to round the value.
* 7. `-type string` A border style, default=ridge (solid, outset, groove, ridge)
*
* DEMO : http://codepen.io/RedJokingInn/pen/jrkZQN
*
* @name percentBar
* @summary Display percentage value as a bar
* @author [Drijkoningen Dirk](RedJokingInn)
* @requires DataTables 1.10+
*
* @returns {String} Html code for bar
*
* @example
* // Display rounded bars with white text, medium blue border, light blue bar, dark blue background, rounded to one decimal.
* $('#example').DataTable( {
* columnDefs: [ {
* targets: 4,
* render: $.fn.dataTable.render.percentBar( 'round','#FFF', '#269ABC', '#31B0D5', '#286090', 1, 'groove' )
* } ]
* } );
*
* @example
* // All default values used. Square bars with black text, gray ridged border, light green bar, light gray background, rounded to integer.
* $('#example').DataTable( {
* columnDefs: [ {
* targets: 2,
* render: $.fn.dataTable.render.percentBar()
* } ]
* } );
*/
jQuery.fn.dataTable.render.percentBar = function(pShape, cText, cBorder, cBar, cBack, vRound, bType) {
pShape = pShape || 'square';
cText = cText || '#000';
cBorder = cBorder || '#BCBCBC';
cBar = cBar || '#5FD868';
cBack = cBack || '#E6E6E6';
vRound = vRound || 0;
bType = bType || 'ridge';
//Bar templates
var styleRule1 = 'max-width:100px;height:12px;margin:0 auto;';
var styleRule2 = 'border:2px '+bType+' '+cBorder+';line-height:12px;font-size:14px;color:'+cText+';background:'+cBack+';position:relative;';
var styleRule3 = 'height:12px;line-height:12px;text-align:center;background-color:'+cBar+';padding:auto 6px;';
//Square is default, make template round if pShape == round
if(pShape=='round'){
styleRule2 += 'border-radius:5px;';
styleRule3 += 'border-top-left-radius:4px;border-bottom-left-radius:4px;';
}
return function(d, type, row) {
//Remove % if found in the value
//Round to the given parameter vRound
s = parseFloat(d.toString().replace(/\s%|%/g,'')).toFixed(vRound);
//Not allowed to go over 100%
if(s>100){s=100}
// Order, search and type gets numbers
if (type !== 'display') {
return s;
}
if (typeof d !== 'number' && typeof d !== 'string') {
return d;
}
//Return the code for the bar
return '<div style="'+styleRule1+'"><div style="'+styleRule2+'"><div style="'+styleRule3+'width:'+s+ '%;"></div><div style="width:100%;text-align:center;position:absolute;left:0;top:0;">'+s+'%</div></div></div>';
};
};

View File

@ -0,0 +1,5 @@
/*!
jQuery UI styling wrapper for Select
©2018 SpryMedia Ltd - datatables.net/license
*/
(function(c){"function"===typeof define&&define.amd?define(["jquery","datatables.net-jqui","datatables.net-select"],function(a){return c(a,window,document)}):"object"===typeof exports?module.exports=function(a,b){a||(a=window);b&&b.fn.dataTable||(b=require("datatables.net-jqui")(a,b).$);b.fn.dataTable.select||require("datatables.net-select")(a,b);return c(b,a,a.document)}:c(jQuery,window,document)})(function(c,a,b,d){return c.fn.dataTable});

47
www/frame.html 100644
View File

@ -0,0 +1,47 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>SkySpot WebUI (Alpha)</title>
<link href="/css/jquery-ui.min.css" rel="stylesheet" />
<link href="/css/datatables.min.css" rel="stylesheet" />
<link href="/css/Chart.min.css" rel="stylesheet" />
<link href="/css/style.css" rel="stylesheet" />
<script type="text/javascript" src="/skyapi.js"></script>
<script type="text/javascript" src="/dist/jquery.min.js"></script>
<script type="text/javascript" src="/dist/jquery-ui.min.js"></script>
<script type="text/javascript" src="/dist/moment-with-locales.js"></script>
<script type="text/javascript" src="/dist/datatables.min.js"></script>
<script type="text/javascript" src="/dist/percentageBars.js"></script>
<script type="text/javascript" src="/dist/Chart.min.js"></script>
</head>
<body>
<script type="text/javascript">
$( document ).tooltip();
</script>
<div id="body">
<div id="header">
<div class="skylogo">
<div style="background-color: #009ee3; color: white;">Sky</div><div style="background-color: white;">Spot</div></div>
<%include "topnav.html"%>
</div>
<div id="page">
<div id="content">
<%=__frame__%>
</div>
</div>
<div id="footer">
</div>
</div>
<script type="text/javascript">
// $("#header a").on( "click", function(e){ e.preventDefault(); skyapi().loadPage( $(this).attr('href') ); });
</script>
</body>
</html>

2
www/index.html 100644
View File

@ -0,0 +1,2 @@
<%frame "frame.html"%>

180
www/skyapi.js 100644
View File

@ -0,0 +1,180 @@
Object.values = function(o) {
var values = [];
for(var property in o) {
values.push(o[property]);
}
return values;
}
function encodeID( t )
{
return ("" + t).replace( /[\.\/]/g, "_");
}
function SKYAPI(baseurl){
this.baseurl = baseurl;
this.refresh = []
this.setBaseURL = function(url){ this.baseurl = url; }
this.addRefresh = function( rh, seconds = null ){ this.refresh.push( { interval: seconds ? seconds : 5, refresh: rh } ); }
this.get = function(page, json, handler = null){ return this.__request("GET", page, json, handler); }
this.post = function(page, json, handler = null){ return this.__request("POST", page, json, handler); }
this.put = function(page, json, handler = null){ return this.__request("PUT", page, json, handler); }
this.__request = function(method, page, json, handler = null){
if (page[0] == '/')
page = page.substr(1);
var x = new XMLHttpRequest();
if (handler != null)
{
x.onload = function(){
var responseText = x.responseText;
if (json && !content)
handler( JSON.parse( responseText ) );
else
handler( responseText );
}
}
x.open(method, this.baseurl + page);
if (json)
x.send(JSON.stringify(json));
else
x.send();
}
this.getJson = function(page, handler){
var j = function(t){
handler(JSON.parse(t));
};
return this.get( page, null, j );
}
this.call = function(endpoint,method,parameters = [], receiver = null){
var x = new XMLHttpRequest();
x.open("POST", this.baseurl + endpoint, (receiver != null));
x.setRequestHeader("content-type","application/json");
if (receiver)
{
x.onload = function(){ var r = JSON.parse(this.responseText).Result; receiver(r); }
x.onerror = function(){ receiver(false); }
}
var methodCall = {
"MethodName": method,
"Parameters": parameters
}
x.send(JSON.stringify(methodCall));
if (!receiver)
{
var result = JSON.parse(x.responseText);
if (result.Exception != null)
throw result.Exception;
return result.Result;
}
return x;
}
this.loadPage = function (page) {
if (page[0] == '/')
page = page.substr(1);
var x = new XMLHttpRequest();
x.open("GET", this.baseurl + page);
x.setRequestHeader("x-template-unframed","unframed");
x.onload = function()
{
$("#content").empty();
$("#content").append(this.responseText);
history.pushState(null, page, skyapi().baseurl + page);
}
this.refresh = []
x.send();
return false;
}
this.fireOnLoad = function(element){
if (element.onload != null)
{
element.onload();
}
for (var n=0;n<element.children.length;n++)
this.fireOnLoad(element.children[n]);
}
this.__refresh_index = 0;
this.UIRefresh = function(){
this.__refresh_index++;
for (var n=0;n<this.refresh.length;n++)
{
var r = this.refresh[n];
if ((this.__refresh_index % r.interval)==0)
r.refresh();
}
}
setInterval( function(){ skyapi().UIRefresh(); }, 1000 );
}
var __skyapi = new SKYAPI("/");
function skyapi()
{
return __skyapi;
}
function ScaleSI(value)
{
if (value > 1000000000)
return ((value / 1000000000) | 0) + "G";
if (value > 1000000)
return ((value / 1000000) | 0) + "M";
if (value > 1000)
return ((value / 1000) | 0) + "k";
return value;
}
function BytesToString(bytestring, sep = ":")
{
return Array.from( bytestring, function(b){
return ('0' + b.charCodeAt(0).toString(16)).slice(-2);
}).join(sep);
}
function DecodeMAC(b64mac)
{
var smac = atob(b64mac);
return BytesToString(smac);
}
function PopulateForm( o )
{
for (const key in o)
{
var i = $("#" + key);
if (i.length)
{
i.val(o[key]);
}
}
}

View File

@ -0,0 +1,2 @@
<%frame "frame.html"%>

View File

@ -0,0 +1,41 @@
<%frame "frame.html"%>
<div>
<h1>Logging</h1>
<div>
<select id="maxLogLevel">
<option value="0">Fatal</option>
<option value="5">Error</option>
<option value="10">Warning</option>
<option value="15" selected="true">Info</option>
<option value="30">Debug</option>
<option value="40">DEBUGDETAIL</option>
<option value="80">DEBUGFULL</option>
<option value="128">Max</option>
</select><br/>
<table id="logTable"></table>
</div>
</div>
<script type="text/javascript">
function refreshLog(logEntries)
{
if (!logEntries)
logEntries = []
$('#logTable').DataTable().clear();
$('#logTable').DataTable().rows.add( logEntries ).draw();
}
var columns = [
{ title: "Level", data: "LogLevel", width: 80 },
{ title: "Message", data: "Lines" }
];
var logTable = $("#logTable").DataTable( { columns: columns } );
skyapi().addRefresh( function(){
skyapi().call("api/management","GetLogEntries", [ $("#maxLogLevel").val() ], refreshLog );
}, 1);
</script>

44
www/topnav.html 100644
View File

@ -0,0 +1,44 @@
<div class="popup">DHCP Server
<div>
<div>
<a href="/dhcp/index.html"><div>Übersicht</div></a>
</div>
<div>
<a href="/dhcp/serverInterfaces.html"><div>Schnittstellen</div></a>
</div>
<div>
<a href="/dhcp/IPPools.html"><div>Address Pools</div></a>
</div>
<div>
<a href="/dhcp/DHCPLeases.html"><div>Leases</div></a>
</div>
</div>
</div>
<div class="popup">Sessions
<div>
<div>
<a href=""><div>N/A</div></a>
</div>
<div>
<a href=""><div>N/A</div></a>
</div>
<div>
<a href=""><div>N/A</div></a>
</div>
</div>
</div>
<div class="popup">System
<div>
<div>
<a href="/system/index.html"><div>Modul Steuerung</div></a>
</div>
<div>
<a href="/system/log.html"><div>Logging</div></a>
</div>
</div>
</div>