Merge pull request #1264 from kuoruan/zh-cn-tr
[project/luci.git] / applications / luci-app-travelmate / luasrc / model / cbi / travelmate / overview_tab.lua
index aa508f5..b16fb41 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")
@@ -90,7 +87,7 @@ end
 o3 = s:option(Value, "trm_iface", translate("Uplink / Trigger interface"),
        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.default = trmiface
 o3.rmempty = false
 
 o4 = s:option(Value, "trm_triggerdelay", translate("Trigger delay"),