summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-travelmate/luasrc/model
diff options
context:
space:
mode:
authorDirk Brenken <dev@brenken.org>2017-07-29 10:02:21 +0200
committerDirk Brenken <dev@brenken.org>2017-07-29 17:36:48 +0200
commit81f52d429081bba20a898d3a6ed5ad7241cbadc0 (patch)
treeba4ce60efa540b12ff0c09201348bb0452a5a1b1 /applications/luci-app-travelmate/luasrc/model
parentf450c0403d4aa2d1e5cbcb262315121b130990e9 (diff)
luci-app-travelmate: enhancements & fixes
* Further optimized Station Overview & Scan page, especially for mobile devices * add a "Rescan" button in manual mode on overview page * XHTML fixes Signed-off-by: Dirk Brenken <dev@brenken.org>
Diffstat (limited to 'applications/luci-app-travelmate/luasrc/model')
-rw-r--r--applications/luci-app-travelmate/luasrc/model/cbi/travelmate/overview_tab.lua20
1 files changed, 13 insertions, 7 deletions
diff --git a/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/overview_tab.lua b/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/overview_tab.lua
index 64ab880c4d..aa508f5214 100644
--- a/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/overview_tab.lua
+++ b/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/overview_tab.lua
@@ -35,12 +35,8 @@ if uplink == "" then
o.default = "trm_wwan"
o.rmempty = false
- function o.validate(self, value)
- iface = value
- return iface
- end
-
function o.write(self, section, value)
+ iface = o:formvalue(section)
uci:set("travelmate", section, "trm_iface", iface)
uci:save("travelmate")
uci:commit("travelmate")
@@ -77,12 +73,22 @@ o1.default = o1.disabled
o1.rmempty = false
o2 = s:option(Flag, "trm_automatic", translate("Enable 'automatic' mode"),
- translate("Keep travelmate in an active state."))
+ translate("Keep travelmate in an active state. Check every n seconds the connection status, i.e. the uplink availability."))
o2.default = o2.enabled
o2.rmempty = false
+btn = s:option(Button, "", translate("Manual Rescan"))
+btn:depends("trm_automatic", "")
+btn.inputtitle = translate("Rescan")
+btn.inputstyle = "find"
+btn.disabled = false
+function btn.write()
+ luci.sys.call("/etc/init.d/travelmate start >/dev/null 2>&1")
+ luci.http.redirect(luci.dispatcher.build_url("admin", "services", "travelmate"))
+end
+
o3 = s:option(Value, "trm_iface", translate("Uplink / Trigger interface"),
- translate("Name of the uplink interface that triggers travelmate processing."))
+ translate("Name of the uplink interface that triggers travelmate processing in 'manual' mode."))
o3.datatype = "and(uciname,rangelength(3,15))"
o3.default = "trm_wwan"
o3.rmempty = false