summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-vnstat2/htdocs/luci-static/resources/view/vnstat2
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2023-11-19 01:01:05 +0100
committerGitHub <noreply@github.com>2023-11-19 01:01:05 +0100
commit6d9cc9a518915ad22a3447ca56410747358378aa (patch)
tree33ecfe69eb5ebf168bc726d3602b1593a3080821 /applications/luci-app-vnstat2/htdocs/luci-static/resources/view/vnstat2
parent0b8f8ab075f89fc722bf5ef9ed0cfbf46219c5d6 (diff)
parent3ac4f567dfdfd6ee989ceffb025241e605790b6d (diff)
Merge pull request #6704 from janh/vnstat2-use-dbiflist
luci-app-vnstat2: use more efficient way to get database interfaces
Diffstat (limited to 'applications/luci-app-vnstat2/htdocs/luci-static/resources/view/vnstat2')
-rw-r--r--applications/luci-app-vnstat2/htdocs/luci-static/resources/view/vnstat2/config.js7
1 files changed, 2 insertions, 5 deletions
diff --git a/applications/luci-app-vnstat2/htdocs/luci-static/resources/view/vnstat2/config.js b/applications/luci-app-vnstat2/htdocs/luci-static/resources/view/vnstat2/config.js
index 10cd85641c..4d4bfd0dbe 100644
--- a/applications/luci-app-vnstat2/htdocs/luci-static/resources/view/vnstat2/config.js
+++ b/applications/luci-app-vnstat2/htdocs/luci-static/resources/view/vnstat2/config.js
@@ -58,13 +58,10 @@ return view.extend({
o = s.option(form.DummyValue, '_database');
o.load = function(section_id) {
- return fs.exec('/usr/bin/vnstat', ['--json', 'f', '1']).then(L.bind(function(result) {
+ return fs.exec('/usr/bin/vnstat', ['--dbiflist', '1']).then(L.bind(function(result) {
var databaseInterfaces = [];
if (result.code == 0) {
- var vnstatData = JSON.parse(result.stdout);
- for (var i = 0; i < vnstatData.interfaces.length; i++) {
- databaseInterfaces.push(vnstatData.interfaces[i].name);
- }
+ databaseInterfaces = result.stdout.trim().split('\n');
}
var configInterfaces = uci.get_first('vnstat', 'vnstat', 'interface') || [];