diff options
author | Jo-Philipp Wich <jo@mein.io> | 2020-01-30 12:08:35 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2020-01-31 08:51:55 +0100 |
commit | 40c56ddd7797f9e916abe5443784b21ed9ba51cf (patch) | |
tree | 2845066826f787cfc2d100a3e073737cfa03cf89 /applications/luci-app-vnstat2/root/usr | |
parent | 7cfce565530cbf6103275002ad20af57a509ad7b (diff) |
luci-app-vnstat2: fully convert to client side rendering
This converts the graph rendering to client side JavaScript and replaces
the route registration with declarative JSON.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'applications/luci-app-vnstat2/root/usr')
-rw-r--r-- | applications/luci-app-vnstat2/root/usr/share/luci/menu.d/luci-app-vnstat2.json | 33 | ||||
-rw-r--r-- | applications/luci-app-vnstat2/root/usr/share/rpcd/acl.d/luci-app-vnstat2.json | 7 |
2 files changed, 40 insertions, 0 deletions
diff --git a/applications/luci-app-vnstat2/root/usr/share/luci/menu.d/luci-app-vnstat2.json b/applications/luci-app-vnstat2/root/usr/share/luci/menu.d/luci-app-vnstat2.json new file mode 100644 index 0000000000..0b3303c360 --- /dev/null +++ b/applications/luci-app-vnstat2/root/usr/share/luci/menu.d/luci-app-vnstat2.json @@ -0,0 +1,33 @@ +{ + "admin/status/vnstat2": { + "title": "vnStat Traffic Monitor", + "order": 90, + "action": { + "type": "firstchild" + }, + "depends": { + "fs": { + "/usr/bin/vnstat": "executable", + "/usr/bin/vnstati": "executable" + } + } + }, + + "admin/status/vnstat2/graphs": { + "title": "Graphs", + "order": 1, + "action": { + "type": "view", + "path": "vnstat2/graphs" + } + }, + + "admin/status/vnstat2/config": { + "title": "Configuration", + "order": 2, + "action": { + "type": "view", + "path": "vnstat2/config" + } + } +} diff --git a/applications/luci-app-vnstat2/root/usr/share/rpcd/acl.d/luci-app-vnstat2.json b/applications/luci-app-vnstat2/root/usr/share/rpcd/acl.d/luci-app-vnstat2.json index 58a2aa50c6..fb16f09c9a 100644 --- a/applications/luci-app-vnstat2/root/usr/share/rpcd/acl.d/luci-app-vnstat2.json +++ b/applications/luci-app-vnstat2/root/usr/share/rpcd/acl.d/luci-app-vnstat2.json @@ -1,6 +1,13 @@ { "luci-app-vnstat2": { "description": "Grant access to LuCI app vnstat2", + "read": { + "cgi-io": [ "exec" ], + "file": { + "/usr/bin/vnstat --json f 1": [ "exec" ], + "/usr/bin/vnstati -[5dhmsty] -i * -o -": [ "exec" ] + } + }, "write": { "file": { "/usr/bin/vnstat": [ "exec" ] |