diff --git a/modules/admin-full/luasrc/view/admin_network/iface_overview.htm b/modules/admin-full/luasrc/view/admin_network/iface_overview.htm
index 9577ed0fde..545d1386d0 100644
--- a/modules/admin-full/luasrc/view/admin_network/iface_overview.htm
+++ b/modules/admin-full/luasrc/view/admin_network/iface_overview.htm
@@ -15,12 +15,26 @@ You may obtain a copy of the License at
local fwm = require "luci.model.firewall".init()
local net
+ local ifaces = { }
local netlist = { }
for _, net in ipairs(ntm:get_networks()) do
if net:name() ~= "loopback" then
- netlist[#netlist+1] = net:name()
+ local z = fwm:get_zone_by_network(net:name())
+ ifaces[#ifaces+1] = net:name()
+ netlist[#netlist+1] = {
+ net:name(), z and z:name() or "-", z
+ }
end
end
+
+ table.sort(netlist,
+ function(a, b)
+ if a[2] ~= b[2] then
+ return a[2] < b[2]
+ else
+ return a[1] < b[1]
+ end
+ end)
-%>
@@ -64,7 +78,7 @@ You may obtain a copy of the License at
var wifidevs = <%=luci.http.write_json(netdevs)%>;
var arptable = <%=luci.http.write_json(arpcache)%>;
- XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "network", "iface_status", table.concat(netlist, ","))%>', null,
+ XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "network", "iface_status", table.concat(ifaces, ","))%>', null,
function(x, ifcs)
{
if (ifcs)
@@ -162,7 +176,7 @@ You may obtain a copy of the License at
d.innerHTML = html;
}
- else if (d && !ifc.ifname)
+ else if (d && !ifc.ifname)
{
d.innerHTML = String.format(
'<%:Network without interfaces.%>
' +
@@ -210,7 +224,7 @@ You may obtain a copy of the License at
<%
for i, net in ipairs(netlist) do
- local z = fwm:get_zone_by_network(net)
+ local z = net[3]
local c = z and z:get_color() or "#EEEEEE"
local t = z and translate("Part of zone %q" % z:name()) or translate("No zone assigned")
%>
@@ -218,22 +232,22 @@ You may obtain a copy of the License at