end
end
-local login_section = (m.hidden.ssid or "") .. (m.hidden.bssid or "")
+local login_section = (m.hidden.device or "") .. "_" .. (m.hidden.ssid or "") .. "_" .. (m.hidden.bssid or "")
login_section = login_section:gsub("[^%w_]", "_")
local cmd = uci:get("travelmate", login_section, "command")
local cmd_args_default = uci:get("travelmate", login_section, "command_args")
cmd_args.default = cmd_args_default
function wssid.write(self, section, value)
- newsection = uci:section("wireless", "wifi-iface", "trm_" .. login_section, {
+ newsection = uci:section("wireless", "wifi-iface", login_section, {
mode = "sta",
network = trmiface,
device = m.hidden.device,
disabled = "1"
})
- if encr:formvalue(section) then
+ if encr then
if string.find(encr:formvalue(section), '^wep') then
uci:set("wireless", newsection, "encryption", encr:formvalue(section))
uci:set("wireless", newsection, "key", wkey:formvalue(section) or "")
elseif encr:formvalue(section) ~= "owe" then
uci:set("wireless", newsection, "key", wkey:formvalue(section) or "")
end
- if ciph:formvalue(section) and ciph:formvalue(section) ~= "auto" then
+ if ciph and ciph:formvalue(section) ~= "auto" then
uci:set("wireless", newsection, "encryption", encr:formvalue(section) .. "+" .. ciph:formvalue(section))
else
uci:set("wireless", newsection, "encryption", encr:formvalue(section))
uci:set("wireless", newsection, "encryption", "none")
end
- local login_section = (wssid:formvalue(section) or "") .. (bssid:formvalue(section) or "")
- login_section = login_section:gsub("[^%w_]", "_")
if not uci:get("travelmate", login_section) and cmd_list:formvalue(section) ~= "none" then
uci:set("travelmate", login_section, "login")
end
wkey.default = s.key
end
end
-
- local login_section = (s.ssid or "") .. (s.bssid or "")
- login_section = login_section:gsub("[^%w_]", "_")
- local cmd = uci:get("travelmate", login_section, "command")
- local cmd_args_default = uci:get("travelmate", login_section, "command_args")
- cmd_list = m:field(ListValue, "cmdlist", translate("Auto Login Script"),
- translate("External script reference which will be called for automated captive portal logins."))
- cmd_args = m:field(Value, "cmdargs", translate("Optional Arguments"),
- translate("Space separated list of additional arguments passed to the Auto Login Script, i.e. username and password"))
- for _, z in ipairs(scripts) do
- cmd_list:value(z)
- cmd_args:depends("cmdlist", z)
- end
- cmd_list:value("none")
- cmd_list.default = cmd or "none"
- cmd_args.default = cmd_args_default
else
m.on_cancel()
end
+local login_section = (s.device or "") .. "_" .. (s.ssid or "") .. "_" .. (s.bssid or "")
+login_section = login_section:gsub("[^%w_]", "_")
+local cmd = uci:get("travelmate", login_section, "command")
+local cmd_args_default = uci:get("travelmate", login_section, "command_args")
+cmd_list = m:field(ListValue, "cmdlist", translate("Auto Login Script"),
+ translate("External script reference which will be called for automated captive portal logins."))
+cmd_args = m:field(Value, "cmdargs", translate("Optional Arguments"),
+ translate("Space separated list of additional arguments passed to the Auto Login Script, i.e. username and password"))
+for _, z in ipairs(scripts) do
+ cmd_list:value(z)
+ cmd_args:depends("cmdlist", z)
+end
+cmd_list:value("none")
+cmd_list.default = cmd or "none"
+cmd_args.default = cmd_args_default
+
function wssid.write(self, section, value)
uci:set("wireless", m.hidden.cfg, "ssid", wssid:formvalue(section))
uci:set("wireless", m.hidden.cfg, "bssid", bssid:formvalue(section))
- if encr:formvalue(section) then
+ if encr then
if string.find(encr:formvalue(section), '^wep') then
uci:set("wireless", m.hidden.cfg, "encryption", encr:formvalue(section))
uci:set("wireless", m.hidden.cfg, "key", wkey:formvalue(section) or "")
if encr:formvalue(section) ~= "owe" then
uci:set("wireless", m.hidden.cfg, "key", wkey:formvalue(section) or "")
end
- if ciph:formvalue(section) and ciph:formvalue(section) ~= "auto" then
+ if ciph and ciph:formvalue(section) ~= "auto" then
uci:set("wireless", m.hidden.cfg, "encryption", encr:formvalue(section) .. "+" .. ciph:formvalue(section))
else
uci:set("wireless", m.hidden.cfg, "encryption", encr:formvalue(section))
end
end
- local login_section = (wssid:formvalue(section) or "") .. (bssid:formvalue(section) or "")
- login_section = login_section:gsub("[^%w_]", "_")
+
if not uci:get("travelmate", login_section) and cmd_list:formvalue(section) ~= "none" then
uci:set("travelmate", login_section, "login")
end
<%#
-Copyright 2017-2018 Dirk Brenken (dev@brenken.org)
+Copyright 2017-2019 Dirk Brenken (dev@brenken.org)
This is free software, licensed under the Apache License, Version 2.0
-%>
<div class="cbi-map">
<div class="cbi-map-descr">
- <%=translatef("Provides an overview of all configured uplinks for the travelmate interface (%s). You can edit, delete or re-order existing uplinks or scan for a new one. The currently used uplink is emphasized in blue, faulty stations in red.", trmiface)%>
+ <%=translatef("Provides an overview of all configured uplinks for the travelmate interface (%s). You can edit, remove or re-order/prioritize existing uplinks or scan for new ones. The currently used uplink is emphasized in blue, faulty stations in red.", trmiface)%>
</div>
<div class="cbi-section">
<input class="cbi-button cbi-button-up" type="button" value="<%:Up%>" onclick="location.href='<%=luci.dispatcher.build_url('admin/services/travelmate/wifiorder')%>?cfg=<%=section%>&dir=up'" alt="<%:Move up%>" title="<%:Move up%>" />
<input class="cbi-button cbi-button-down" type="button" value="<%:Down%>" onclick="location.href='<%=luci.dispatcher.build_url('admin/services/travelmate/wifiorder')%>?cfg=<%=section%>&dir=down'" alt="<%:Move down%>" title="<%:Move down%>" />
<input class="cbi-button cbi-button-edit" type="button" value="<%:Edit%>" onclick="location.href='<%=luci.dispatcher.build_url('admin/services/travelmate/wifiedit')%>?cfg=<%=section%>'" title="<%:Edit this Uplink%>" />
- <input class="cbi-button cbi-button-remove" type="button" value="<%:Delete%>" onclick="location.href='<%=luci.dispatcher.build_url('admin/services/travelmate/wifidelete')%>?cfg=<%=section%>'" title="<%:Delete this Uplink%>" />
+ <input class="cbi-button cbi-button-remove" type="button" value="<%:Remove%>" onclick="location.href='<%=luci.dispatcher.build_url('admin/services/travelmate/wifidelete')%>?cfg=<%=section%>'" title="<%:Remove this Uplink%>" />
</div>
</div>
</div>