mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-08-10 02:33:43 +08:00
20 lines
569 B
Lua
20 lines
569 B
Lua
m = Map("wrtbwmon")
|
|
m.title = translate("Details")
|
|
|
|
s = m:section(NamedSection, "general", "wrtbwmon", translate("General settings"))
|
|
|
|
o = s:option(Flag, "persist", translate("Persist database"))
|
|
o.description = translate("Check this to persist the database file")
|
|
o.rmempty = false
|
|
|
|
function o.write(self, section, value)
|
|
if value == '1' then
|
|
luci.sys.call("mv /tmp/usage.db /etc/config/usage.db")
|
|
elseif value == '0' then
|
|
luci.sys.call("mv /etc/config/usage.db /tmp/usage.db")
|
|
end
|
|
return Flag.write(self, section ,value)
|
|
end
|
|
|
|
return m
|