diff options
author | Florian Eckert <fe@dev.tdt.de> | 2018-01-10 15:18:17 +0100 |
---|---|---|
committer | Florian Eckert <fe@dev.tdt.de> | 2018-01-11 14:45:04 +0100 |
commit | 2a165111e8ba9fe61d58248c49fd04746bd68257 (patch) | |
tree | 106d5d377b43bdca44eb0aa197ac8a44039813ed /applications/luci-app-mwan3/luasrc/model | |
parent | 6ac76568e770082ade633370b4e287cc9a0f4f1b (diff) |
luci-app-mwan3: refactoring notify page
clean up notify page
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
Diffstat (limited to 'applications/luci-app-mwan3/luasrc/model')
-rw-r--r-- | applications/luci-app-mwan3/luasrc/model/cbi/mwan/notify.lua | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/notify.lua b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/notify.lua index 8746072eba..20e86fc027 100644 --- a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/notify.lua +++ b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/notify.lua @@ -1,13 +1,12 @@ -- ------ hotplug script configuration ------ -- -fs = require "nixio.fs" -ut = require "luci.util" - +local fs = require "nixio.fs" +local ut = require "luci.util" script = "/etc/mwan3.user" m5 = SimpleForm("luci", nil) -f = m5:section(SimpleSection, nil, +f = m5:section(SimpleSection, translate("MWAN Notification"), translate("This section allows you to modify the content of \"/etc/mwan3.user\".<br />" .. "The file is also preserved during sysupgrade.<br />" .. "<br />" .. @@ -27,13 +26,13 @@ f = m5:section(SimpleSection, nil, "<br />")) t = f:option(TextValue, "lines") - t.rmempty = true - t.rows = 20 - function t.cfgvalue() - return fs.readfile(script) - end - function t.write(self, section, data) -- format and write new data to script - return fs.writefile(script, ut.trim(data:gsub("\r\n", "\n")) .. "\n") - end +t.rmempty = true +t.rows = 20 +function t.cfgvalue() + return fs.readfile(script) +end +function t.write(self, section, data) + return fs.writefile(script, ut.trim(data:gsub("\r\n", "\n")) .. "\n") +end return m5 |