diff options
Diffstat (limited to 'modules/luci-mod-network')
4 files changed, 30 insertions, 2 deletions
diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/network.js b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/network.js index fe1ff19fed..bab23cc3c7 100644 --- a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/network.js +++ b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/network.js @@ -102,6 +102,7 @@ L.poll(5, L.url('admin/network/iface_status', networks.join(',')), null, _('IPv6'), ifc.ip6addrs ? ifc.ip6addrs[8] : null, _('IPv6'), ifc.ip6addrs ? ifc.ip6addrs[9] : null, _('IPv6-PD'), ifc.ip6prefix, + _('Information'), ifc.is_auto ? null : _('Not started on boot'), _('Error'), ifc.errors ? ifc.errors[0] : null, _('Error'), ifc.errors ? ifc.errors[1] : null, _('Error'), ifc.errors ? ifc.errors[2] : null, diff --git a/modules/luci-mod-network/luasrc/controller/admin/network.lua b/modules/luci-mod-network/luasrc/controller/admin/network.lua index 1da5eac464..2312dcf6e0 100644 --- a/modules/luci-mod-network/luasrc/controller/admin/network.lua +++ b/modules/luci-mod-network/luasrc/controller/admin/network.lua @@ -212,6 +212,7 @@ function iface_status(ifaces) is_up = net:is_up() and device:is_up(), is_alias = net:is_alias(), is_dynamic = net:is_dynamic(), + is_auto = net:is_auto(), rx_bytes = device:rx_bytes(), tx_bytes = device:tx_bytes(), rx_packets = device:rx_packets(), diff --git a/modules/luci-mod-network/luasrc/model/cbi/admin_network/vlan.lua b/modules/luci-mod-network/luasrc/model/cbi/admin_network/vlan.lua index d79b3c4704..edeb193ef7 100644 --- a/modules/luci-mod-network/luasrc/model/cbi/admin_network/vlan.lua +++ b/modules/luci-mod-network/luasrc/model/cbi/admin_network/vlan.lua @@ -42,6 +42,8 @@ local update_interfaces = function(old_ifname, new_ifname) end end +local vlan_already_created + m.uci:foreach("network", "switch", function(x) local sid = x['.name'] @@ -200,8 +202,29 @@ m.uci:foreach("network", "switch", -- When creating a new vlan, preset it with the highest found vid + 1. s.create = function(self, section, origin) - -- Filter by switch - if m:get(origin, "device") ~= switch_name then + -- VLAN has already been created for another switch + if vlan_already_created then + return + + -- VLAN add button was pressed in an empty VLAN section so only + -- accept the create event if our switch is without existing VLANs + elseif origin == "" then + local is_empty_switch = true + + m.uci:foreach("network", "switch_vlan", + function(s) + if s.device == switch_name then + is_empty_switch = false + return false + end + end) + + if not is_empty_switch then + return + end + + -- VLAN was created for another switch + elseif m:get(origin, "device") ~= switch_name then return end @@ -227,6 +250,8 @@ m.uci:foreach("network", "switch", m:set(sid, has_vlan4k, max_id + 1) end + vlan_already_created = true + return sid end diff --git a/modules/luci-mod-network/luasrc/model/cbi/admin_network/wifi.lua b/modules/luci-mod-network/luasrc/model/cbi/admin_network/wifi.lua index 7b7fc0ffcf..6cf4bdd244 100644 --- a/modules/luci-mod-network/luasrc/model/cbi/admin_network/wifi.lua +++ b/modules/luci-mod-network/luasrc/model/cbi/admin_network/wifi.lua @@ -177,6 +177,7 @@ if found_sta then else ch = s:taboption("general", Value, "_mode_freq", '<br />'..translate("Operating frequency")) ch.iwinfo = iw + ch.hostapd_acs = (os.execute("hostapd -vacs >/dev/null 2>/dev/null") == 0) ch.template = "cbi/wireless_modefreq" function ch.cfgvalue(self, section) |