WIP
|
@ -46,7 +46,7 @@ namespace ln.skyscanner
|
|||
Console.WriteLine("Core Node (alt): {0}", coreNode2);
|
||||
|
||||
Query nodeByIpQuery = Query.Equals<Node>("Interfaces[].ConfiguredIPs[].IP", IPv4.Parse("10.255.7.129"));
|
||||
IEnumerable<Node> qnodes = skyScanner.Entities.nodeCollection.Select(nodeByIpQuery);
|
||||
IEnumerable<Node> qnodes = skyScanner.Entities.nodeCollection.Query(nodeByIpQuery);
|
||||
|
||||
IEnumerable<Node> neighbors = skyScanner.Entities.GlobalNetwork.FindNeighbors(coreNode);
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@ using ln.skyscanner.entities;
|
|||
using System.IO;
|
||||
using ln.http.resources;
|
||||
using System.Linq;
|
||||
using ln.types.odb.mapped;
|
||||
|
||||
namespace ln.skyscanner
|
||||
{
|
||||
|
@ -21,7 +22,6 @@ namespace ln.skyscanner
|
|||
[Callable]
|
||||
public Node[] Nodes => nodeCollection.ToArray();
|
||||
|
||||
|
||||
public SkyScanner SkyScanner { get; }
|
||||
public string BasePath => Path.Combine(SkyScanner.BasePath, "entities");
|
||||
|
||||
|
@ -31,6 +31,7 @@ namespace ln.skyscanner
|
|||
//public ODBCollection<NetworkInterface> interfaceCollection { get; private set; }
|
||||
//public ODBCollection<IntfIP> intfIPCollection { get; private set; }
|
||||
public ODBCollection<Subnet> subnetCollection { get; private set; }
|
||||
public ODBCollection<PointOfPresence> popCollection { get; private set; }
|
||||
|
||||
public SkyEntities(SkyScanner skyScanner)
|
||||
{
|
||||
|
@ -43,9 +44,14 @@ namespace ln.skyscanner
|
|||
nodeCollection.EnsureIndex("PrimaryIP");
|
||||
nodeCollection.EnsureIndex("Interfaces[].ConfiguredIPs[].IP");
|
||||
nodeCollection.EnsureIndex("Interfaces[].ConfiguredIPs[].Network");
|
||||
nodeCollection.EnsureIndex("uniqueIdentity");
|
||||
|
||||
subnetCollection.EnsureIndex("Network");
|
||||
|
||||
popCollection = odDatabase.GetCollection<PointOfPresence>();
|
||||
popCollection.EnsureIndex("ForeignName");
|
||||
popCollection.EnsureIndex("nodeIDList[]");
|
||||
|
||||
GlobalNetwork = new GlobalNetwork(this);
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ namespace ln.skyscanner.checks
|
|||
Node = node;
|
||||
|
||||
Query stateQuery = Query.Equals<SkyCheckState>("UniqueNodeIdentifier", Node.UniqueIdentity);
|
||||
SkyCheckState[] skyCheckStates = SkyScanner.Instance.Checker.checkStates.Select(stateQuery).ToArray();
|
||||
SkyCheckState[] skyCheckStates = SkyScanner.Instance.Checker.checkStates.Query(stateQuery).ToArray();
|
||||
foreach (SkyCheckState checkState in skyCheckStates)
|
||||
{
|
||||
checkStates.Add(checkState.CheckName, checkState);
|
||||
|
|
|
@ -12,6 +12,8 @@ using ln.skyscanner.entities;
|
|||
using ln.types.odb;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using System.Linq;
|
||||
using ln.types.odb.attributes;
|
||||
namespace ln.skyscanner.checks
|
||||
{
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
|
@ -25,6 +27,9 @@ namespace ln.skyscanner.checks
|
|||
public readonly String CheckName;
|
||||
public readonly String UniqueNodeIdentifier;
|
||||
|
||||
[ByReference]
|
||||
public Node Node;
|
||||
|
||||
public DateTime LastCheckTime { get; set; }
|
||||
|
||||
public double WarnLower { get; set; } = Double.MinValue;
|
||||
|
|
|
@ -20,6 +20,7 @@ using ln.snmp;
|
|||
using ln.http.resources;
|
||||
using ln.types.odb;
|
||||
using System.Collections.Generic;
|
||||
using ln.types.odb.mapped;
|
||||
namespace ln.skyscanner.checks
|
||||
{
|
||||
public class SkyChecker
|
||||
|
|
|
@ -15,6 +15,7 @@ using System.Linq;
|
|||
using ln.snmp.rfc1213;
|
||||
using ln.types.odb;
|
||||
using ln.types.net;
|
||||
using ln.types.odb.attributes;
|
||||
|
||||
namespace ln.skyscanner.crawl
|
||||
{
|
||||
|
|
|
@ -13,6 +13,7 @@ using ln.types.odb;
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using ln.types.net;
|
||||
using ln.types.odb.attributes;
|
||||
namespace ln.skyscanner.crawl
|
||||
{
|
||||
public class CrawledSubnet
|
||||
|
|
|
@ -21,6 +21,7 @@ using ln.types.odb;
|
|||
using ln.skyscanner.crawl.service;
|
||||
using ln.skyscanner.crawl.tests;
|
||||
using ln.types.net;
|
||||
using ln.types.odb.mapped;
|
||||
|
||||
namespace ln.skyscanner.crawl
|
||||
{
|
||||
|
@ -200,7 +201,7 @@ namespace ln.skyscanner.crawl
|
|||
Query.Equals<CrawledHost>("IPAddresses[]", ip),
|
||||
Query.Equals<CrawledHost>("PrimaryIP", ip)
|
||||
);
|
||||
CrawledHost crawledHost = hosts.Select(nodeByIpQuery).FirstOrDefault();
|
||||
CrawledHost crawledHost = hosts.Query(nodeByIpQuery).FirstOrDefault();
|
||||
if (crawledHost == null)
|
||||
{
|
||||
crawledHost = new CrawledHost();
|
||||
|
@ -217,7 +218,7 @@ namespace ln.skyscanner.crawl
|
|||
lock (this)
|
||||
{
|
||||
Query subnetQuery = Query.Equals<CrawledSubnet>("Network", network);
|
||||
CrawledSubnet sn = CrawledSubnets.Select(subnetQuery).FirstOrDefault();
|
||||
CrawledSubnet sn = CrawledSubnets.Query(subnetQuery).FirstOrDefault();
|
||||
if (sn == null)
|
||||
{
|
||||
Logging.Log(LogLevel.INFO, "Crawler adds new subnet: {0}", network);
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
// /**
|
||||
// * File: ProductionState.cs
|
||||
// * Author: haraldwolff
|
||||
// *
|
||||
// * This file and it's content is copyrighted by the Author and / or copyright holder.
|
||||
// * Any use wihtout proper permission is illegal and may lead to legal actions.
|
||||
// *
|
||||
// *
|
||||
// **/
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
namespace ln.skyscanner.entities
|
||||
{
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum CheckSeverity
|
||||
{
|
||||
OLD = 0,
|
||||
PLANNED = 10,
|
||||
SETUP = 20,
|
||||
TESTING = 30,
|
||||
PRODUCTION = 40,
|
||||
SYSTEMCRITICAL = 50
|
||||
}
|
||||
}
|
|
@ -12,6 +12,7 @@ using ln.types.odb;
|
|||
using ln.types;
|
||||
using Newtonsoft.Json;
|
||||
using ln.types.net;
|
||||
using ln.types.odb.attributes;
|
||||
namespace ln.skyscanner.entities
|
||||
{
|
||||
public class ConfiguredIP
|
||||
|
|
|
@ -53,12 +53,12 @@ namespace ln.skyscanner.entities
|
|||
|
||||
public Node GetNode(Guid id)
|
||||
{
|
||||
return SkyEntities.nodeCollection.Select(id);
|
||||
return SkyEntities.nodeCollection[id];
|
||||
}
|
||||
|
||||
public Subnet FindSubnetForIP(IPv4 ip)
|
||||
{
|
||||
return SkyEntities.subnetCollection.Select(net => net.Network.Contains(ip)).FirstOrDefault();
|
||||
return SkyEntities.subnetCollection.Where((net) => net.Network.Contains(ip)).FirstOrDefault();
|
||||
}
|
||||
|
||||
public IEnumerable<Node> FindHostsInSubnet(Network4 network)
|
||||
|
@ -70,7 +70,7 @@ namespace ln.skyscanner.entities
|
|||
Query.Equals<Node>("Interfaces[].ConfiguredIPs[].Network", network),
|
||||
Query.IF<Node>("PrimaryIP", (ip) => ((firstIP <= ip) && (ip <= lastIP)))
|
||||
);
|
||||
return SkyEntities.nodeCollection.Select(nodeByIpQuery);
|
||||
return SkyEntities.nodeCollection.Query(nodeByIpQuery);
|
||||
}
|
||||
|
||||
public IEnumerable<Node> FindNeighbors(Node node)
|
||||
|
@ -107,11 +107,11 @@ namespace ln.skyscanner.entities
|
|||
|
||||
public Node FindNodeByIP(IPv4 ip)
|
||||
{
|
||||
Node node = SkyEntities.nodeCollection.SelectOne("PrimaryIP", ip);
|
||||
Node node = SkyEntities.nodeCollection.Query("PrimaryIP", ip).FirstOrDefault();
|
||||
if (node == null)
|
||||
{
|
||||
Query nodeByIpQuery = Query.Equals<Node>("Interfaces[].ConfiguredIPs[].IP", ip);
|
||||
node = SkyEntities.nodeCollection.Select(nodeByIpQuery).FirstOrDefault();
|
||||
node = SkyEntities.nodeCollection.Query(nodeByIpQuery).FirstOrDefault();
|
||||
}
|
||||
return node;
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ using ln.types.odb;
|
|||
using Newtonsoft.Json;
|
||||
using ln.logging;
|
||||
using ln.types.net;
|
||||
using ln.types.odb.attributes;
|
||||
namespace ln.skyscanner.entities
|
||||
{
|
||||
public class NetworkInterface
|
||||
|
|
|
@ -15,6 +15,7 @@ using ln.types.odb;
|
|||
using Newtonsoft.Json;
|
||||
using ln.types.threads;
|
||||
using ln.types.net;
|
||||
using ln.types.odb.attributes;
|
||||
namespace ln.skyscanner.entities
|
||||
{
|
||||
public class Node
|
||||
|
@ -37,6 +38,7 @@ namespace ln.skyscanner.entities
|
|||
public string Product { get; set; }
|
||||
|
||||
public string ProductLine { get; set; }
|
||||
public CheckSeverity Severity { get; set; } = CheckSeverity.PLANNED;
|
||||
|
||||
public List<NetworkInterface> Interfaces { get; private set; } = new List<NetworkInterface>();
|
||||
|
||||
|
@ -45,9 +47,17 @@ namespace ln.skyscanner.entities
|
|||
[JsonIgnore]
|
||||
public IEnumerable<Network4> Networks => Interfaces.SelectMany(intf => intf.ConfiguredIPs.Select(nip => nip.Network)).Distinct();
|
||||
[JsonIgnore]
|
||||
public IEnumerable<Subnet> Subnets => SkyScanner.Instance.Entities.subnetCollection.Select("Network", Networks.Select(net => net.Network));
|
||||
public IEnumerable<Subnet> Subnets => SkyScanner.Instance.Entities.subnetCollection.Query(Query.Equals<Network4>("Network", Networks.Select(net => net.Network)));
|
||||
|
||||
public String UniqueIdentity => PrimaryIP.ToString();
|
||||
private string uniqueIdentity;
|
||||
public String UniqueIdentity {
|
||||
get {
|
||||
if (uniqueIdentity == null)
|
||||
uniqueIdentity = PrimaryIP.ToString();
|
||||
return uniqueIdentity;
|
||||
}
|
||||
set => uniqueIdentity = value;
|
||||
}
|
||||
public String[] Checks => checks.ToArray();
|
||||
|
||||
private HashSet<URI> uris = new HashSet<URI>();
|
||||
|
|
|
@ -0,0 +1,45 @@
|
|||
// /**
|
||||
// * File: PointOfPresence.cs
|
||||
// * Author: haraldwolff
|
||||
// *
|
||||
// * This file and it's content is copyrighted by the Author and / or copyright holder.
|
||||
// * Any use wihtout proper permission is illegal and may lead to legal actions.
|
||||
// *
|
||||
// *
|
||||
// **/
|
||||
using System;
|
||||
using ln.types.odb;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using ln.types;
|
||||
using ln.types.odb.attributes;
|
||||
using Newtonsoft.Json;
|
||||
namespace ln.skyscanner.entities
|
||||
{
|
||||
public class PointOfPresence
|
||||
{
|
||||
[DocumentID]
|
||||
public Guid ID = Guid.NewGuid();
|
||||
|
||||
public String Name { get; set; }
|
||||
public String ForeignName { get; set; }
|
||||
|
||||
public GeoLocation GeoLocation { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public Node[] Nodes => SkyScanner.Instance.Entities.nodeCollection.Query(Query.Equals<Node>("ID", nodeIDList.Select(id => ODBMapper.Default.MapValue(id)).ToArray())).ToArray();
|
||||
HashSet<Guid> nodeIDList = new HashSet<Guid>();
|
||||
|
||||
public DateTime Created { get; private set; } = DateTime.Now;
|
||||
|
||||
public PointOfPresence()
|
||||
{
|
||||
}
|
||||
|
||||
public void AddNode(Node node) => nodeIDList.Add(node.ID);
|
||||
public void RemoveNode(Node node) => nodeIDList.Remove(node.ID);
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
|
@ -14,6 +14,7 @@ using System.Collections.Generic;
|
|||
using System.Linq;
|
||||
using ln.types.net;
|
||||
using Newtonsoft.Json;
|
||||
using ln.types.odb.attributes;
|
||||
namespace ln.skyscanner.entities
|
||||
{
|
||||
public class Subnet : Persistent
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
using ln.http;
|
||||
using ln.http.resources;
|
||||
using System.IO;
|
||||
using ln.skyscanner.entities;
|
||||
using ln.skyscanner.checks;
|
||||
namespace ln.skyscanner.http
|
||||
{
|
||||
public class SkyScannerHttpApplication : ResourceApplication
|
||||
|
@ -31,6 +33,12 @@ namespace ln.skyscanner.http
|
|||
refChecker = new ReflectiveResource(RootResource, "checker", SkyScanner.Checker);
|
||||
|
||||
SkyScannerHttpApi api = new SkyScannerHttpApi(this);
|
||||
|
||||
BaseResource collections = new BaseResource(RootResource, "collections");
|
||||
new CollectionResource<PointOfPresence>(collections, skyScanner.Entities.popCollection);
|
||||
new CollectionResource<Node>(collections, skyScanner.Entities.nodeCollection);
|
||||
new CollectionResource<Subnet>(collections, skyScanner.Entities.subnetCollection);
|
||||
new CollectionResource<SkyCheckState>(collections, skyScanner.Checker.checkStates);
|
||||
}
|
||||
|
||||
private Resource ResourceTypeHook(DirectoryResource directoryResource, FileInfo fileInfo)
|
||||
|
|
|
@ -78,6 +78,8 @@
|
|||
<Compile Include="http\CheckerApi.cs" />
|
||||
<Compile Include="checks\Ubiquity.cs" />
|
||||
<Compile Include="checks\SkyCheckState.cs" />
|
||||
<Compile Include="entities\PointOfPresence.cs" />
|
||||
<Compile Include="entities\CheckSeverity.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
|
@ -163,6 +165,37 @@
|
|||
<None Include="templates\static\checks\checkstates.html">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="templates\static\topnav.html">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="templates\static\system\index.html">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="templates\static\network\pops.html">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="templates\static\css\index.html">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="templates\static\css\images\ui-icons_444444_256x240.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="templates\static\css\images\ui-icons_555555_256x240.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="templates\static\css\images\ui-icons_777620_256x240.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="templates\static\css\images\ui-icons_777777_256x240.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="templates\static\css\images\ui-icons_cc0000_256x240.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="templates\static\css\images\ui-icons_ffffff_256x240.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="templates\static\css\images\ui-icons_6495ED_256x240.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="identify\" />
|
||||
|
@ -178,6 +211,7 @@
|
|||
<Folder Include="templates\static\network\" />
|
||||
<Folder Include="http\check\" />
|
||||
<Folder Include="templates\static\checks\" />
|
||||
<Folder Include="templates\static\system\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\ln.snmp\ln.snmp.csproj">
|
||||
|
|
|
@ -20,23 +20,21 @@
|
|||
{ title: "UniqueNodeIdentifier", data: "UniqueNodeIdentifier" },
|
||||
{ title: "LastCheckTime", data: "LastCheckTime" },
|
||||
{ title: "CheckState", data: "CheckState" },
|
||||
{ title: "Check Schwere", data: null, render: function(d,t,r){ return "-"; } },
|
||||
],
|
||||
};
|
||||
ajax: {
|
||||
url: "/collections/SkyCheckState",
|
||||
dataSrc: ""
|
||||
}
|
||||
};
|
||||
|
||||
$("#CheckStates").DataTable( dtDef );
|
||||
|
||||
function refresh()
|
||||
{
|
||||
skyapi().getJson("checker/CheckStates", function(data){
|
||||
if (!data)
|
||||
data = []
|
||||
|
||||
$("#CheckStates").DataTable().clear();
|
||||
$("#CheckStates").DataTable().rows.add( data ).draw();
|
||||
});
|
||||
$("#CheckStates").DataTable().ajax.reload( null, false );
|
||||
}
|
||||
|
||||
refresh();
|
||||
skyapi().addRefresh( refresh, 15 );
|
||||
|
||||
</script>
|
||||
|
|
|
@ -19,40 +19,40 @@
|
|||
<script type="text/javascript">
|
||||
|
||||
var pbar = $().dataTable.render.percentBar('round','#fff', '#FF9CAB', '#FF0033', '#FF9CAB', 0, 'solid');
|
||||
var dtDef = {
|
||||
columns: [
|
||||
var columns = [
|
||||
{ title: "Name", data: "Name" },
|
||||
{ title: "Progress", data: "Progress" },
|
||||
{ title: "State", data: "State" },
|
||||
{ title: "JobState", data: "JobState" }
|
||||
],
|
||||
columnDefs: [
|
||||
];
|
||||
var columnDefs = [
|
||||
{
|
||||
targets: 1,
|
||||
render: function(d, t, row){ d *= 100.0; return pbar(d,t,row); }
|
||||
}
|
||||
]
|
||||
};
|
||||
];
|
||||
|
||||
$("#CurrentPoolJobs").DataTable( dtDef );
|
||||
$("#QueuedPoolJobs").DataTable( dtDef );
|
||||
$("#CurrentPoolJobs").DataTable( {
|
||||
columns: columns,
|
||||
columnDefs: columnDefs,
|
||||
ajax: {
|
||||
url: "/checker/CurrentJobs",
|
||||
dataSrc: ""
|
||||
}
|
||||
} );
|
||||
$("#QueuedPoolJobs").DataTable( {
|
||||
columns: columns,
|
||||
columnDefs: columnDefs,
|
||||
ajax: {
|
||||
url: "/checker/QueuedJobs",
|
||||
dataSrc: ""
|
||||
}
|
||||
});
|
||||
|
||||
function refresh()
|
||||
{
|
||||
skyapi().getJson("checker/CurrentJobs", function(data){
|
||||
if (!data)
|
||||
data = []
|
||||
|
||||
$("#CurrentPoolJobs").DataTable().clear();
|
||||
$("#CurrentPoolJobs").DataTable().rows.add( data ).draw();
|
||||
});
|
||||
skyapi().getJson("checker/QueuedJobs", function(data){
|
||||
if (!data)
|
||||
data = []
|
||||
|
||||
$("#QueuedPoolJobs").DataTable().clear();
|
||||
$("#QueuedPoolJobs").DataTable().rows.add( data ).draw();
|
||||
});
|
||||
$("#CurrentPoolJobs").DataTable().ajax.reload(null, false);
|
||||
$("#QueuedPoolJobs").DataTable().ajax.reload(null, false);
|
||||
}
|
||||
|
||||
skyapi().addRefresh( refresh, 1 );
|
||||
|
|
After Width: | Height: | Size: 6.8 KiB |
After Width: | Height: | Size: 6.9 KiB |
After Width: | Height: | Size: 4.4 KiB |
After Width: | Height: | Size: 4.6 KiB |
After Width: | Height: | Size: 6.8 KiB |
After Width: | Height: | Size: 4.5 KiB |
After Width: | Height: | Size: 6.2 KiB |
|
@ -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>
|
|
@ -73,7 +73,7 @@ button {
|
|||
|
||||
border-bottom: 1px solid black;
|
||||
background-color: #c7def5;
|
||||
padding: 12px;
|
||||
padding: 4px;
|
||||
|
||||
display: flex;
|
||||
|
||||
|
@ -258,3 +258,68 @@ fieldset > label {
|
|||
min-width: 140px;
|
||||
}
|
||||
|
||||
|
||||
.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);
|
||||
}
|
||||
|
|
|
@ -29,28 +29,27 @@
|
|||
<div id="body">
|
||||
<div id="header">
|
||||
<div class="skylogo">
|
||||
<div style="background-color: #009ee3; color: white;">Sky</div><div style="background-color: white;">Scanner</div>
|
||||
<div style="background-color: #009ee3; color: white;">Sky</div><div style="background-color: white;">Scanner</div></div>
|
||||
<%include "topnav.html"%>
|
||||
</div>
|
||||
<div id="indHttpServer" class="indicator" state="STARTED"><div></div>HTTPServer</div>
|
||||
<div id="indManager" class="indicator" state=""><div></div>Manager</div>
|
||||
<div id="indCrawler" class="indicator" state=""><div></div>Crawler</div>
|
||||
<div id="indChecks" class="indicator" state=""><div></div>Checks</div>
|
||||
<div id="indDispatcher" class="indicator" state=""><div></div>Message Dispatcher</div>
|
||||
</div>
|
||||
|
||||
<div id="page">
|
||||
<div id="nav">
|
||||
<%include "nav.html"%>
|
||||
</div>
|
||||
<div id="content">
|
||||
<%=__frame__%>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
<div id="indHttpServer" class="indicator" state="STARTED"><div></div>HTTPServer</div>
|
||||
<div id="indManager" class="indicator" state=""><div></div>Manager</div>
|
||||
<div id="indCrawler" class="indicator" state=""><div></div>Crawler</div>
|
||||
<div id="indChecks" class="indicator" state=""><div></div>Checks</div>
|
||||
<div id="indDispatcher" class="indicator" state=""><div></div>Message Dispatcher</div>
|
||||
<div id="ServerTime" class="right"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$("#header a").on( "click", function(e){ e.preventDefault(); skyapi().loadPage( $(this).attr('href') ); });
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
<%frame "frame.html"%>
|
||||
|
||||
<h1>Network Overview</h1>
|
||||
<h2>Hosts / Nodes</h2>
|
||||
<table id="nodeTable"></table>
|
||||
<h2>Hosts / Nodes <span class="ui-icon ui-icon-refresh" onclick="$('#nodeTable').DataTable().ajax.reload(null, false);"></span></h2>
|
||||
|
||||
<div>
|
||||
<table id="nodeTable"></table>
|
||||
</div>
|
||||
|
||||
<h2>Details</h2>
|
||||
<div class="flex row">
|
||||
|
@ -69,10 +72,11 @@
|
|||
$("#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();
|
||||
});
|
||||
*/
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -100,7 +104,11 @@
|
|||
],
|
||||
select: "single",
|
||||
height: 300,
|
||||
fixedHeader: true
|
||||
fixedHeader: true,
|
||||
ajax: {
|
||||
url: "/collections/Node",
|
||||
dataSrc: ""
|
||||
}
|
||||
})
|
||||
.on( "select", function(e,dt,type,indexes){
|
||||
if (indexes.length > 0)
|
||||
|
@ -115,13 +123,10 @@
|
|||
|
||||
function refreshNodeTable()
|
||||
{
|
||||
skyapi().getJson("entities/Nodes",
|
||||
function(rows){
|
||||
$("#nodeTable").DataTable().clear().rows.add( rows ).draw();
|
||||
});
|
||||
$("#nodeTable").DataTable().ajax.reload(null, false);
|
||||
}
|
||||
|
||||
showNode(null);
|
||||
refreshNodeTable();
|
||||
//refreshNodeTable();
|
||||
|
||||
</script>
|
||||
|
|
|
@ -0,0 +1,107 @@
|
|||
<%frame "frame.html"%>
|
||||
|
||||
<h1>Points of Presence</h1>
|
||||
<br/>
|
||||
<h2>List <span class="ui-icon ui-icon-refresh" onclick="$('#popTable').DataTable().ajax.reload(null, false);"></span></h2>
|
||||
<br/>
|
||||
<table id="popTable"></table>
|
||||
|
||||
<br/>
|
||||
<div id="details">
|
||||
<h2>Details <span class="ui-icon ui-icon-circle-plus" onclick="createPOP();"></span></h2>
|
||||
<fieldset>
|
||||
<label for="">Bezeichnung</label><input type="text" id="Name"><br/>
|
||||
<label for="">Sender#</label><input type="text" id="ForeignName"><br/>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<label for="">Standort</label><input type="text" id="Latitude"><br/>
|
||||
<label for=""></label><input type="text" id="Longitude"><br/>
|
||||
</fieldset>
|
||||
<button onclick="savePOP();">Speichern</button>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var currentPOP = null;
|
||||
|
||||
$("#popTable").DataTable({
|
||||
columns: [
|
||||
{ title: "", data: null },
|
||||
{ title: "Bezeichnung", data: "Name" },
|
||||
{ title: "Sender#", data: "ForeignName" },
|
||||
{ title: "Erstellt", data: "Created" },
|
||||
{ title: "Geräte", data: null, render: function(d,t,r){ return "N/A"; } },
|
||||
{ title: "Standort", data: "GeoLocation", render: function(d,t,r){ return d.Latitude + "/" + d.Longitude; } }
|
||||
],
|
||||
columnDefs: [
|
||||
{ targets: 0, data: null, defaultContent: "<span class='ui-icon ui-icon-info'></span>" }
|
||||
],
|
||||
select: "single",
|
||||
height: 300,
|
||||
fixedHeader: true,
|
||||
ajax: {
|
||||
url: "/collections/PointOfPresence",
|
||||
dataSrc: ''
|
||||
},
|
||||
serverSide: false,
|
||||
})
|
||||
.on( "select", function(e,dt,type,indexes){
|
||||
if (indexes.length > 0)
|
||||
showPOP(dt.rows( indexes ).data()[0]);
|
||||
})
|
||||
.on( "deselect", function(e,dt,type,indexes){
|
||||
showPOP(null);
|
||||
});
|
||||
|
||||
function refreshPopTable()
|
||||
{
|
||||
$("#popTable").DataTable().ajax.reload(null, false);
|
||||
}
|
||||
|
||||
function showPOP(pop)
|
||||
{
|
||||
currentPOP = pop;
|
||||
if (pop)
|
||||
{
|
||||
$("#Name").val(pop.Name);
|
||||
$("#ForeignName").val(pop.ForeignName);
|
||||
|
||||
$("#details input").removeAttr("disabled");
|
||||
} else {
|
||||
$("#details input").prop("disabled","disabled");
|
||||
}
|
||||
}
|
||||
|
||||
function createPOP()
|
||||
{
|
||||
var pop = {
|
||||
Name: "noname",
|
||||
ForeignName: "",
|
||||
GeoLocation: {
|
||||
Latitude: 0,
|
||||
Longitude: 0
|
||||
}
|
||||
};
|
||||
showPOP(pop);
|
||||
}
|
||||
|
||||
function savePOP()
|
||||
{
|
||||
if (currentPOP)
|
||||
{
|
||||
currentPOP.Name = $('#Name').val();
|
||||
currentPOP.ForeignName = $('#ForeignName').val();
|
||||
currentPOP.GeoLocation.Latitude = parseFloat($('#Latitude').val()) || 0;
|
||||
currentPOP.GeoLocation.Longitude = parseFloat($('#Longitude').val()) || 0;
|
||||
|
||||
if (currentPOP.ID)
|
||||
{
|
||||
skyapi().put("/collections/PointOfPresence/" + currentPOP.ID, currentPOP, function(pop){ showPOP(pop); refreshPopTable(); } );
|
||||
} else
|
||||
{
|
||||
skyapi().post("/collections/PointOfPresence",currentPOP, function(pop){ showPOP(pop); refreshPopTable(); } );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
showPOP(null);
|
||||
</script>
|
|
@ -5,44 +5,40 @@ function SKYAPI(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.get = function(page, handler = null){
|
||||
var x = new XMLHttpRequest();
|
||||
var async = (handler != null);
|
||||
|
||||
if (async)
|
||||
{
|
||||
x.onload = function(){
|
||||
var responseText = x.responseText;
|
||||
handler( responseText );
|
||||
}
|
||||
}
|
||||
x.open("GET", this.baseurl + page, async);
|
||||
x.send();
|
||||
|
||||
if (!async)
|
||||
return x.responseText
|
||||
}
|
||||
this.post = function(page, handler = null){
|
||||
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;
|
||||
handler( responseText );
|
||||
if (json && !content)
|
||||
handler( JSON.parse( responseText ) );
|
||||
else
|
||||
handler( responseText );
|
||||
}
|
||||
}
|
||||
x.open("POST", this.baseurl + page);
|
||||
x.send();
|
||||
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, j );
|
||||
return this.get( page, null, j );
|
||||
}
|
||||
|
||||
this.call = function(endpoint,method,parameters = [], receiver = null){
|
||||
|
@ -76,9 +72,11 @@ function SKYAPI(baseurl){
|
|||
}
|
||||
|
||||
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()
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
<%frame "frame.html"%>
|
||||
<div>
|
||||
<h1>Modul Steuerung</h1>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<table style="width: 60%;">
|
||||
<tr>
|
||||
<td>System</td>
|
||||
<td></td>
|
||||
<td style="width: 100px;"></td>
|
||||
<td style="width: 100px;"><button onclick="skyapi().call('api/management','Shutdown')">Shutdown</button></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Crawler</td>
|
||||
<td></td>
|
||||
<td style="width: 100px;"><button onclick="skyapi().call('api/management','StartCrawler')">Start</button></td>
|
||||
<td style="width: 100px;"><button onclick="skyapi().call('api/management','StopCrawler')">Stop</button></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td style="width: 100px;"><input type="checkbox" id="cbCrawlHosts"/><label for="cbCrawlHosts">Hosts</label></td>
|
||||
<td style="width: 100px;"><input type="checkbox" id="cbCrawlSubnets"/><label for="cbCrawlSubnets">Subnets</label></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
|
@ -0,0 +1,75 @@
|
|||
<div class="popup">Netz Status
|
||||
<div>
|
||||
<div>
|
||||
<a href="/static/summary.html"><div>Störfälle</div></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="popup">Netz Struktur
|
||||
<div>
|
||||
<div>
|
||||
<a href="/static/network/pops.html"><div>PoP Liste</div></a>
|
||||
</div>
|
||||
<div>
|
||||
<a href="/static/network/index.html"><div>PtP Strecken</div></a>
|
||||
</div>
|
||||
<div>
|
||||
<a href="/static/network/index.html"><div>PtmP Stationen</div></a>
|
||||
</div>
|
||||
<div>
|
||||
<a href="/static/network/hoptable.html"><div>Topologie: technisch</div></a>
|
||||
</div>
|
||||
<div>
|
||||
<a href="/static/network/hoptable.html"><div>Topologie: geographisch</div></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="popup">Crawler
|
||||
<div>
|
||||
<div>
|
||||
<a href="/static/crawlerhosts.html"><div>Hosts</div></a>
|
||||
</div>
|
||||
<div>
|
||||
<a href="/static/crawlersubnets.html"><div>Subnets</div></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="popup">Struktur
|
||||
<div>
|
||||
<div>
|
||||
<a href="/static/network/index.html"><div>Übersicht</div></a>
|
||||
</div>
|
||||
<div>
|
||||
<a href="/static/network/hoptable.html"><div>Hop Table</div></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="popup">Überwachung
|
||||
<div>
|
||||
<div>
|
||||
<a href="/static/checks/status.html"><div>Status</div></a>
|
||||
</div>
|
||||
<div>
|
||||
<a href="/static/checks/index.html"><div>Checks</div></a>
|
||||
</div>
|
||||
<div>
|
||||
<a href="/static/checks/checkstates.html"><div>Check States</div></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="popup">System
|
||||
<div>
|
||||
<div>
|
||||
<a href="/static/system/index.html"><div>Modul Steuerung</div></a>
|
||||
</div>
|
||||
<div>
|
||||
<a href="/static/log.html"><div>Logging</div></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|