Changeset 6700

Show
Ignore:
Timestamp:
01/10/11 19:40:35 (2 years ago)
Author:
jow
Message:

modules/admin-full: add enable_vlan4k option to switch page

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • luci/trunk/modules/admin-full/luasrc/model/cbi/admin_network/vlan.lua

    r6468 r6700  
    2626        local cpu_port    = 5 
    2727 
     28        local enable_vlan4k = false 
     29 
    2830        -- Parse some common switch properties from swconfig help output. 
    2931        local swc = io.popen("swconfig dev %q help 2>/dev/null" % switch_name) 
     
    5557                    if is_vlan_attr then has_vlan4k = line:match(": (%w+)") end 
    5658                    if is_port_attr then has_ptpvid = line:match(": (%w+)") end 
     59 
     60                elseif line:match(": enable_vlan4k") then 
     61                    enable_vlan4k = true 
    5762 
    5863                end 
     
    99104        s:option(Flag, "enable_vlan", translate("Enable VLAN functionality")) 
    100105            .cfgvalue = function(self, section) return Flag.cfgvalue(self, section) or self.enabled end 
     106 
     107        if enable_vlan4k then 
     108            s:option(Flag, "enable_vlan4k", translate("Enable 4K VLANs")) 
     109        end 
    101110 
    102111        s:option(Flag, "reset", translate("Reset switch during setup"))