diff --git a/checks/APC.cs b/checks/APC.cs index bc876bd..dbd0068 100644 --- a/checks/APC.cs +++ b/checks/APC.cs @@ -52,29 +52,29 @@ namespace ln.skyscanner.checks double voltage = (double)((Integer)(input[1].Items[1])).LongValue; double current = (double)((Integer)(input[2].Items[1])).LongValue; - node.WritePerformanceValue(checkService.PerformanceValueService, Name, String.Format("ups_input_{0}_frequency", n), frequency, wLower: 48, wUpper: 52, cLower: 45, cUpper: 55); - node.WritePerformanceValue(checkService.PerformanceValueService, Name, String.Format("ups_input_{0}_voltage", n), voltage, wLower: 218.5, wUpper: 238, cLower: 212, cUpper: 245); - node.WritePerformanceValue(checkService.PerformanceValueService, Name, String.Format("ups_input_{0}_current", n), current); + node.WritePerformanceValue(checkService.PerformanceValueService, Name, String.Format("ups_input_{0}_frequency", n), frequency, 48, 52, 45, 55, "Hz"); + node.WritePerformanceValue(checkService.PerformanceValueService, Name, String.Format("ups_input_{0}_voltage", n), voltage, 218.5, 238, 212, 245, "V"); + node.WritePerformanceValue(checkService.PerformanceValueService, Name, String.Format("ups_input_{0}_current", n), current, perfUnit: "A"); n++; } n = 0; foreach (Sequence[] output in outputs) { - node.WritePerformanceValue(checkService.PerformanceValueService, Name, String.Format("ups_output_{0}_voltage", n), (double)((Integer)(output[0].Items[1])).LongValue, wLower: 218.5, wUpper: 238, cLower: 212, cUpper: 245); - node.WritePerformanceValue(checkService.PerformanceValueService, Name, String.Format("ups_output_{0}_current", n), (double)((Integer)(output[1].Items[1])).LongValue / 10.0); - node.WritePerformanceValue(checkService.PerformanceValueService, Name, String.Format("ups_output_{0}_load", n), (double)((Integer)(output[2].Items[1])).LongValue, wUpper: 50, cUpper: 75); + node.WritePerformanceValue(checkService.PerformanceValueService, Name, String.Format("ups_output_{0}_voltage", n), (double)((Integer)(output[0].Items[1])).LongValue, 218.5, 238, 212, 245, "V"); + node.WritePerformanceValue(checkService.PerformanceValueService, Name, String.Format("ups_output_{0}_current", n), (double)((Integer)(output[1].Items[1])).LongValue / 10.0, perfUnit: "A"); + node.WritePerformanceValue(checkService.PerformanceValueService, Name, String.Format("ups_output_{0}_load", n), (double)((Integer)(output[2].Items[1])).LongValue, 50, 75, perfUnit: "%"); n++; } n = 0; foreach (Sequence[] battery in batteries) { - node.WritePerformanceValue(checkService.PerformanceValueService, Name, String.Format("ups_battery_{0}_status", n), (double)((Integer)(battery[0].Items[1])).LongValue); - node.WritePerformanceValue(checkService.PerformanceValueService, Name, String.Format("ups_battery_{0}_minutes_remain", n), (double)((Integer)(battery[1].Items[1])).LongValue, wLower: 20, cLower: 10); - node.WritePerformanceValue(checkService.PerformanceValueService, Name, String.Format("ups_battery_{0}_capacity", n), (double)((Integer)(battery[2].Items[1])).LongValue, wLower: 75, cLower: 50); - node.WritePerformanceValue(checkService.PerformanceValueService, Name, String.Format("ups_battery_{0}_voltage", n), (double)((Integer)(battery[3].Items[1])).LongValue / 10.0); - node.WritePerformanceValue(checkService.PerformanceValueService, Name, String.Format("ups_battery_{0}_temperature", n), (double)((Integer)(battery[4].Items[1])).LongValue, wUpper: 40, cUpper: 60); + node.WritePerformanceValue(checkService.PerformanceValueService, Name, String.Format("ups_battery_{0}_status", n), (double)((Integer)(battery[0].Items[1])).LongValue, perfUnit: ""); + node.WritePerformanceValue(checkService.PerformanceValueService, Name, String.Format("ups_battery_{0}_minutes_remain", n), (double)((Integer)(battery[1].Items[1])).LongValue, wLower: 20, cLower: 10, perfUnit: "min"); + node.WritePerformanceValue(checkService.PerformanceValueService, Name, String.Format("ups_battery_{0}_capacity", n), (double)((Integer)(battery[2].Items[1])).LongValue / 100.0, wLower: 0.75, cLower: 0.50, perfUnit: "%"); + node.WritePerformanceValue(checkService.PerformanceValueService, Name, String.Format("ups_battery_{0}_voltage", n), (double)((Integer)(battery[3].Items[1])).LongValue / 10.0, perfUnit: "V"); + node.WritePerformanceValue(checkService.PerformanceValueService, Name, String.Format("ups_battery_{0}_temperature", n), (double)((Integer)(battery[4].Items[1])).LongValue, wUpper: 40, cUpper: 60, perfUnit: "°C"); n++; } diff --git a/checks/CheckJob.cs b/checks/CheckJob.cs index 760a519..55f8393 100644 --- a/checks/CheckJob.cs +++ b/checks/CheckJob.cs @@ -62,7 +62,9 @@ namespace ln.skyscanner.checks { checkState.CheckHistory(); } - + } catch (TimeoutException te) + { + Logging.Log(LogLevel.WARNING, "CheckJob {0} for {1} ({3}) ran into timeout: {2}",checks[n].Name,Node.UniqueIdentity,te.Message,Node.Name); } catch (Exception e) { Logging.Log(LogLevel.WARNING, "Exception caught by CheckJob {0} [{1} / {3}]: {2}", checks[n].Name,Node.Name,e,Node.UniqueIdentity); diff --git a/checks/Mimosa.cs b/checks/Mimosa.cs index 5091871..e500243 100644 --- a/checks/Mimosa.cs +++ b/checks/Mimosa.cs @@ -21,34 +21,27 @@ namespace ln.skyscanner.checks foreach (URI snmpUri in node.FindURIs("snmp")) { - try + using (SnmpInterface snmp = SnmpInterface.FromURI(snmpUri, checkService.SNMPEngine)) { - using (SnmpInterface snmp = SnmpInterface.FromURI(snmpUri, checkService.SNMPEngine)) + Sequence[][] sigData = snmp.snmpWalk(new string[] { + "1.3.6.1.4.1.43356.2.1.2.6.1.1.3", // Signal Level + "1.3.6.1.4.1.43356.2.1.2.6.1.1.5", // SNR + }); + + for (int n = 0; n < 4; n++) { - Sequence[][] sigData = snmp.snmpWalk(new string[] { - "1.3.6.1.4.1.43356.2.1.2.6.1.1.3", // Signal Level - "1.3.6.1.4.1.43356.2.1.2.6.1.1.5", // SNR - }); + if ((sigData.Length <= n)) + break; - for (int n = 0; n < 4; n++) - { - if ((sigData.Length <= n)) - break; - - double sig = (sigData[n][0].Items[1] as Integer).LongValue / 10.0; - double snr = (sigData[n][1].Items[1] as Integer).LongValue / 10.0; - - node.WritePerformanceValue(checkService.PerformanceValueService, Name, String.Format("ptp_rx_pwr_{0}",n), sig, -75.0, 0, -80.0, 0,"dBm",n.ToString()); - node.WritePerformanceValue(checkService.PerformanceValueService, Name, String.Format("ptp_rx_snr_{0}",n), snr, 12, 99, 8, 99,"dB", n.ToString()); - } + double sig = (sigData[n][0].Items[1] as Integer).LongValue / 10.0; + double snr = (sigData[n][1].Items[1] as Integer).LongValue / 10.0; + node.WritePerformanceValue(checkService.PerformanceValueService, Name, String.Format("ptp_rx_pwr_{0}",n), sig, -75.0, 0, -80.0, 0,"dBm",n.ToString()); + node.WritePerformanceValue(checkService.PerformanceValueService, Name, String.Format("ptp_rx_snr_{0}",n), snr, 12, 99, 8, 99,"dB", n.ToString()); } - break; - } catch (Exception e) - { - Logging.Log(LogLevel.ERROR, "Exception caught in Mimosa(SkyCheck): {0}", e); - Logging.Log(e); + } + break; } } public override bool IsValid(Node node) diff --git a/checks/SikluCheck.cs b/checks/SikluCheck.cs index 94843dd..a0c49b1 100644 --- a/checks/SikluCheck.cs +++ b/checks/SikluCheck.cs @@ -33,8 +33,8 @@ namespace ln.skyscanner.checks foreach (Sequence[] row in ptp) { node.WritePerformanceValue(checkService.PerformanceValueService, Name, String.Format("ptp_rx_pwr_{0}", n), (double)((Integer)(row[0].Items[1])).LongValue, -75.0, 0, -80.0, 0); - node.WritePerformanceValue(checkService.PerformanceValueService, Name, String.Format("ptp_tx_snr_{0}", n), (double)((Integer)(row[1].Items[1])).LongValue); - node.WritePerformanceValue(checkService.PerformanceValueService, Name, String.Format("ptp_tx_pwr_{0}", n), (double)((Integer)(row[2].Items[1])).LongValue); + node.WritePerformanceValue(checkService.PerformanceValueService, Name, String.Format("ptp_tx_snr_{0}", n), (double)((Integer)(row[1].Items[1])).LongValue, perfUnit: "dB"); + node.WritePerformanceValue(checkService.PerformanceValueService, Name, String.Format("ptp_tx_pwr_{0}", n), (double)((Integer)(row[2].Items[1])).LongValue, perfUnit: "dBm"); /* long rxBytes = ((Integer)(row[4].Items[1])).LongValue; long txBytes = ((Integer)(row[5].Items[1])).LongValue; diff --git a/checks/SkyCheckState.cs b/checks/SkyCheckState.cs index 90c0176..7a27d83 100644 --- a/checks/SkyCheckState.cs +++ b/checks/SkyCheckState.cs @@ -77,6 +77,8 @@ namespace ln.skyscanner.checks if ((history.Count == 0) || (history[history.Count - 1].NewState != CheckState)) { history.Add(new CheckStateChange(CheckState)); + if (history.Count > 10) + history.RemoveAt(0); } } diff --git a/checks/Ubiquiti.cs b/checks/Ubiquiti.cs index 45fc505..f554b74 100644 --- a/checks/Ubiquiti.cs +++ b/checks/Ubiquiti.cs @@ -23,7 +23,7 @@ namespace ln.skyscanner.checks foreach (URI snmpUri in node.FindURIs("snmp")) { - using (SnmpInterface snmp = SnmpInterface.FromURI(snmpUri,checkService.SNMPEngine)) + using (SnmpInterface snmp = SnmpInterface.FromURI(snmpUri, checkService.SNMPEngine)) { List mibs = null; try @@ -38,7 +38,8 @@ namespace ln.skyscanner.checks mibs.Add((s.Items[1] as ObjectIdentifier).AsString); } - } catch (TimeoutException) + } + catch (TimeoutException) { } @@ -55,10 +56,10 @@ namespace ln.skyscanner.checks foreach (Sequence[] row in ptp) { - node.WritePerformanceValue(checkService.PerformanceValueService, Name, "ptp_rx_capa", (double)((Integer)(row[0].Items[1])).LongValue); - node.WritePerformanceValue(checkService.PerformanceValueService, Name, "ptp_tx_capa", (double)((Integer)(row[1].Items[1])).LongValue); - node.WritePerformanceValue(checkService.PerformanceValueService, Name, "ptp_rx_pwr", (double)((Integer)(row[2].Items[1])).LongValue, -75.0, 0, -80.0, 0); - node.WritePerformanceValue(checkService.PerformanceValueService, Name, "ptp_tx_pwr", (double)((Integer)(row[3].Items[1])).LongValue); + node.WritePerformanceValue(checkService.PerformanceValueService, Name, "ptp_rx_capa", (double)((Integer)(row[0].Items[1])).LongValue, perfUnit: "bit/s"); + node.WritePerformanceValue(checkService.PerformanceValueService, Name, "ptp_tx_capa", (double)((Integer)(row[1].Items[1])).LongValue, perfUnit: "bit/s"); + node.WritePerformanceValue(checkService.PerformanceValueService, Name, "ptp_rx_pwr", (double)((Integer)(row[2].Items[1])).LongValue, -75.0, 0, -80.0, 0, perfUnit: "dBm"); + node.WritePerformanceValue(checkService.PerformanceValueService, Name, "ptp_tx_pwr", (double)((Integer)(row[3].Items[1])).LongValue, perfUnit: "dBm"); long rxBytes = ((Integer)(row[4].Items[1])).LongValue; long txBytes = ((Integer)(row[5].Items[1])).LongValue; @@ -66,8 +67,8 @@ namespace ln.skyscanner.checks ubiquityCheckState.RXRate.Update(rxBytes * 8); ubiquityCheckState.TXRate.Update(txBytes * 8); - node.WritePerformanceValue(checkService.PerformanceValueService, Name, "ptp_rx_rate", ubiquityCheckState.RXRate.Current); - node.WritePerformanceValue(checkService.PerformanceValueService, Name, "ptp_tx_rate", ubiquityCheckState.TXRate.Current); + node.WritePerformanceValue(checkService.PerformanceValueService, Name, "ptp_rx_rate", ubiquityCheckState.RXRate.Current, perfUnit: "bit/s"); + node.WritePerformanceValue(checkService.PerformanceValueService, Name, "ptp_tx_rate", ubiquityCheckState.TXRate.Current, perfUnit: "bit/s"); } } } diff --git a/entities/Node.cs b/entities/Node.cs index e332cda..ee87667 100644 --- a/entities/Node.cs +++ b/entities/Node.cs @@ -145,7 +145,7 @@ namespace ln.skyscanner.entities // performanceValues[Name] = performanceValue; //} - public void WritePerformanceValue(PerformanceValueService performanceValueService, String checkName, String perfName, double value, double wLower = Double.MinValue, double wUpper = Double.MaxValue, double cLower = Double.MinValue, double cUpper = Double.MaxValue,String perfUnit = "",String group = "",double exMin = double.MinValue,double exMax = double.MaxValue) + public void WritePerformanceValue(PerformanceValueService performanceValueService, String checkName, String perfName, double value, double wLower = Double.MinValue, double wUpper = Double.MaxValue, double cLower = Double.MinValue, double cUpper = Double.MaxValue, String perfUnit = "", String group = "", double exMin = double.MinValue, double exMax = double.MaxValue) { string[] perfPath = new string[] { UniqueIdentity, checkName, perfName }; perfName = string.Join("/", perfPath); diff --git a/ln.skyscanner.csproj b/ln.skyscanner.csproj index a6c83af..1ad28a7 100644 --- a/ln.skyscanner.csproj +++ b/ln.skyscanner.csproj @@ -46,7 +46,7 @@ ..\packages\BouncyCastle.1.8.5\lib\BouncyCastle.Crypto.dll - ..\packages\Google.Protobuf.3.9.1\lib\net45\Google.Protobuf.dll + packages\Google.Protobuf.3.10.0\lib\net45\Google.Protobuf.dll ..\packages\SSH.NET.2016.1.0\lib\net40\Renci.SshNet.dll @@ -274,6 +274,21 @@ PreserveNewest + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + @@ -290,6 +305,7 @@ + diff --git a/packages.config b/packages.config index 1f19f06..153955e 100644 --- a/packages.config +++ b/packages.config @@ -1,7 +1,7 @@  - + \ No newline at end of file diff --git a/services/CheckService.cs b/services/CheckService.cs index 692a1eb..7a95431 100644 --- a/services/CheckService.cs +++ b/services/CheckService.cs @@ -10,6 +10,7 @@ using ln.types.threads; using System.Linq; using ln.snmp; using ln.types.odb.ng; +using ln.types.odb.ng.storage.session; namespace ln.skyscanner.services { @@ -61,7 +62,7 @@ namespace ln.skyscanner.services RPC = new CheckServiceRPC(this); coreService.RPCContainer.Add("CheckService",RPC); - using (Session session = new Session(entityService.StorageContainer)) + using (SessionStorageContainer session = new SessionStorageContainer(entityService.StorageContainer)) { SessionMapper = new Mapper(session); @@ -121,24 +122,27 @@ namespace ln.skyscanner.services { Logging.Log(LogLevel.DEBUG, "CheckService: Synchronizing CheckJobs"); - HashSet knownNodes = new HashSet(SessionMapper.Load()); - HashSet currentNodes = new HashSet(checkJobs.Keys); + HashSet knownNodes = Timing.Meassure("knownNodes: ", () => new HashSet(SessionMapper.Load())); + HashSet currentNodes = Timing.Meassure("currentNodes: ", () => new HashSet(checkJobs.Keys)); - foreach (Node node in knownNodes) + Timing.Meassure("synchronization", () => { - if (!currentNodes.Contains(node)) + foreach (Node node in knownNodes) { - CheckJob checkJob = new CheckJob(this, node); - checkJobs.Add(node, checkJob); + if (!currentNodes.Contains(node)) + { + CheckJob checkJob = new CheckJob(this, node); + checkJobs.Add(node, checkJob); + } } - } - foreach (Node node in currentNodes) - { - if (!knownNodes.Contains(node)) + foreach (Node node in currentNodes) { - checkJobs.Remove(node); + if (!knownNodes.Contains(node)) + { + checkJobs.Remove(node); + } } - } + }); } } diff --git a/services/EntityService.cs b/services/EntityService.cs index 2b43274..246aed5 100644 --- a/services/EntityService.cs +++ b/services/EntityService.cs @@ -11,6 +11,9 @@ using ln.types.odb.ng.storage; using System.Linq; using ln.types.net; using ln.skyscanner.import.skytron; +using ln.types.odb.ng.storage.fs; +using ln.types.odb.ng.storage.session; + namespace ln.skyscanner.services { public class EntityService : ApplicationServiceBase @@ -45,7 +48,7 @@ namespace ln.skyscanner.services Logging.Log(LogLevel.INFO, "Entity Service: Initializing"); StorageContainer = new FSStorageContainer(System.IO.Path.Combine(BasePath, "storage")); - StorageSession = new Session(StorageContainer); + StorageSession = new SessionStorageContainer(StorageContainer); SessionMapper = new Mapper(StorageSession); StorageContainer.Open(); @@ -116,12 +119,13 @@ namespace ln.skyscanner.services public Node GetNode(Guid nodeID) { - return EntityService.SessionMapper.Load(Query.Equals("ID", nodeID)).FirstOrDefault(); + Node node = EntityService.SessionMapper.Load(Query.Equals("ID", nodeID),true).FirstOrDefault(); + return node; } public Node[] GetNodes() { - return EntityService.SessionMapper.Load().ToArray(); + return EntityService.SessionMapper.Load(true).ToArray(); } public Node CreateNode() diff --git a/www/css/style.css b/www/css/style.css index 99e7eda..b5607be 100644 --- a/www/css/style.css +++ b/www/css/style.css @@ -33,6 +33,27 @@ a { color: inherit; } +a::before { + font-style: normal; + font-weight: normal; + display: inline-block; + text-decoration: inherit; + width: 1em; + height: 1.5em; + font-size: 1em; + text-align: center; + vertical-align: middle; + -webkit-font-smoothing: antialiased; + text-rendering: optimizeLegibility; + font-family: typicons; + content: '\e01a'; +} + +.plain::before { + display: none; + content: ''; +} + /* table td { vertical-align: top; diff --git a/www/css/typicons.css b/www/css/typicons.css new file mode 100644 index 0000000..ca22f13 --- /dev/null +++ b/www/css/typicons.css @@ -0,0 +1,1040 @@ +@charset 'UTF-8'; + +/* @FONT-FACE loads font into browser */ +@font-face { + font-family: 'typicons'; + font-weight: normal; + font-style: normal; + src: url('/fonts/typicons.eot'); + src: url('/fonts/typicons.eot?#iefix') format('embedded-opentype'), + url('/fonts/typicons.woff') format('woff'), + url('/fonts/typicons.ttf') format('truetype'), + url('/fonts/typicons.svg#typicons') format('svg'); +} + +/* :before psuedo-selector inserts and styles icon */ +.typcn:before { + font-family: 'typicons'; + font-style: normal; + font-weight: normal; + speak: none; + display: inline-block; + text-decoration: inherit; + width: 1em; + height: 1em; + font-size: 1em; + text-align: center; + -webkit-font-smoothing: antialiased; + font-smoothing: antialiased; + text-rendering: optimizeLegibility; +} + +/* Code for individual icons */ +.typcn-adjust-brightness:before { + content: '\e000'; /* '' */ +} +.typcn-adjust-contrast:before { + content: '\e001'; /* '' */ +} +.typcn-anchor-outline:before { + content: '\e002'; /* '' */ +} +.typcn-anchor:before { + content: '\e003'; /* '' */ +} +.typcn-archive:before { + content: '\e004'; /* '' */ +} +.typcn-arrow-back-outline:before { + content: '\e005'; /* '' */ +} +.typcn-arrow-back:before { + content: '\e006'; /* '' */ +} +.typcn-arrow-down-outline:before { + content: '\e007'; /* '' */ +} +.typcn-arrow-down-thick:before { + content: '\e008'; /* '' */ +} +.typcn-arrow-down:before { + content: '\e009'; /* '' */ +} +.typcn-arrow-forward-outline:before { + content: '\e00a'; /* '' */ +} +.typcn-arrow-forward:before { + content: '\e00b'; /* '' */ +} +.typcn-arrow-left-outline:before { + content: '\e00c'; /* '' */ +} +.typcn-arrow-left-thick:before { + content: '\e00d'; /* '' */ +} +.typcn-arrow-left:before { + content: '\e00e'; /* '' */ +} +.typcn-arrow-loop-outline:before { + content: '\e00f'; /* '' */ +} +.typcn-arrow-loop:before { + content: '\e010'; /* '' */ +} +.typcn-arrow-maximise-outline:before { + content: '\e011'; /* '' */ +} +.typcn-arrow-maximise:before { + content: '\e012'; /* '' */ +} +.typcn-arrow-minimise-outline:before { + content: '\e013'; /* '' */ +} +.typcn-arrow-minimise:before { + content: '\e014'; /* '' */ +} +.typcn-arrow-move-outline:before { + content: '\e015'; /* '' */ +} +.typcn-arrow-move:before { + content: '\e016'; /* '' */ +} +.typcn-arrow-repeat-outline:before { + content: '\e017'; /* '' */ +} +.typcn-arrow-repeat:before { + content: '\e018'; /* '' */ +} +.typcn-arrow-right-outline:before { + content: '\e019'; /* '' */ +} +.typcn-arrow-right-thick:before { + content: '\e01a'; /* '' */ +} +.typcn-arrow-right:before { + content: '\e01b'; /* '' */ +} +.typcn-arrow-shuffle:before { + content: '\e01c'; /* '' */ +} +.typcn-arrow-sorted-down:before { + content: '\e01d'; /* '' */ +} +.typcn-arrow-sorted-up:before { + content: '\e01e'; /* '' */ +} +.typcn-arrow-sync-outline:before { + content: '\e01f'; /* '' */ +} +.typcn-arrow-sync:before { + content: '\e020'; /* '' */ +} +.typcn-arrow-unsorted:before { + content: '\e021'; /* '' */ +} +.typcn-arrow-up-outline:before { + content: '\e022'; /* '' */ +} +.typcn-arrow-up-thick:before { + content: '\e023'; /* '' */ +} +.typcn-arrow-up:before { + content: '\e024'; /* '' */ +} +.typcn-at:before { + content: '\e025'; /* '' */ +} +.typcn-attachment-outline:before { + content: '\e026'; /* '' */ +} +.typcn-attachment:before { + content: '\e027'; /* '' */ +} +.typcn-backspace-outline:before { + content: '\e028'; /* '' */ +} +.typcn-backspace:before { + content: '\e029'; /* '' */ +} +.typcn-battery-charge:before { + content: '\e02a'; /* '' */ +} +.typcn-battery-full:before { + content: '\e02b'; /* '' */ +} +.typcn-battery-high:before { + content: '\e02c'; /* '' */ +} +.typcn-battery-low:before { + content: '\e02d'; /* '' */ +} +.typcn-battery-mid:before { + content: '\e02e'; /* '' */ +} +.typcn-beaker:before { + content: '\e02f'; /* '' */ +} +.typcn-beer:before { + content: '\e030'; /* '' */ +} +.typcn-bell:before { + content: '\e031'; /* '' */ +} +.typcn-book:before { + content: '\e032'; /* '' */ +} +.typcn-bookmark:before { + content: '\e033'; /* '' */ +} +.typcn-briefcase:before { + content: '\e034'; /* '' */ +} +.typcn-brush:before { + content: '\e035'; /* '' */ +} +.typcn-business-card:before { + content: '\e036'; /* '' */ +} +.typcn-calculator:before { + content: '\e037'; /* '' */ +} +.typcn-calendar-outline:before { + content: '\e038'; /* '' */ +} +.typcn-calendar:before { + content: '\e039'; /* '' */ +} +.typcn-camera-outline:before { + content: '\e03a'; /* '' */ +} +.typcn-camera:before { + content: '\e03b'; /* '' */ +} +.typcn-cancel-outline:before { + content: '\e03c'; /* '' */ +} +.typcn-cancel:before { + content: '\e03d'; /* '' */ +} +.typcn-chart-area-outline:before { + content: '\e03e'; /* '' */ +} +.typcn-chart-area:before { + content: '\e03f'; /* '' */ +} +.typcn-chart-bar-outline:before { + content: '\e040'; /* '' */ +} +.typcn-chart-bar:before { + content: '\e041'; /* '' */ +} +.typcn-chart-line-outline:before { + content: '\e042'; /* '' */ +} +.typcn-chart-line:before { + content: '\e043'; /* '' */ +} +.typcn-chart-pie-outline:before { + content: '\e044'; /* '' */ +} +.typcn-chart-pie:before { + content: '\e045'; /* '' */ +} +.typcn-chevron-left-outline:before { + content: '\e046'; /* '' */ +} +.typcn-chevron-left:before { + content: '\e047'; /* '' */ +} +.typcn-chevron-right-outline:before { + content: '\e048'; /* '' */ +} +.typcn-chevron-right:before { + content: '\e049'; /* '' */ +} +.typcn-clipboard:before { + content: '\e04a'; /* '' */ +} +.typcn-cloud-storage:before { + content: '\e04b'; /* '' */ +} +.typcn-cloud-storage-outline:before { + content: '\e054'; /* '' */ +} +.typcn-code-outline:before { + content: '\e04c'; /* '' */ +} +.typcn-code:before { + content: '\e04d'; /* '' */ +} +.typcn-coffee:before { + content: '\e04e'; /* '' */ +} +.typcn-cog-outline:before { + content: '\e04f'; /* '' */ +} +.typcn-cog:before { + content: '\e050'; /* '' */ +} +.typcn-compass:before { + content: '\e051'; /* '' */ +} +.typcn-contacts:before { + content: '\e052'; /* '' */ +} +.typcn-credit-card:before { + content: '\e053'; /* '' */ +} +.typcn-css3:before { + content: '\e055'; /* '' */ +} +.typcn-database:before { + content: '\e056'; /* '' */ +} +.typcn-delete-outline:before { + content: '\e057'; /* '' */ +} +.typcn-delete:before { + content: '\e058'; /* '' */ +} +.typcn-device-desktop:before { + content: '\e059'; /* '' */ +} +.typcn-device-laptop:before { + content: '\e05a'; /* '' */ +} +.typcn-device-phone:before { + content: '\e05b'; /* '' */ +} +.typcn-device-tablet:before { + content: '\e05c'; /* '' */ +} +.typcn-directions:before { + content: '\e05d'; /* '' */ +} +.typcn-divide-outline:before { + content: '\e05e'; /* '' */ +} +.typcn-divide:before { + content: '\e05f'; /* '' */ +} +.typcn-document-add:before { + content: '\e060'; /* '' */ +} +.typcn-document-delete:before { + content: '\e061'; /* '' */ +} +.typcn-document-text:before { + content: '\e062'; /* '' */ +} +.typcn-document:before { + content: '\e063'; /* '' */ +} +.typcn-download-outline:before { + content: '\e064'; /* '' */ +} +.typcn-download:before { + content: '\e065'; /* '' */ +} +.typcn-dropbox:before { + content: '\e066'; /* '' */ +} +.typcn-edit:before { + content: '\e067'; /* '' */ +} +.typcn-eject-outline:before { + content: '\e068'; /* '' */ +} +.typcn-eject:before { + content: '\e069'; /* '' */ +} +.typcn-equals-outline:before { + content: '\e06a'; /* '' */ +} +.typcn-equals:before { + content: '\e06b'; /* '' */ +} +.typcn-export-outline:before { + content: '\e06c'; /* '' */ +} +.typcn-export:before { + content: '\e06d'; /* '' */ +} +.typcn-eye-outline:before { + content: '\e06e'; /* '' */ +} +.typcn-eye:before { + content: '\e06f'; /* '' */ +} +.typcn-feather:before { + content: '\e070'; /* '' */ +} +.typcn-film:before { + content: '\e071'; /* '' */ +} +.typcn-filter:before { + content: '\e072'; /* '' */ +} +.typcn-flag-outline:before { + content: '\e073'; /* '' */ +} +.typcn-flag:before { + content: '\e074'; /* '' */ +} +.typcn-flash-outline:before { + content: '\e075'; /* '' */ +} +.typcn-flash:before { + content: '\e076'; /* '' */ +} +.typcn-flow-children:before { + content: '\e077'; /* '' */ +} +.typcn-flow-merge:before { + content: '\e078'; /* '' */ +} +.typcn-flow-parallel:before { + content: '\e079'; /* '' */ +} +.typcn-flow-switch:before { + content: '\e07a'; /* '' */ +} +.typcn-folder-add:before { + content: '\e07b'; /* '' */ +} +.typcn-folder-delete:before { + content: '\e07c'; /* '' */ +} +.typcn-folder-open:before { + content: '\e07d'; /* '' */ +} +.typcn-folder:before { + content: '\e07e'; /* '' */ +} +.typcn-gift:before { + content: '\e07f'; /* '' */ +} +.typcn-globe-outline:before { + content: '\e080'; /* '' */ +} +.typcn-globe:before { + content: '\e081'; /* '' */ +} +.typcn-group-outline:before { + content: '\e082'; /* '' */ +} +.typcn-group:before { + content: '\e083'; /* '' */ +} +.typcn-headphones:before { + content: '\e084'; /* '' */ +} +.typcn-heart-full-outline:before { + content: '\e085'; /* '' */ +} +.typcn-heart-half-outline:before { + content: '\e086'; /* '' */ +} +.typcn-heart-outline:before { + content: '\e087'; /* '' */ +} +.typcn-heart:before { + content: '\e088'; /* '' */ +} +.typcn-home-outline:before { + content: '\e089'; /* '' */ +} +.typcn-home:before { + content: '\e08a'; /* '' */ +} +.typcn-html5:before { + content: '\e08b'; /* '' */ +} +.typcn-image-outline:before { + content: '\e08c'; /* '' */ +} +.typcn-image:before { + content: '\e08d'; /* '' */ +} +.typcn-infinity-outline:before { + content: '\e08e'; /* '' */ +} +.typcn-infinity:before { + content: '\e08f'; /* '' */ +} +.typcn-info-large-outline:before { + content: '\e090'; /* '' */ +} +.typcn-info-large:before { + content: '\e091'; /* '' */ +} +.typcn-info-outline:before { + content: '\e092'; /* '' */ +} +.typcn-info:before { + content: '\e093'; /* '' */ +} +.typcn-input-checked-outline:before { + content: '\e094'; /* '' */ +} +.typcn-input-checked:before { + content: '\e095'; /* '' */ +} +.typcn-key-outline:before { + content: '\e096'; /* '' */ +} +.typcn-key:before { + content: '\e097'; /* '' */ +} +.typcn-keyboard:before { + content: '\e098'; /* '' */ +} +.typcn-leaf:before { + content: '\e099'; /* '' */ +} +.typcn-lightbulb:before { + content: '\e09a'; /* '' */ +} +.typcn-link-outline:before { + content: '\e09b'; /* '' */ +} +.typcn-link:before { + content: '\e09c'; /* '' */ +} +.typcn-location-arrow-outline:before { + content: '\e09d'; /* '' */ +} +.typcn-location-arrow:before { + content: '\e09e'; /* '' */ +} +.typcn-location-outline:before { + content: '\e09f'; /* '' */ +} +.typcn-location:before { + content: '\e0a0'; /* '' */ +} +.typcn-lock-closed-outline:before { + content: '\e0a1'; /* '' */ +} +.typcn-lock-closed:before { + content: '\e0a2'; /* '' */ +} +.typcn-lock-open-outline:before { + content: '\e0a3'; /* '' */ +} +.typcn-lock-open:before { + content: '\e0a4'; /* '' */ +} +.typcn-mail:before { + content: '\e0a5'; /* '' */ +} +.typcn-map:before { + content: '\e0a6'; /* '' */ +} +.typcn-media-eject-outline:before { + content: '\e0a7'; /* '' */ +} +.typcn-media-eject:before { + content: '\e0a8'; /* '' */ +} +.typcn-media-fast-forward-outline:before { + content: '\e0a9'; /* '' */ +} +.typcn-media-fast-forward:before { + content: '\e0aa'; /* '' */ +} +.typcn-media-pause-outline:before { + content: '\e0ab'; /* '' */ +} +.typcn-media-pause:before { + content: '\e0ac'; /* '' */ +} +.typcn-media-play-outline:before { + content: '\e0ad'; /* '' */ +} +.typcn-media-play-reverse-outline:before { + content: '\e0ae'; /* '' */ +} +.typcn-media-play-reverse:before { + content: '\e0af'; /* '' */ +} +.typcn-media-play:before { + content: '\e0b0'; /* '' */ +} +.typcn-media-record-outline:before { + content: '\e0b1'; /* '' */ +} +.typcn-media-record:before { + content: '\e0b2'; /* '' */ +} +.typcn-media-rewind-outline:before { + content: '\e0b3'; /* '' */ +} +.typcn-media-rewind:before { + content: '\e0b4'; /* '' */ +} +.typcn-media-stop-outline:before { + content: '\e0b5'; /* '' */ +} +.typcn-media-stop:before { + content: '\e0b6'; /* '' */ +} +.typcn-message-typing:before { + content: '\e0b7'; /* '' */ +} +.typcn-message:before { + content: '\e0b8'; /* '' */ +} +.typcn-messages:before { + content: '\e0b9'; /* '' */ +} +.typcn-microphone-outline:before { + content: '\e0ba'; /* '' */ +} +.typcn-microphone:before { + content: '\e0bb'; /* '' */ +} +.typcn-minus-outline:before { + content: '\e0bc'; /* '' */ +} +.typcn-minus:before { + content: '\e0bd'; /* '' */ +} +.typcn-mortar-board:before { + content: '\e0be'; /* '' */ +} +.typcn-news:before { + content: '\e0bf'; /* '' */ +} +.typcn-notes-outline:before { + content: '\e0c0'; /* '' */ +} +.typcn-notes:before { + content: '\e0c1'; /* '' */ +} +.typcn-pen:before { + content: '\e0c2'; /* '' */ +} +.typcn-pencil:before { + content: '\e0c3'; /* '' */ +} +.typcn-phone-outline:before { + content: '\e0c4'; /* '' */ +} +.typcn-phone:before { + content: '\e0c5'; /* '' */ +} +.typcn-pi-outline:before { + content: '\e0c6'; /* '' */ +} +.typcn-pi:before { + content: '\e0c7'; /* '' */ +} +.typcn-pin-outline:before { + content: '\e0c8'; /* '' */ +} +.typcn-pin:before { + content: '\e0c9'; /* '' */ +} +.typcn-pipette:before { + content: '\e0ca'; /* '' */ +} +.typcn-plane-outline:before { + content: '\e0cb'; /* '' */ +} +.typcn-plane:before { + content: '\e0cc'; /* '' */ +} +.typcn-plug:before { + content: '\e0cd'; /* '' */ +} +.typcn-plus-outline:before { + content: '\e0ce'; /* '' */ +} +.typcn-plus:before { + content: '\e0cf'; /* '' */ +} +.typcn-point-of-interest-outline:before { + content: '\e0d0'; /* '' */ +} +.typcn-point-of-interest:before { + content: '\e0d1'; /* '' */ +} +.typcn-power-outline:before { + content: '\e0d2'; /* '' */ +} +.typcn-power:before { + content: '\e0d3'; /* '' */ +} +.typcn-printer:before { + content: '\e0d4'; /* '' */ +} +.typcn-puzzle-outline:before { + content: '\e0d5'; /* '' */ +} +.typcn-puzzle:before { + content: '\e0d6'; /* '' */ +} +.typcn-radar-outline:before { + content: '\e0d7'; /* '' */ +} +.typcn-radar:before { + content: '\e0d8'; /* '' */ +} +.typcn-refresh-outline:before { + content: '\e0d9'; /* '' */ +} +.typcn-refresh:before { + content: '\e0da'; /* '' */ +} +.typcn-rss-outline:before { + content: '\e0db'; /* '' */ +} +.typcn-rss:before { + content: '\e0dc'; /* '' */ +} +.typcn-scissors-outline:before { + content: '\e0dd'; /* '' */ +} +.typcn-scissors:before { + content: '\e0de'; /* '' */ +} +.typcn-shopping-bag:before { + content: '\e0df'; /* '' */ +} +.typcn-shopping-cart:before { + content: '\e0e0'; /* '' */ +} +.typcn-social-at-circular:before { + content: '\e0e1'; /* '' */ +} +.typcn-social-dribbble-circular:before { + content: '\e0e2'; /* '' */ +} +.typcn-social-dribbble:before { + content: '\e0e3'; /* '' */ +} +.typcn-social-facebook-circular:before { + content: '\e0e4'; /* '' */ +} +.typcn-social-facebook:before { + content: '\e0e5'; /* '' */ +} +.typcn-social-flickr-circular:before { + content: '\e0e6'; /* '' */ +} +.typcn-social-flickr:before { + content: '\e0e7'; /* '' */ +} +.typcn-social-github-circular:before { + content: '\e0e8'; /* '' */ +} +.typcn-social-github:before { + content: '\e0e9'; /* '' */ +} +.typcn-social-google-plus-circular:before { + content: '\e0ea'; /* '' */ +} +.typcn-social-google-plus:before { + content: '\e0eb'; /* '' */ +} +.typcn-social-instagram-circular:before { + content: '\e0ec'; /* '' */ +} +.typcn-social-instagram:before { + content: '\e0ed'; /* '' */ +} +.typcn-social-last-fm-circular:before { + content: '\e0ee'; /* '' */ +} +.typcn-social-last-fm:before { + content: '\e0ef'; /* '' */ +} +.typcn-social-linkedin-circular:before { + content: '\e0f0'; /* '' */ +} +.typcn-social-linkedin:before { + content: '\e0f1'; /* '' */ +} +.typcn-social-pinterest-circular:before { + content: '\e0f2'; /* '' */ +} +.typcn-social-pinterest:before { + content: '\e0f3'; /* '' */ +} +.typcn-social-skype-outline:before { + content: '\e0f4'; /* '' */ +} +.typcn-social-skype:before { + content: '\e0f5'; /* '' */ +} +.typcn-social-tumbler-circular:before { + content: '\e0f6'; /* '' */ +} +.typcn-social-tumbler:before { + content: '\e0f7'; /* '' */ +} +.typcn-social-twitter-circular:before { + content: '\e0f8'; /* '' */ +} +.typcn-social-twitter:before { + content: '\e0f9'; /* '' */ +} +.typcn-social-vimeo-circular:before { + content: '\e0fa'; /* '' */ +} +.typcn-social-vimeo:before { + content: '\e0fb'; /* '' */ +} +.typcn-social-youtube-circular:before { + content: '\e0fc'; /* '' */ +} +.typcn-social-youtube:before { + content: '\e0fd'; /* '' */ +} +.typcn-sort-alphabetically-outline:before { + content: '\e0fe'; /* '' */ +} +.typcn-sort-alphabetically:before { + content: '\e0ff'; /* '' */ +} +.typcn-sort-numerically-outline:before { + content: '\e100'; /* '' */ +} +.typcn-sort-numerically:before { + content: '\e101'; /* '' */ +} +.typcn-spanner-outline:before { + content: '\e102'; /* '' */ +} +.typcn-spanner:before { + content: '\e103'; /* '' */ +} +.typcn-spiral:before { + content: '\e104'; /* '' */ +} +.typcn-star-full-outline:before { + content: '\e105'; /* '' */ +} +.typcn-star-half-outline:before { + content: '\e106'; /* '' */ +} +.typcn-star-half:before { + content: '\e107'; /* '' */ +} +.typcn-star-outline:before { + content: '\e108'; /* '' */ +} +.typcn-star:before { + content: '\e109'; /* '' */ +} +.typcn-starburst-outline:before { + content: '\e10a'; /* '' */ +} +.typcn-starburst:before { + content: '\e10b'; /* '' */ +} +.typcn-stopwatch:before { + content: '\e10c'; /* '' */ +} +.typcn-support:before { + content: '\e10d'; /* '' */ +} +.typcn-tabs-outline:before { + content: '\e10e'; /* '' */ +} +.typcn-tag:before { + content: '\e10f'; /* '' */ +} +.typcn-tags:before { + content: '\e110'; /* '' */ +} +.typcn-th-large-outline:before { + content: '\e111'; /* '' */ +} +.typcn-th-large:before { + content: '\e112'; /* '' */ +} +.typcn-th-list-outline:before { + content: '\e113'; /* '' */ +} +.typcn-th-list:before { + content: '\e114'; /* '' */ +} +.typcn-th-menu-outline:before { + content: '\e115'; /* '' */ +} +.typcn-th-menu:before { + content: '\e116'; /* '' */ +} +.typcn-th-small-outline:before { + content: '\e117'; /* '' */ +} +.typcn-th-small:before { + content: '\e118'; /* '' */ +} +.typcn-thermometer:before { + content: '\e119'; /* '' */ +} +.typcn-thumbs-down:before { + content: '\e11a'; /* '' */ +} +.typcn-thumbs-ok:before { + content: '\e11b'; /* '' */ +} +.typcn-thumbs-up:before { + content: '\e11c'; /* '' */ +} +.typcn-tick-outline:before { + content: '\e11d'; /* '' */ +} +.typcn-tick:before { + content: '\e11e'; /* '' */ +} +.typcn-ticket:before { + content: '\e11f'; /* '' */ +} +.typcn-time:before { + content: '\e120'; /* '' */ +} +.typcn-times-outline:before { + content: '\e121'; /* '' */ +} +.typcn-times:before { + content: '\e122'; /* '' */ +} +.typcn-trash:before { + content: '\e123'; /* '' */ +} +.typcn-tree:before { + content: '\e124'; /* '' */ +} +.typcn-upload-outline:before { + content: '\e125'; /* '' */ +} +.typcn-upload:before { + content: '\e126'; /* '' */ +} +.typcn-user-add-outline:before { + content: '\e127'; /* '' */ +} +.typcn-user-add:before { + content: '\e128'; /* '' */ +} +.typcn-user-delete-outline:before { + content: '\e129'; /* '' */ +} +.typcn-user-delete:before { + content: '\e12a'; /* '' */ +} +.typcn-user-outline:before { + content: '\e12b'; /* '' */ +} +.typcn-user:before { + content: '\e12c'; /* '' */ +} +.typcn-vendor-android:before { + content: '\e12d'; /* '' */ +} +.typcn-vendor-apple:before { + content: '\e12e'; /* '' */ +} +.typcn-vendor-microsoft:before { + content: '\e12f'; /* '' */ +} +.typcn-video-outline:before { + content: '\e130'; /* '' */ +} +.typcn-video:before { + content: '\e131'; /* '' */ +} +.typcn-volume-down:before { + content: '\e132'; /* '' */ +} +.typcn-volume-mute:before { + content: '\e133'; /* '' */ +} +.typcn-volume-up:before { + content: '\e134'; /* '' */ +} +.typcn-volume:before { + content: '\e135'; /* '' */ +} +.typcn-warning-outline:before { + content: '\e136'; /* '' */ +} +.typcn-warning:before { + content: '\e137'; /* '' */ +} +.typcn-watch:before { + content: '\e138'; /* '' */ +} +.typcn-waves-outline:before { + content: '\e139'; /* '' */ +} +.typcn-waves:before { + content: '\e13a'; /* '' */ +} +.typcn-weather-cloudy:before { + content: '\e13b'; /* '' */ +} +.typcn-weather-downpour:before { + content: '\e13c'; /* '' */ +} +.typcn-weather-night:before { + content: '\e13d'; /* '' */ +} +.typcn-weather-partly-sunny:before { + content: '\e13e'; /* '' */ +} +.typcn-weather-shower:before { + content: '\e13f'; /* '' */ +} +.typcn-weather-snow:before { + content: '\e140'; /* '' */ +} +.typcn-weather-stormy:before { + content: '\e141'; /* '' */ +} +.typcn-weather-sunny:before { + content: '\e142'; /* '' */ +} +.typcn-weather-windy-cloudy:before { + content: '\e143'; /* '' */ +} +.typcn-weather-windy:before { + content: '\e144'; /* '' */ +} +.typcn-wi-fi-outline:before { + content: '\e145'; /* '' */ +} +.typcn-wi-fi:before { + content: '\e146'; /* '' */ +} +.typcn-wine:before { + content: '\e147'; /* '' */ +} +.typcn-world-outline:before { + content: '\e148'; /* '' */ +} +.typcn-world:before { + content: '\e149'; /* '' */ +} +.typcn-zoom-in-outline:before { + content: '\e14a'; /* '' */ +} +.typcn-zoom-in:before { + content: '\e14b'; /* '' */ +} +.typcn-zoom-out-outline:before { + content: '\e14c'; /* '' */ +} +.typcn-zoom-out:before { + content: '\e14d'; /* '' */ +} +.typcn-zoom-outline:before { + content: '\e14e'; /* '' */ +} +.typcn-zoom:before { + content: '\e14f'; /* '' */ +} \ No newline at end of file diff --git a/www/fonts/typicons.eot b/www/fonts/typicons.eot new file mode 100644 index 0000000..0873b12 Binary files /dev/null and b/www/fonts/typicons.eot differ diff --git a/www/fonts/typicons.svg b/www/fonts/typicons.svg new file mode 100644 index 0000000..63929fe --- /dev/null +++ b/www/fonts/typicons.svg @@ -0,0 +1,1180 @@ + + + + +Created by FontForge 20120731 at Sun Jul 27 14:53:18 2014 + By Stephen Hutchings +(c) Stephen Hutchings 2012 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/www/fonts/typicons.ttf b/www/fonts/typicons.ttf new file mode 100644 index 0000000..f7df94b Binary files /dev/null and b/www/fonts/typicons.ttf differ diff --git a/www/fonts/typicons.woff b/www/fonts/typicons.woff new file mode 100644 index 0000000..14dc020 Binary files /dev/null and b/www/fonts/typicons.woff differ diff --git a/www/vue/ln.skyscanner.js b/www/vue/ln.skyscanner.js index 828d9a2..caa87d4 100644 --- a/www/vue/ln.skyscanner.js +++ b/www/vue/ln.skyscanner.js @@ -181,6 +181,29 @@ } }); } + + buildGraphs(node){ + let graphs = node._graphs = node._graphs || {}; + + node.CheckStates.forEach(checkState => { + let checkName = checkState.CheckName; + + checkState.PerformanceValues.forEach(performanceValue =>{ + let groupName = checkName + " " + performanceValue.Group || ""; + let perfUnit = performanceValue.PerfUnit || ""; + + if (!graphs[groupName]) + graphs[groupName] = {} + + if (!graphs[groupName][perfUnit]) + graphs[groupName][perfUnit] = {} + + graphs[groupName][perfUnit][performanceValue.PerfName] = performanceValue; + }); + }); + + return graphs; + } diff --git a/www/vue/ln.skyscanner.node.js b/www/vue/ln.skyscanner.node.js index 39b2a47..f9b8ae1 100644 --- a/www/vue/ln.skyscanner.node.js +++ b/www/vue/ln.skyscanner.node.js @@ -1,45 +1,312 @@ SkyScanner.getInitializers().push( - new Promise((resolve,reject)=>{ + new Promise((resolve, reject) => { LN().load("/vue/ln.skyscanner.node.html"). - then((template)=>{ - skyScannerRoutes.push( - { - path: "/vue/nodes/:nodeID", - component: { - template: template, - data: function(){ return { node: null }; }, - beforeRouteEnter: function(to,from,next){ - next((vm)=>{ - skyscanner.loadNode(to.params.nodeID,(node)=>{ - vm.node = node; - }, 1000); - }); + then((template) => { + skyScannerRoutes.push( + { + path: "/vue/nodes/:nodeID", + component: { + template: template, + data: function () { return { node: null }; }, + beforeRouteEnter: function (to, from, next) { + next((vm) => { + skyscanner.loadNode(to.params.nodeID, (node) => { + vm.node = node; + vm.$nextTick(() => { + skyscanner.buildGraphs(node); + loadGraphs(node); + }); + }, 10000); + }); + }, + beforeRouteLeave: function (from, to, next) { + clearTimeout(skyscanner.currentTimeout); + next(); + }, }, - beforeRouteLeave: function(from,to,next){ - clearTimeout(skyscanner.currentTimeout); - next(); - }, - }, - } - ); - resolve(); - }); + } + ); + resolve(); + }); }) ); -function loadGraph(perfValue){ - skyscanner.loadPerformanceGraph(perfValue.PerfPath,3600,(perfData)=>{ +class ColorStack { + + constructor() { + this.reset(); + + this.axColors = [ + "#C0C0FF", + "#C040FF", + "#40C0FF", + "#4040FF", + "#C08080", + "#80C080", + "#808080" + ] + + } + + reset() { + this.resetRed() + this.resetYellow(); + this.resetGreen(); + this.resetBlue(); + + this.currentAxColor = 0; + } + resetRed() { this.currentRed = 208; } + resetYellow() { this.currentYellow = 208; } + resetGreen() { this.currentGreen = 208; } + resetBlue() { this.currentBlue = 208; } + + toHex02(n) { + let sn = n.toString(16); + if (sn.length < 2) + sn = "0" + sn; + return sn; + } + + toRGB(r, g, b) { + return "#" + this.toHex02(r) + this.toHex02(g) + this.toHex02(b); + } + + popRed() { + this.currentRed -= 16; + return this.toRGB(this.currentRed, 0, 0); + } + popYellow() { + this.currentYellow -= 16; + return this.toRGB(this.currentYellow, this.currentYellow, 0); + } + popGreen() { + this.currentGreen -= 16; + return this.toRGB(0, this.currentGreen, 0); + } + popBlue() { + this.currentBlue -= 16; + return this.toRGB(0, 0, this.currentBlue); + } + + popAxColor() { + let axColor = this.axColors[this.currentAxColor]; + this.currentAxColor = (this.currentAxColor + 1) % this.axColors.length; + return axColor; + } + + pop(checkState) { + if (checkState == "CRITICAL") + return this.popRed(); + if (checkState == "WARN") + return this.popYellow(); + return this.popGreen(); + } +} + +class ColorStackContainer { + constructor() { + this.colorStacks = {}; + } + + getColorStack(graphName) { + if (!this.colorStacks.hasOwnProperty(graphName)) + this.colorStacks[graphName] = new ColorStack(); + + return this.colorStacks[graphName]; + } +} + +var colorContainer = new ColorStackContainer(); + +function toSI(value, perfUnit) { + if (perfUnit == "%"){ + value = 100.0 * value; + } + + if (value == 0) + return value; + + let prefixes = { "12": "T", "9": "G", "6": "M", "3": "k", "0": " ", "-3": "m", "-6": "u", "-9": "n" } + let lg10 = Math.log10(Math.abs(value)); + let nPrefix = Math.floor(lg10 / 3) * 3; + + let nValue = value / Math.pow(10, nPrefix); + let prefix = prefixes[nPrefix] || `E${nPrefix}`; + + return `${nValue}${prefix}`; +} + +function loadGraphs(node) { + for (group in node._graphs) { + if (!node._graphs.hasOwnProperty(group)) continue; + + let dataSets = []; + let yScales = []; + + let perfValueDict = {}; + + for (perfUnit in node._graphs[group]) { + if (!node._graphs[group].hasOwnProperty(perfUnit)) continue; + + let axColor = colorContainer.getColorStack(group).popAxColor(); + let _perfUnit = perfUnit; + + yScales.push({ + display: true, + id: perfUnit, + scaleLabel: { + display: true, + labelString: perfUnit, + fontColor: axColor, + }, + gridLines: { + color: axColor, + }, + ticks: { + callback: function (value, index, values) { + try { + return toSI(value, _perfUnit); + } catch { + return value; + } + } + } + }); + + for (perfName in node._graphs[group][perfUnit]) { + if (!node._graphs[group][perfUnit].hasOwnProperty(perfName)) continue; + + let perfValue = node._graphs[group][perfUnit][perfName]; + let color = colorContainer.getColorStack(group).pop(perfValue.CheckState); + + dataSets.push({ + perfName: perfName, + perfUnit: perfUnit, + label: perfName + (perfUnit ? " [" + perfUnit + "]" : ""), + data: [], + borderColor: color, + backgroundColor: color, + fill: false, + yAxisID: perfUnit, + }); + + perfValueDict[perfName] = perfValue; + } + } + + let chart = getOrCreateChart(`chart-${group}`, yScales, dataSets); + chart.options.title.text = `${group}`; + + chart.data.datasets.forEach((dataSet) => { + console.log("dataSet: " + dataSet.perfName); + loadChartLine(chart, dataSet, perfValueDict[dataSet.perfName]); + }); + + chart.update(); + } +} + +function loadChartLine(chart, dataSet, perfValue) { + console.log("loadChartLine()"); + + skyscanner.loadPerformanceGraph(perfValue.PerfPath, 3600, (perfData) => { + console.log("loadPerformaceGraph(): callback"); + + let chartColor = perfValue.CheckState == "CRITICAL" ? '#C00000' : (perfValue.CheckState == "WARN") ? '#C0C000' : '#008000'; + let perfName = perfValue.PerfName; + + dataSet.data.length = 0; + $.each(perfData, function () { + if (this.TimeStamp != 0) + dataSet.data.push({ x: this.TimeStamp, y: this.Value }); + }); + + chart.update(); + }); +} + +function getOrCreateChart(chartID, yAxes, datasets) { + var gDiv = $("#" + CSS.escape(chartID)); + var chart = null; + + if (!gDiv.length) { + gDiv = $("
").attr("id", chartID).css("height", "400px"); + var canvas = $("").appendTo(gDiv); + chart = new Chart(canvas, { + type: 'line', + data: { + datasets, + }, + options: { + title: { + display: true, + text: '-' + }, + scales: { + yAxes, + xAxes: [{ + type: 'time', + time: { + unit: "minute", + tooltipFormat: "DD.MM.YYYY HH:mm", + displayFormats: { + minute: "DD.MM.YYYY HH:mm" + }, + parser: moment.unix + } + }] + }, + responsive: true, + maintainAspectRatio: false, + cubicInterpolationMode: "monotone", + fill: false, + + tooltips: { + callbacks: { + label: function(tooltipItem, data) { + let dataSet = data.datasets[tooltipItem.datasetIndex]; + let value = tooltipItem.yLabel; + + if (dataSet.perfUnit == "%") + { + value = value * 100.0; + } + + let label = dataSet.label || ''; + if (label) { + label += ': '; + } + label += toSI(value); + return label; + } + } + } + } + }); + chart.data.labels.length = 0; + gDiv.data("chart", chart); + + $("#graphs").append(gDiv); + } else { + chart = gDiv.data("chart"); + } + + return chart; +} + +function loadGraph(perfValue) { + skyscanner.loadPerformanceGraph(perfValue.PerfPath, 3600, (perfData) => { var perfID = skyscanner.encodeID(perfValue.PerfName); var chartColor = perfValue.CheckState == "CRITICAL" ? '#C00000' : (perfValue.CheckState == "WARN") ? '#C0C000' : '#008000'; var gDiv = $("#" + perfID); var chart = null; - if (!gDiv.length) - { - gDiv = $("
").attr("id",perfID).css("height","400px"); + if (!gDiv.length) { + gDiv = $("
").attr("id", perfID).css("height", "400px"); var canvas = $("").appendTo(gDiv); - chart = new Chart( canvas, { + chart = new Chart(canvas, { type: 'line', data: { datasets: [ @@ -79,25 +346,24 @@ function loadGraph(perfValue){ cubicInterpolationMode: "monotone", fill: false, } - } ); + }); chart.data.labels.length = 0; chart.data.datasets[0].data.length = 0; chart.data.datasets[0].label = perfValue.PerfName; - gDiv.data("chart",chart); - } else - { + gDiv.data("chart", chart); + } else { chart = gDiv.data("chart"); } chart.data.datasets[0].data.length = 0; - $.each( perfData, function(){ + $.each(perfData, function () { if (this.TimeStamp != 0) - chart.data.datasets[0].data.push( { x: this.TimeStamp, y: this.Value } ); + chart.data.datasets[0].data.push({ x: this.TimeStamp, y: this.Value }); }); chart.update(); $("#graphs").append(gDiv); }); -} +} \ No newline at end of file diff --git a/www/vue/ln.skyscanner.nodes.html b/www/vue/ln.skyscanner.nodes.html index 5d1063b..95cf140 100644 --- a/www/vue/ln.skyscanner.nodes.html +++ b/www/vue/ln.skyscanner.nodes.html @@ -16,7 +16,7 @@ - {{ node.Name }} + {{ node.Name }} {{ node.PrimaryIP }} {{ node.Vendor }} {{ node.Product }} diff --git a/www/vue/ln.skyscanner.system.html b/www/vue/ln.skyscanner.system.html index f1cbe4c..697575b 100644 --- a/www/vue/ln.skyscanner.system.html +++ b/www/vue/ln.skyscanner.system.html @@ -8,7 +8,10 @@ System - + +
+ + Crawler diff --git a/www/vue/vue.html b/www/vue/vue.html index 5ba3167..0801378 100644 --- a/www/vue/vue.html +++ b/www/vue/vue.html @@ -7,7 +7,8 @@ - + + @@ -46,6 +47,7 @@ v-for="route in skyScannerRoutes" v-if="route.label" v-bind:to="route.path" + class="plain" >{{ route.label }}