diff --git a/checks/SkyCheckState.cs b/checks/SkyCheckState.cs index 7a27d83..ba7a0b9 100644 --- a/checks/SkyCheckState.cs +++ b/checks/SkyCheckState.cs @@ -17,11 +17,14 @@ namespace ln.skyscanner.checks { public enum CheckState { OK, WARN, CRITICAL, FAIL, ERROR } - public struct CheckStateChange + public class CheckStateChange { public CheckState NewState; public DateTime Timestamp; + private CheckStateChange() + { + } public CheckStateChange(CheckState checkState) { NewState = checkState; diff --git a/services/PerformanceValueService.cs b/services/PerformanceValueService.cs index 9e38471..59717f8 100644 --- a/services/PerformanceValueService.cs +++ b/services/PerformanceValueService.cs @@ -108,11 +108,11 @@ namespace ln.skyscanner.services PerformanceValueService = performanceValueService; } - public PerfValue[] GetPerfData(string[] perfPath,int timeWindow = 3600) + public PerfValue[] GetPerfData(string[] perfPath,int timeWindow,int timeSkip) { PerfFile perfFile = PerformanceValueService.GetPerfFile(perfPath); perfFile.EnsureOpen(); - PerfValue[] perfData = perfFile.QueryTime(timeWindow, 0); + PerfValue[] perfData = perfFile.QueryTime(timeWindow, timeSkip); return perfData; } } diff --git a/skyscanner.sln b/skyscanner.sln index aaf981f..4a0ea33 100644 --- a/skyscanner.sln +++ b/skyscanner.sln @@ -21,6 +21,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ln.application", "..\ln.app EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ln.json", "..\ln.json\ln.json.csproj", "{D9342117-3249-4D8B-87C9-51A50676B158}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "odb.tool", "..\odb.tool\odb.tool.csproj", "{24C9C372-DCA6-420D-ACD3-5C89C6935D6A}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x86 = Debug|x86 @@ -67,5 +69,9 @@ Global {D9342117-3249-4D8B-87C9-51A50676B158}.Debug|x86.Build.0 = Debug|Any CPU {D9342117-3249-4D8B-87C9-51A50676B158}.Release|x86.ActiveCfg = Release|Any CPU {D9342117-3249-4D8B-87C9-51A50676B158}.Release|x86.Build.0 = Release|Any CPU + {24C9C372-DCA6-420D-ACD3-5C89C6935D6A}.Debug|x86.ActiveCfg = Debug|x86 + {24C9C372-DCA6-420D-ACD3-5C89C6935D6A}.Debug|x86.Build.0 = Debug|x86 + {24C9C372-DCA6-420D-ACD3-5C89C6935D6A}.Release|x86.ActiveCfg = Release|x86 + {24C9C372-DCA6-420D-ACD3-5C89C6935D6A}.Release|x86.Build.0 = Release|x86 EndGlobalSection EndGlobal diff --git a/www/css/style.css b/www/css/style.css index b5607be..1f1bd39 100644 --- a/www/css/style.css +++ b/www/css/style.css @@ -481,4 +481,12 @@ span#nWARN, span#nCRITICAL, span#nOK { text-decoration: underline; } +input.ln-slider { + display: block; + width: 100%; +} +div.ln-slider { + width: 360px; + text-align: center; +} diff --git a/www/vue/ln.skyscanner.js b/www/vue/ln.skyscanner.js index caa87d4..8455e27 100644 --- a/www/vue/ln.skyscanner.js +++ b/www/vue/ln.skyscanner.js @@ -28,6 +28,9 @@ this.currentNodes = []; + this.currentAction = ""; + this.currentState = ""; + this.issues = { OK: 0, WARN: 0, @@ -50,6 +53,14 @@ return initializers; } + action(msg){ + this.currentAction = msg; + } + + state(msg){ + this.currentState = msg; + } + wsUpdate(state) { try @@ -80,11 +91,12 @@ updateIssues(){ var self = this; - console.log("Update issue list"); - LN().rpc("CheckService","GetIssueList",[],function(r,e){ + this.action("updating issue list..."); + + LN().rpc("CheckService","GetIssueList",[],(r,e) => { if (e){ - alert("Error fetching current issue list!\n" + JSON.stringify(e)); + self.state("Error fetching current issue list!\n" + JSON.stringify(e)); } else { self.currentIssues = r; @@ -103,6 +115,7 @@ self.lastIssueUpdate = moment().format(); } self.currentTimeout = setTimeout(function(){ self.updateIssues(); }, 10000); + this.action(""); }); } @@ -153,7 +166,9 @@ loadNode(nodeID,cb,refreshIntervall){ var self = this; - LN().rpc("entities","GetNode",[nodeID,],function(r,e){ + this.action("loading node " + nodeID); + + LN().rpc("entities","GetNode",[nodeID,],(r,e) => { if (refreshIntervall && self.currentTimeout) clearTimeout(self.currentTimeout); @@ -164,6 +179,8 @@ setTimeout(()=>{ self.loadNode(nodeID,cb,refreshIntervall); }, refreshIntervall); + + this.action(""); }); } @@ -172,8 +189,8 @@ return ("" + t).replace( /[\.\/]/g, "_"); } - loadPerformanceGraph(perfPath,interval,cb){ - LN().rpc("perfValues","GetPerfData",[perfPath,interval],(perfData,e)=>{ + loadPerformanceGraph(perfPath,interval,shift,cb){ + LN().rpc("perfValues","GetPerfData",[perfPath,interval,shift],(perfData,e)=>{ if (e){ console.log(e); } else { diff --git a/www/vue/ln.skyscanner.node.html b/www/vue/ln.skyscanner.node.html index f0d3c11..e27c9f3 100644 --- a/www/vue/ln.skyscanner.node.html +++ b/www/vue/ln.skyscanner.node.html @@ -63,7 +63,27 @@ -
+