luci-app-travelmate: bugfix 1281/head
authorDirk Brenken <dev@brenken.org>
Sat, 5 Aug 2017 16:57:20 +0000 (18:57 +0200)
committerDirk Brenken <dev@brenken.org>
Sat, 5 Aug 2017 19:49:28 +0000 (21:49 +0200)
* fix bug in interface wizard during initial setup
* cosmetics

Signed-off-by: Dirk Brenken <dev@brenken.org>
applications/luci-app-travelmate/luasrc/model/cbi/travelmate/cfg_firewall_tab.lua
applications/luci-app-travelmate/luasrc/model/cbi/travelmate/cfg_network_tab.lua
applications/luci-app-travelmate/luasrc/model/cbi/travelmate/cfg_wireless_tab.lua
applications/luci-app-travelmate/luasrc/model/cbi/travelmate/configuration_tab.lua
applications/luci-app-travelmate/luasrc/model/cbi/travelmate/overview_tab.lua
applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_add.lua
applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_edit.lua
applications/luci-app-travelmate/luasrc/view/travelmate/wifi_scan.htm

index 009ed805dbe70adc806515e52f4212c03964c4ea..e5a048fa88518b0f69b976b764178f184ea24078 100644 (file)
@@ -12,6 +12,7 @@ end
 
 m = SimpleForm("input", nil)
 m:append(Template("travelmate/config_css"))
+m.submit = translate("Save")
 m.reset = false
 
 s = m:section(SimpleSection, nil,
index 4d43637d9cc47972dcd5edc192f107d5140d2061..0096d6a8c2075393b06ab3bfa9ad13058e2804c6 100644 (file)
@@ -12,6 +12,7 @@ end
 
 m = SimpleForm("input", nil)
 m:append(Template("travelmate/config_css"))
+m.submit = translate("Save")
 m.reset = false
 
 s = m:section(SimpleSection, nil,
index a025c1379f5a1e0d6edba74c0f72a86543274442..7ef9920a08735eb843380f0ca54d6fb5e083fd26 100644 (file)
@@ -12,6 +12,7 @@ end
 
 m = SimpleForm("input", nil)
 m:append(Template("travelmate/config_css"))
+m.submit = translate("Save")
 m.reset = false
 
 s = m:section(SimpleSection, nil,
index 4233da6ac75b1aca70d6a3a8343305b8342a3188..8a20ab9cce2a27c79daa5077b3b14fa081dcd811 100644 (file)
@@ -14,6 +14,7 @@ end
 
 m = SimpleForm("input", nil)
 m:append(Template("travelmate/config_css"))
+m.submit = translate("Save")
 m.reset = false
 
 s = m:section(SimpleSection, nil,
index 12cb72cbe582d2fa4e41e93fc37d6b330288a0dc..b16fb4161e65df4c8f917bf813e09c8cf44def6a 100644 (file)
@@ -35,20 +35,17 @@ if uplink == "" then
        o.default = "trm_wwan"
        o.rmempty = false
 
-       function o.write(self, section, value)
-               iface = o:formvalue(section)
-               uci:set("travelmate", section, "trm_iface", iface)
-               uci:save("travelmate")
-               uci:commit("travelmate")
-       end
-
        btn = s:option(Button, "", translate("Create Uplink Interface"),
                translate("Create a new wireless wan uplink interface, configure it to use dhcp and ")
                .. translate("add it to the wan zone of the firewall. This step has only to be done once."))
        btn.inputtitle = translate("Add Interface")
        btn.inputstyle = "apply"
        btn.disabled = false
-       function btn.write()
+       function btn.write(self, section, value)
+               iface = o:formvalue(section)
+               uci:set("travelmate", section, "trm_iface", iface)
+               uci:save("travelmate")
+               uci:commit("travelmate")
                local net = nw:add_network(iface, { proto = "dhcp" })
                if net then
                        nw:save("network")
index 3f3f2348a7d214dc2d9ebe8c88ee154ebef117cf..dcfa17c8b56eca4beb457b9931eff650b193a614 100644 (file)
@@ -7,6 +7,7 @@ local http = require("luci.http")
 local trmiface = uci.get("travelmate", "global", "trm_iface") or "trm_wwan"
 
 m = SimpleForm("add", translate("Add Wireless Uplink Configuration"))
+m.submit = translate("Save")
 m.cancel = translate("Back to overview")
 m.reset = false
 
index b0a77e4865afb41c3c82d94ea4f40f47a9ab21f5..6d6bdcff44f88527dfc47690ef66298dbc8c9d7d 100644 (file)
@@ -6,6 +6,7 @@ local uci = require("luci.model.uci").cursor()
 local http = require("luci.http")
 
 m = SimpleForm("edit", translate("Edit Wireless Uplink Configuration"))
+m.submit = translate("Save")
 m.cancel = translate("Back to overview")
 m.reset = false
 
index dea107eef4d1a9c097f729510f308a4ba955df69..b3907e864bf6eafb55de26207d886112e36d7d6d 100644 (file)
@@ -76,14 +76,14 @@ This is free software, licensed under the Apache License, Version 2.0
         </table>
     </fieldset>
 <div class="cbi-page-actions right">
-    <form class="inline" action="<%=url('admin/services/travelmate/stations')%>" method="post">
-        <input class="cbi-button cbi-button-reset" type="submit" value="<%:Back to overview%>"/>
-    </form>
     <form class="inline" action="<%=url('admin/services/travelmate/wifiscan')%>" method="post">
         <input type="hidden" name="token" value="<%=token%>"/>
         <input type="hidden" name="device" value="<%=utl.pcdata(dev)%>"/>
         <input class="cbi-button cbi-input-find" type="submit" value="<%:Repeat scan%>"/>
     </form>
+    <form class="inline" action="<%=url('admin/services/travelmate/stations')%>" method="post">
+        <input class="cbi-button cbi-button-reset" type="submit" value="<%:Back to overview%>"/>
+    </form>
 </div>
 </div>