From d6909b970234d950db0531a245f60333637956aa Mon Sep 17 00:00:00 2001 From: "Ole Mathias Aa. Heggem" Date: Sat, 17 Mar 2018 19:44:01 +0100 Subject: latencyChart autoupdate --- web/js/nms-info-box.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'web/js/nms-info-box.js') diff --git a/web/js/nms-info-box.js b/web/js/nms-info-box.js index f1d1fa4..73dcd72 100644 --- a/web/js/nms-info-box.js +++ b/web/js/nms-info-box.js @@ -1106,9 +1106,9 @@ nmsInfoBox.addPanelType("switchComments",switchCommentsPanel); */ var switchSummaryPanel = function() { nmsInfoPanel.call(this,"switchSummary"); + var latencyChart; this.init = function() { - //TODO Fix this so the chart is automatic updated - //this.addHandler("ticker"); + this.addHandler("ticker"); this.refresh(); }; this.refresh = function(reason) { @@ -1117,6 +1117,12 @@ var switchSummaryPanel = function() { console.log("ugh, cleanup failed?"); return; } + + if(reason == 'handler-ticker' && latencyChart != undefined) { + drawLatency(this.sw+'latency_chart',this.sw, latencyChart); + //TODO Fix so it will update table to + return; + } var topper = document.createElement("div"); for ( var h in handlers ) { if (handlers[h].getInfo != undefined) { @@ -1141,7 +1147,7 @@ var switchSummaryPanel = function() { latency.id = this.sw+'latency_chart'; latency.width = 500; latency.height = 250; - drawLatency(this.sw+'latency_chart',this.sw); + drawLatency(this.sw+'latency_chart',this.sw, false, function(chart) { latencyChart = chart; }); topper.appendChild(latency); topper.appendChild(table); -- cgit v1.2.3