summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-vnstat2/root/usr/share
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2020-01-30 12:08:35 +0100
committerJo-Philipp Wich <jo@mein.io>2020-01-31 08:51:55 +0100
commit40c56ddd7797f9e916abe5443784b21ed9ba51cf (patch)
tree2845066826f787cfc2d100a3e073737cfa03cf89 /applications/luci-app-vnstat2/root/usr/share
parent7cfce565530cbf6103275002ad20af57a509ad7b (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/share')
-rw-r--r--applications/luci-app-vnstat2/root/usr/share/luci/menu.d/luci-app-vnstat2.json33
-rw-r--r--applications/luci-app-vnstat2/root/usr/share/rpcd/acl.d/luci-app-vnstat2.json7
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" ]