luci-app: updated log.

This commit is contained in:
gSpot
2023-11-26 16:49:59 +03:00
parent 6cfbf6b8ec
commit 25e681055e
8 changed files with 340 additions and 116 deletions
@@ -0,0 +1,34 @@
#!/bin/sh
. /lib/functions.sh
. /usr/share/libubox/jshn.sh
readonly LOGREAD_CMD="logread -e ruantiblock:"
make_size_value() {
json_init
json_add_string 'bytes' "$1"
json_dump
json_cleanup
}
get_log_size() {
make_size_value "`$LOGREAD_CMD | wc -c`"
}
case "$1" in
list)
json_init
json_add_object "getLogSize"
json_close_object
json_dump
json_cleanup
;;
call)
case "$2" in
getLogSize)
get_log_size
;;
esac
;;
esac
@@ -18,7 +18,8 @@
},
"uci": [ "network", "ruantiblock" ],
"ubus": {
"luci": [ "getInitList", "setInitAction" ]
"luci": [ "getInitList", "setInitAction" ],
"luci.ruantiblock": [ "getLogSize" ]
}
},
"write": {