diff options
author | Dirk Brenken <dev@brenken.org> | 2017-08-12 08:03:48 +0200 |
---|---|---|
committer | Dirk Brenken <dev@brenken.org> | 2017-08-12 08:03:48 +0200 |
commit | 3317104647c6e189094464d045d9ec76ee8530e9 (patch) | |
tree | 160ca0cb5b117d26df68db5a98e9e5162954e51f /applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_edit.lua | |
parent | 4e80499a023fb195c7c897841473f526ffd0c7fa (diff) |
luci-app-travelmate: sync with 0.9.2
* frontend: add/modify input datatypes in 'extra' section
* frontend: add support to edit/change wpa enterprise key phrases
* frontend: various small fixes
Signed-off-by: Dirk Brenken <dev@brenken.org>
Diffstat (limited to 'applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_edit.lua')
-rw-r--r-- | applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_edit.lua | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_edit.lua b/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_edit.lua index 6d6bdcff44..c60ff22c4d 100644 --- a/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_edit.lua +++ b/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_edit.lua @@ -22,10 +22,15 @@ local s = uci:get_all("wireless", m.hidden.cfg) if s ~= nil then wssid = m:field(Value, "ssid", translate("SSID")) wssid.default = s.ssid + wssid.datatype = "rangelength(1,32)" if s.encryption and s.key then wkey = m:field(Value, "key", translatef("Passphrase (%s)", s.encryption)) + elseif s.encryption and s.password then + wkey = m:field(Value, "password", translatef("Passphrase (%s)", s.encryption)) + end + if s.encryption and (s.key or s.password) then wkey.password = true - wkey.default = s.key + wkey.default = s.key or s.password if s.encryption == "wep" then wkey.datatype = "wepkey" else @@ -40,6 +45,8 @@ function wssid.write(self, section, value) uci:set("wireless", m.hidden.cfg, "ssid", wssid:formvalue(section)) if s.encryption and s.key then uci:set("wireless", m.hidden.cfg, "key", wkey:formvalue(section)) + elseif s.encryption and s.password then + uci:set("wireless", m.hidden.cfg, "password", wkey:formvalue(section)) end uci:save("wireless") uci:commit("wireless") |