diff options
author | Jo-Philipp Wich <jo@mein.io> | 2020-02-14 12:11:00 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2020-02-14 12:11:00 +0100 |
commit | 56e77ab81796588ba88cedc6cbfce73d363c58c4 (patch) | |
tree | 6ae83c29c3d440d0d3133f883f35dde993e4098c /applications/luci-app-statistics/htdocs/luci-static/resources | |
parent | c71ae186712d1c568b91904d0542f488a754501b (diff) |
luci-app-statistics: auto-create missing plugin entries
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'applications/luci-app-statistics/htdocs/luci-static/resources')
-rw-r--r-- | applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/collectd.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/collectd.js b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/collectd.js index b66055f7e2..d92693525a 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/collectd.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/collectd.js @@ -8,7 +8,8 @@ return L.view.extend({ load: function() { return Promise.all([ fs.list('/usr/lib/collectd'), - fs.list('/usr/share/luci/statistics/plugins') + fs.list('/usr/share/luci/statistics/plugins'), + uci.load('luci_statistics') ]).then(function(data) { var installed = data[0], plugins = data[1], @@ -17,6 +18,9 @@ return L.view.extend({ for (var i = 0; i < plugins.length; i++) { tasks.push(fs.read_direct('/usr/share/luci/statistics/plugins/' + plugins[i].name, 'json').then(L.bind(function(name, spec) { return L.resolveDefault(L.require('view.statistics.plugins.' + name)).then(function(form) { + if (!uci.get('luci_statistics', 'collectd_' + name)) + uci.add('luci_statistics', 'statistics', 'collectd_' + name); + return { name: name, spec: spec, |