diff options
author | Jo-Philipp Wich <jo@mein.io> | 2020-03-16 12:11:01 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2020-03-16 12:11:01 +0100 |
commit | 12e1d9411df4eacbfe8530bb9d7af8d129ebcb9f (patch) | |
tree | 09028ced1227c70a52f91ae43b72a0b5663f92c6 /applications/luci-app-statistics/htdocs | |
parent | 5d7dc391d4af4ad5dd6d7e1f6ef9891aa21fd220 (diff) |
luci-app-statistics: fix APC UPS graph rendering
Fixes: #3743
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'applications/luci-app-statistics/htdocs')
-rw-r--r-- | applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/apcups.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/apcups.js b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/apcups.js index bcebf3034..50de3a6b0 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/apcups.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/apcups.js @@ -15,10 +15,10 @@ return L.Class.extend({ */ var ups_types = graph.dataTypes(host, plugin, plugin_instance), - ups_inst = []; + ups_inst = {}; for (var i = 0; i < ups_types.length; i++) - ups_inst.push(graph.dataInstances(host, plugin, plugin_instance, ups_types[i])); + ups_inst[ups_types[i]] = graph.dataInstances(host, plugin, plugin_instance, ups_types[i]); /* Check if hash table or array is empty or nil-filled */ function empty(t) { @@ -37,9 +37,9 @@ return L.Class.extend({ if (L.isObject(def_inst)) { for (var k in def_inst) { - if (ups_types.find(function(t) { return t == k }).length) { + if (ups_types.filter(function(t) { return t == k }).length) { for (var i = def_inst[k].length - 1; i >= 0; i--) - if (!ups_inst[k].find(function(n) { return n == def_inst[k][i] }).length) + if (!ups_inst[k].filter(function(n) { return n == def_inst[k][i] }).length) def_inst[k].splice(i, 1); if (def_inst[k].length == 0) |