diff options
author | Ole Mathias Aa. Heggem <olemathias.aa.heggem@gmail.com> | 2018-03-17 19:44:01 +0100 |
---|---|---|
committer | Ole Mathias Aa. Heggem <olemathias.aa.heggem@gmail.com> | 2018-03-17 19:44:01 +0100 |
commit | d6909b970234d950db0531a245f60333637956aa (patch) | |
tree | 07585f7f65433d25a5a5b1cd148c0c16140df08e /web/js/nms-info-box.js | |
parent | dc97b997e8d6e5edc63c598c05090a8b98e79757 (diff) |
latencyChart autoupdate
Diffstat (limited to 'web/js/nms-info-box.js')
-rw-r--r-- | web/js/nms-info-box.js | 12 |
1 files changed, 9 insertions, 3 deletions
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); |