device = http.formvalue("device"),
ssid = http.formvalue("ssid"),
wep = http.formvalue("wep"),
- wpa_suites = http.formvalue("wpa_suites"),
+ wpa_suites = http.formvalue("wpa_suites"),
wpa_version = http.formvalue("wpa_version")
}
function wssid.write(self, section, value)
newsection = uci:section("wireless", "wifi-iface", nil, {
- mode = "sta",
- network = trmiface,
- device = m.hidden.device,
- ssid = wssid:formvalue(section),
- disabled = "1"
+ mode = "sta",
+ network = trmiface,
+ device = m.hidden.device,
+ ssid = wssid:formvalue(section),
+ disabled = "1"
})
if (tonumber(m.hidden.wep) or 0) == 1 then
uci:set("wireless", newsection, "encryption", "wep-open")
uci:save("wireless")
uci:commit("wireless")
end
-
http.redirect(luci.dispatcher.build_url("admin/services/travelmate/stations"))
if s ~= nil then
wssid = m:field(Value, "ssid", translate("SSID"))
wssid.default = s.ssid
-
if s.encryption and s.key then
wkey = m:field(Value, "key", translatef("Passphrase (%s)", s.encryption))
wkey.password = true
end
end
else
- http.redirect(luci.dispatcher.build_url("admin/services/travelmate/stations"))
+ m.on_cancel()
end
function wssid.write(self, section, value)
end
uci:save("wireless")
uci:commit("wireless")
- http.redirect(luci.dispatcher.build_url("admin/services/travelmate/stations"))
+ m.on_cancel()
end
return m
local section = ""
local idx = ""
local idx_change = ""
- if dir == "up" then
- uci:foreach("wireless", "wifi-iface", function(s)
- iface = s.network
- if iface == trmiface then
- section = s['.name']
- if cfg == section then
- idx = s['.index']
- else
- idx_change = s['.index']
- end
- if idx ~= "" and idx_change ~= "" and idx_change < idx then
- uci:reorder("wireless", cfg, idx_change)
- idx = ""
- end
+ local changed = ""
+ uci:foreach("wireless", "wifi-iface", function(s)
+ iface = s.network
+ if iface == trmiface then
+ section = s['.name']
+ if cfg == section then
+ idx = s['.index']
+ else
+ idx_change = s['.index']
end
- end)
- elseif dir == "down" then
- uci:foreach("wireless", "wifi-iface", function(s)
- iface = s.network
- if iface == trmiface then
- section = s['.name']
- if cfg == section then
- idx = s['.index']
- else
- idx_change = s['.index']
- end
- if idx ~= "" and idx_change ~= "" and idx_change > idx then
- uci:reorder("wireless", cfg, idx_change)
- idx = ""
- end
+ if (dir == "up" and idx ~= "" and idx_change ~= "" and idx_change < idx) or
+ (dir == "down" and idx ~= "" and idx_change ~= "" and idx_change > idx) then
+ changed = uci:reorder("wireless", cfg, idx_change)
+ idx = ""
end
- end)
+ end
+ end)
+ if changed ~= "" then
+ uci:save("wireless")
+ uci:commit("wireless")
end
- uci:save("wireless")
- uci:commit("wireless")
end
http.redirect(luci.dispatcher.build_url("admin/services/travelmate/stations"))
<input type="button" class="cbi-button cbi-button-remove" onclick="location.href='<%=url('admin/services/travelmate/wifidelete')%>?cfg=<%=section%>'" title="<%:Delete this Uplink%>" value="<%:Delete%>"/>
</td>
</tr>
-<%
+<%
end
end)
%>