diff options
author | Jo-Philipp Wich <jo@mein.io> | 2017-07-31 19:11:51 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2017-07-31 19:15:17 +0200 |
commit | 3722aa02861d53d356a73a1ddc4fc2a2cd610617 (patch) | |
tree | 061cc54e20ec9418c439c65ac6c450fba1fe35c0 /applications/luci-app-nlbwmon/luasrc/controller | |
parent | c37a95365359e0870d4af1fa5b034b59ae6c28cc (diff) |
luci-app-nlbwmon: improve initial view
Make sure that placeholder pie charts are rendered, display a hint about
yet missing data in the tables and offer a link to force-commit ("Reload")
the data.
Also fix some mixed white space, an imbalanced dom operation and sync
translation template.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'applications/luci-app-nlbwmon/luasrc/controller')
-rw-r--r-- | applications/luci-app-nlbwmon/luasrc/controller/nlbw.lua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/applications/luci-app-nlbwmon/luasrc/controller/nlbw.lua b/applications/luci-app-nlbwmon/luasrc/controller/nlbw.lua index 4f41bb8c3..bb56bc6e6 100644 --- a/applications/luci-app-nlbwmon/luasrc/controller/nlbw.lua +++ b/applications/luci-app-nlbwmon/luasrc/controller/nlbw.lua @@ -13,6 +13,7 @@ function index() entry({"admin", "nlbw", "ptr"}, call("action_ptr"), nil, 6).leaf = true entry({"admin", "nlbw", "download"}, call("action_download"), nil, 7) entry({"admin", "nlbw", "restore"}, post("action_restore"), nil, 8) + entry({"admin", "nlbw", "commit"}, call("action_commit"), nil, 9) end local function exec(cmd, args, writer) @@ -214,3 +215,11 @@ function action_restore() table.concat(output, ", ")) }) end + +function action_commit() + local http = require "luci.http" + local disp = require "luci.dispatcher" + + http.redirect(disp.build_url("admin/nlbw/display")) + exec("/usr/sbin/nlbw", { "-c", "commit" }) +end |