mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
luci-app-status: manage multiple wifi
This commit is contained in:
parent
1a356b05c6
commit
5a83b897eb
2 changed files with 26 additions and 6 deletions
|
@ -207,6 +207,18 @@ function wizard_add()
|
|||
gostatus = false
|
||||
end
|
||||
end
|
||||
-- Set wireless settings
|
||||
local wifi_interfaces = luci.http.formvaluetable("wifi")
|
||||
for wifi_intf, _ in pairs(wifi_interfaces) do
|
||||
local channel = luci.http.formvalue("cbid.wifi.%s.channel" % wifi_intf) or ""
|
||||
local name = luci.http.formvalue("cbid.wifi.%s.name" % wifi_intf) or ""
|
||||
local key = luci.http.formvalue("cbid.wifi.%s.key" % wifi_intf) or ""
|
||||
ucic:set("wireles",wifi_intf,"channel",channel)
|
||||
ucic:set("wireles","default" .. wifi_intf,"ssid",name)
|
||||
ucic:set("wireles","default" .. wifi_intf,"key",key)
|
||||
end
|
||||
ucic:save("wireless")
|
||||
ucic:commit("wireless")
|
||||
|
||||
-- Set interfaces settings
|
||||
local interfaces = luci.http.formvaluetable("intf")
|
||||
|
|
|
@ -592,18 +592,23 @@
|
|||
%>
|
||||
<div class="cbi-map">
|
||||
<h2 name="content"><%:Wifi%></h2>
|
||||
<%
|
||||
uci:foreach("wireless","device", function(s)
|
||||
%>
|
||||
<h3><%=s[".name"]%> - <%=uci:get("wireless",s[".name"],"band")%></h3>
|
||||
<input type="hidden" name="wifi.<%=s[".name"]%>" value="<%=s[".name"]%>" />
|
||||
<fieldset class="cbi-section" id="wifi">
|
||||
<div class="cbi-value" data-index="30">
|
||||
<label class="cbi-value-title"><%:Wifi channel%></label>
|
||||
<div class="cbi-value-field">
|
||||
<select class="cbi-input-select" data-update="change" id="cbid.wifi.channel" name="cbid.wifi.channel" size="1">
|
||||
<option value="auto"<% if uci:get("wireless","radio0","channel") == "auto" then %> selected="selected"<% end %>><%:Auto%></option>
|
||||
<select class="cbi-input-select" data-update="change" id="cbid.wifi.<%=s[".name"]%>.channel" name="cbid.wifi.<%=s[".name"]%>.channel" size="1">
|
||||
<option value="auto"<% if uci:get("wireless",s[".name"],"channel") == "auto" then %> selected="selected"<% end %>><%:Auto%></option>
|
||||
<%
|
||||
local dump = require("luci.util").ubus("iwinfo", "freqlist", { device = "radio0" }) or {}
|
||||
local dump = require("luci.util").ubus("iwinfo", "freqlist", { device = s[".name"] }) or {}
|
||||
if dump['results'] ~= nil then
|
||||
for _, value in pairs(dump['results']) do
|
||||
%>
|
||||
<option value="<%=value['channel']%>"<% if uci:get("wireless","radio0","channel") == value['channel'] then %> selected="selected"<% end %>><%=value['channel']%></option>
|
||||
<option value="<%=value['channel']%>"<% if uci:get("wireless",s[".name"],"channel") == value['channel'] then %> selected="selected"<% end %>><%=value['channel']%></option>
|
||||
<%
|
||||
end
|
||||
end
|
||||
|
@ -614,17 +619,20 @@
|
|||
<div class="cbi-value" data-index="31">
|
||||
<label class="cbi-value-title"><%:Wifi name%></label>
|
||||
<div class="cbi-value-field">
|
||||
<input type="text" name="cbid.wifi.name" class="cbi-input-text" value="<%=uci:get('wireless','default_radio','ssid')%>">
|
||||
<input type="text" name="cbid.wifi.<%=s[".name"]%>.name" class="cbi-input-text" value="<%=uci:get('wireless','default_' .. s[".name"],'ssid')%>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="cbi-value" data-index="32">
|
||||
<label class="cbi-value-title"><%:Key%></label>
|
||||
<div class="cbi-value-field">
|
||||
<input type="text" name="cbid.wifi.key" class="cbi-input-text" value="<%=uci:get('wireless','default_radio','key')%>">
|
||||
<input type="text" name="cbid.wifi.<%=s[".name"]%>.key" class="cbi-input-text" value="<%=uci:get('wireless','default_' .. s[".name"],'key')%>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</fieldset>
|
||||
<%
|
||||
end)
|
||||
%>
|
||||
</div>
|
||||
<%
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue