X-Git-Url: http://git.archive.openwrt.org/?a=blobdiff_plain;f=modules%2Fadmin-full%2Fluasrc%2Fview%2Fadmin_status%2Finterfaces.htm;h=5358caeae63e390d6d1c8592be76cd0693d2c1b4;hb=c5e52b76437355f833b03be7167234d29236a85f;hp=562b1e67513031a81fdab6c693eedb63470e8031;hpb=2c73c9505540c543c4f7026aeca54bef72f3d6ab;p=project%2Fluci.git diff --git a/modules/admin-full/luasrc/view/admin_status/interfaces.htm b/modules/admin-full/luasrc/view/admin_status/interfaces.htm index 562b1e675..5358caeae 100644 --- a/modules/admin-full/luasrc/view/admin_status/interfaces.htm +++ b/modules/admin-full/luasrc/view/admin_status/interfaces.htm @@ -1,7 +1,7 @@ <%# LuCI - Lua Configuration Interface -Copyright 2008 Steven Barth -Copyright 2008 Jo-Philipp Wich +Copyright 2008-2009 Steven Barth +Copyright 2008-2009 Jo-Philipp Wich Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -63,7 +63,7 @@ $Id$ end function get_vlan(i) - return i:match("^%w+%.(%d+)$") + return i and i:match("^%w+%.(%d+)$") end function get_vlan_ports(i) @@ -143,16 +143,22 @@ $Id$ function get_brinfo(s) local b = { } - for l in luci.util.execi("brctl show br-%s" % s['.name']) do + local m = false + for l in luci.util.execi("brctl show") do if not l:match("STP") then - local r = luci.util.split(l, "%s+", nil, true) - if #r > 2 then - b.name = r[1] - b.id = r[2] - b.stp = r[3] == "yes" - b.ifnames = { r[4] } - else - b.ifnames[#b.ifnames+1] = r[2] + if m and l:match("^[a-z]") then + break + elseif m or l:match("^br%%-%s" % s['.name']) then + m = true + local r = luci.util.split(l, "%s+", nil, true) + if #r > 2 then + b.name = r[1] + b.id = r[2] + b.stp = r[3] == "yes" + b.ifnames = { r[4] } + else + b.ifnames[#b.ifnames+1] = r[2] + end end end end @@ -171,6 +177,8 @@ $Id$ <% for _, i in ipairs(single_ifs) do dev = get_ifname(i) vlan = get_vlan(dev) + + if dev and devinfo and devinfo[dev] then %>

<%:a_s_if_interface Interface%> <%=i['.name']%>

@@ -221,12 +229,14 @@ $Id$ <% end %> <%- end -%>

- <% end %> + <% end end %> <% for _, b in ipairs(bridge_ifs) do br = get_brinfo(b) - dev = br.name + dev = br and br.name + + if br and devinfo and devinfo[dev] then %>

<%:a_s_if_bridge Bridge%> <%=br.name%>

@@ -294,7 +304,7 @@ $Id$ <% end -%>
<% end %>

- <% end %> + <% end end %>