X-Git-Url: http://git.archive.openwrt.org/?a=blobdiff_plain;f=modules%2Fluci-mod-admin-full%2Fluasrc%2Fmodel%2Fcbi%2Fadmin_network%2Fvlan.lua;h=902767c903826d8aa3303012c0b1a4b3dcd0a9e1;hb=e063597d6537f7f3c2f710f8b24631602b78a304;hp=20715f0ed8a5826d470ecf259f1b2a5a9c3004a2;hpb=3ea9c85ed6a12c9175a11626f2bfeb9ae8425f9c;p=project%2Fluci.git diff --git a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/vlan.lua b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/vlan.lua index 20715f0ed..902767c90 100644 --- a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/vlan.lua +++ b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/vlan.lua @@ -30,9 +30,23 @@ m.uci:foreach("network", "switch", local topo = topologies[switch_name] + if not topo then + m.message = translatef("Switch %q has an unknown topology - the VLAN settings might not be accurate.", switch_name) + topo = { + ports = { + { num = 0, label = "Port 1" }, + { num = 1, label = "Port 2" }, + { num = 2, label = "Port 3" }, + { num = 3, label = "Port 4" }, + { num = 4, label = "Port 5" }, + { num = 5, label = "CPU (eth0)", tagged = false } + } + } + end + -- Parse some common switch properties from swconfig help output. local swc = io.popen("swconfig dev %q help 2>/dev/null" % switch_name) - if swc and topo then + if swc then local is_port_attr = false local is_vlan_attr = false