a_w_networks1 = [[You can run several wifi networks with one device. Be aware that there are certain hardware and driverspecific restrictions. Normally you can operate 1 Ad-Hoc or up to 3 Master-Mode and 1 Client-Mode network simultaneously.]]
a_w_netid = [[Network Name (<abbr title="Extended Service Set Identifier">ESSID</abbr>)]]
a_w_network1 = [[Add the Wifi network to physical network]]
+a_w_netmanual = [[ - Create new Network - ]]
a_w_txpwr = [[Transmit Power]]
a_w_brcmburst = [[Broadcom Frameburst]]
a_w_athburst = [[Atheros Frameburst]]
a_w_adhoc = [[Ad-Hoc]]
a_w_ahdemo = [[Pseudo Ad-Hoc (ahdemo)]]
a_w_client = [[Client]]
-a_w_wds = [[<abbr title="Wireless Distribution System">WDS</abbr>]]
+a_w_wds = [[WDS]]
a_w_monitor = [[Monitor]]
dhcp_dnsmasq_desc = [[Dnsmasq is a combined <abbr title="Dynamic Host Configuration Protocol">DHCP</abbr>-Server and <abbr title="Domain Name System">DNS</abbr>-Forwarder for <abbr title="Network Address Translation">NAT</abbr> firewalls]]
dhcp_dnsmasq_domainneeded = [[Domain required]]
a_w_hideessid = [[ESSID verstecken]]
a_w_netid = [[Netzkennung (ESSID)]]
a_w_network1 = [[WLAN-Netz zu Netzwerk hinzufügen]]
+a_w_netmanual = [[ - Neues Netzwerk erstellen - ]]
a_w_networks1 = [[Pro WLAN-Gerät können mehrere Netze bereitgestellt werden.
Es sollte beachtet werden, dass es hardware- / treiberspezifische Einschränkungen gibt.
So kann pro WLAN-Gerät in der Regel entweder 1 Ad-Hoc-Zugang ODER bis zu 3 Access-Point und 1 Client-Zugang
function cbi_combobox(id, values, def, man) {
var obj = document.getElementById(id)
var sel = document.createElement("select");
- obj.parentNode.appendChild(sel);
+ if (obj.nextSibling) {
+ obj.parentNode.insertBefore(sel, obj.nextSibling);
+ } else {
+ obj.parentNode.appendChild(sel);
+ }
if (!values[obj.value]) {
if (obj.value == "") {
-%>
}, '<%- if not self.rmempty and not self.optional then -%>
<%-:cbi_select-%>
- <%- end -%>', '<%:cbi_manual%>');
+ <%- end -%>', '
+ <%- if self.combobox_manual then -%>
+ <%-=self.combobox_manual-%>
+ <%- else -%>
+ <%-:cbi_manual-%>
+ <%- end -%>');
</script>
<% end -%>
<%+cbi/valuefooter%>
require("luci.sys")
require("luci.tools.webadmin")
+luci.model.uci.load_state("network")
+local netstate = luci.model.uci.get_all("network")
+luci.model.uci.unload("network")
+
m = Map("network", translate("interfaces"))
-m.stateful = true
local created
local netstat = luci.sys.net.deviceinfo()
end
up = s:option(Flag, "up")
+function up.cfgvalue(self, section)
+ return netstate[section] and netstate[section].up or "0"
+end
+
function up.write(self, section, value)
- local call = value == "1" and "ifup" or "ifdown"
- os.execute(call .. " " .. section)
+ local call
+ if value == "1" then
+ call = "ifup"
+ elseif value == "0" then
+ call = "ifdown"
+ end
+ os.execute(call .. " " .. section .. " >/dev/null 2>&1")
end
ifname = s:option(DummyValue, "ifname", translate("device"))
+function ifname.cfgvalue(self, section)
+ return netstate[section] and netstate[section].ifname
+end
+
ifname.titleref = luci.dispatcher.build_url("admin", "network", "vlan")
if luci.model.uci.load("firewall") then
ipaddr = s:option(DummyValue, "ipaddr", translate("addresses"))
-
function ipaddr.cfgvalue(self, section)
local addr = luci.tools.webadmin.network_get_addresses(section)
return table.concat(addr, ", ")
s:option(Value, "ssid", translate("a_w_netid")).maxlength = 32
-network = s:option(ListValue, "network", translate("network"), translate("a_w_network1"))
+network = s:option(Value, "network", translate("network"), translate("a_w_network1"))
+network.rmempty = true
network:value("")
+network.combobox_manual = translate("a_w_netmanual")
luci.tools.webadmin.cbi_add_networks(network)
+function network.write(self, section, value)
+ if not luci.model.uci.get("network", value) then
+ m:chain("network")
+ luci.model.uci.set("network", value, "interface")
+ Value.write(self, section, value)
+ else
+ if luci.model.uci.get("network", value) == "interface" then
+ Value.write(self, section, value)
+ end
+ end
+end
+
mode = s:option(ListValue, "mode", translate("mode"))
mode:value("ap", translate("a_w_ap"))
mode:value("adhoc", translate("a_w_adhoc"))
require("luci.sys")
luci.model.uci.load_state("network")
-local wireless = luci.model.uci.get_all("network")
+local network = luci.model.uci.get_all("network")
luci.model.uci.unload("network")
local netstat = luci.sys.net.deviceinfo()
local ifaces = {}
-for k, v in pairs(wireless) do
+for k, v in pairs(network) do
if v[".type"] == "interface" and k ~= "loopback" then
table.insert(ifaces, v)
end