luci-mod-system: add pollinterval option 2442/head
authorFlorian Eckert <fe@dev.tdt.de>
Tue, 8 Jan 2019 07:20:46 +0000 (08:20 +0100)
committerFlorian Eckert <fe@dev.tdt.de>
Wed, 9 Jan 2019 09:23:57 +0000 (10:23 +0100)
Make pollinterval configurable.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
modules/luci-mod-system/luasrc/model/cbi/admin_system/system.lua

index c26fd475a4e05afe03eb7c8d5f8fcb01f7c64bf7..b58bbd4134051da62e522e77c26b5a04ceb77785 100644 (file)
@@ -22,6 +22,7 @@ s.addremove = false
 s:tab("general",  translate("General Settings"))
 s:tab("logging",  translate("Logging"))
 s:tab("language", translate("Language and Style"))
+s:tab("advanced", translate("Advanced"))
 if has_zram then s:tab("zram", translate("ZRam Settings")) end
 
 --
@@ -169,6 +170,28 @@ function o.write(self, section, value)
 end
 
 
+--
+-- Advanced
+--
+
+o = s:taboption("advanced", Value, "_pollinterval",
+       translate("Polling interval"),
+       translate("Polling interval for status queries in seconds"))
+o.datatype = "range(3, 20)"
+o.default = 5
+o:value("3")
+o:value("5")
+o:value("10")
+
+function o.cfgvalue(...)
+       return m.uci:get("luci", "main", "pollinterval")
+end
+
+function o.write(self, section, value)
+       m.uci:set("luci", "main", "pollinterval", value)
+end
+
+
 --
 -- NTP
 --