[% SET user_can_port_control = user_has_role('port_control') %]
| [% FOREACH item IN vars.port_columns %] [% NEXT IF item.name == 'c_admin' %] [% NEXT IF item.name == 'c_nodes' AND params.c_nodes AND params.c_neighbors %] [% NEXT UNLESS params.${item.name} %] | [% item.label | html_entity %][% END %] | |||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| [% IF row.up_admin != 'up' %]
        
        [% ELSIF row.stp == 'blocking' %]
        
        [% ELSIF row.has_column_loaded('is_free') AND row.is_free %]
        
        [% ELSIF row.up_admin == 'up' AND (row.up != 'up' AND row.up != 'dormant') %]
        
        [% ELSE %]
        
        [% END %]
        [% IF row.slave_of %] [% FOREACH config IN settings._extra_device_port_cols %]
        [% NEXT UNLESS config.position == 'left' AND params.${config.name} %][% IF row.get_column('agg_master_up_admin') != 'up' %] [% ELSIF row.get_column('agg_master_up') == 'up' %] [% ELSE %] [% END %] [% END %] | [% TRY %] [% INCLUDE "plugin/${config.name}/device_port_column.tt" %] [% CATCH %] [% END %][% END %] [% IF params.c_port %] [% IF user_can_port_control AND params.c_admin %] [% IF row.up_admin == 'up' %] | [% ELSE %] | [% END %] [% ELSE %] | [% END %]
        
          [% IF row.is_master %]
             
          [% END %]
        [% row.port | html_entity %]
        [% IF row.slave_of %] [% END %]
      [% FOREACH config IN settings._extra_device_port_cols %]
        [% NEXT UNLESS config.position == 'mid' AND params.${config.name} %][% row.slave_of | html_entity %] [% END %] | [% TRY %] [% INCLUDE "plugin/${config.name}/device_port_column.tt" %] [% CATCH %] [% END %][% END %] [% IF params.c_descr %] | [% row.descr | html_entity %][% END %] [% IF params.c_type %] | [% row.type | html_entity %][% END %] [% IF params.c_duplex %] | [% IF row.up == 'up' AND row.duplex %] [% (row.duplex_admin.ucfirst || 'Auto') | html_entity %] / [% row.duplex.ucfirst | html_entity %] [% END %][% END %] [% IF params.c_lastchange %] | [% row.lastchange_stamp | html_entity %][% END %] [% IF params.c_name %] [% IF user_can_port_control AND params.c_admin %] | [% ELSE %] | [% END %] [% END %]
      [% IF params.c_speed %]
        [% row.name | html_entity %]
       | [% row.speed | html_entity %][% END %] [% IF params.c_mac %] | [% row.mac | html_entity %][% END %] [% IF params.c_mtu %] | [% row.mtu | html_entity %][% END %] [% IF params.c_pvid %] [% IF user_can_port_control AND params.c_admin %] | [% ELSE %]
        [% IF row.vlan %][% row.vlan | html_entity %][% END %]
       | [% row.vlan | html_entity %][% END %] [% END %] [% IF params.c_vmember %] | [% IF row.vlan_count %]
        [% SET output = '' %]
        [% SET vlanlist = [] %]
        [% FOREACH vlan IN row.all_port_vlans %][% vlanlist.push(vlan.get_column('vlan')) %][% END %]
        [% FOREACH vlan IN vlanlist.nsort %]
          [% SET output = output _
            '' _ vlan _ '' %]
          [% SET output = output _ ', ' IF NOT loop.last %]
        [% END %]
        [% IF row.vlan_count > 10 %] [%# TODO make this a settable variable %]
          [% SET output = ' [% END %]
      [% IF params.c_power %]
        [% IF row.power %]
          [% IF row.power.admin == 'true' %]
            [% IF user_can_port_control AND params.c_admin %](' _ row.vlan_count
            _ ')Show VLANs ' _ output %]
          [% SET output = output _ '' %]
        [% END %]
        [% output %]
        [% END %] | [% ELSE %] | [% END %] [% IF row.power.power > 0 %] [% row.power.power | html_entity %] mW [% ELSE %] ([% row.power.status | html_entity %]) [% END %] [% ELSE %] [% IF user_can_port_control AND params.c_admin %] | [% ELSE %] | [% END %] [% END %][% ELSE %] | [% END %] [% END %] [% IF params.c_nodes OR params.c_neighbors %] | [% IF params.c_neighbors AND (row.remote_ip OR row.is_uplink) %]
          [% IF row.neighbor %]
            
            [% IF row.remote_type AND row.remote_type.match('(?i)ip.phone') %]
               
            [% ELSIF row.remote_type AND row.remote_type.match('(cisco\s+AIR-[L|C]?AP|-K9W8-|^AP:\s)') %]
               
            [% END %]
            
            [% row.neighbor.dns.remove(settings.domain_suffix) || row.neighbor.ip | html_entity %]
            [% ' - ' IF row.remote_port %][% row.remote_port | html_entity %] [% END %]
      [% IF params.c_stp %][% IF params.neigh_id and (row.remote_id or row.remote_type) %] ([% 'id: '_ row.remote_id IF row.remote_id %] [% ' type: '_ row.remote_type IF row.remote_type %]) [% END %] [% ELSIF row.remote_ip %] [% IF row.remote_type AND row.remote_type.match('(?i)ip.phone') %] [% ELSIF row.remote_type AND row.remote_type.match('(cisco\s+AIR-[L|C]?AP|-K9W8-|^AP:\s)') %] [% END %] [% row.remote_ip | html_entity %] [% ' - ' IF row.remote_port %][% row.remote_port | html_entity %] [% IF params.neigh_id and (row.remote_id or row.remote_type) %] ([% 'id: '_ row.remote_id IF row.remote_id %] [% ' type: '_ row.remote_type IF row.remote_type %]) [% END %] [% ELSE %] (possible uplink) [% END %] [% END %] [% IF params.c_nodes %] [% FOREACH node IN row.$nodes %] [% ' ' IF (row.remote_ip OR row.is_uplink) OR NOT loop.first %] [% ' ' IF NOT node.active %] [% ' ' IF node.wireless.defined %] [% node.net_mac.$mac_format_call | html_entity %] [% IF (node.vlan > 0) && (node.vlan != row.vlan) %] (on vlan [% node.vlan | html_entity %]) [% END %] [% IF params.n_ssid AND node.wireless.defined %] (SSID: [% FOREACH wlan IN node.wireless %] [% wlan.ssid | html_entity %] [% END %] ) [% END %] [% IF params.n_vendor AND node.oui.defined %] (Vendor: [% FOREACH oui IN node.oui %] [% oui.abbrev | html_entity %] [% END %] ) [% END %] [% ' (' _ node.time_last_age _ ')' IF params.n_age %] [% IF params.n_ip %] [% FOREACH ip IN node.ips %] [% ' ' IF NOT ip.active %] [% SET dns = ip.dns %] [% IF dns %] [% dns %] ([% ip.ip | html_entity %]) [% ELSE %] [% ip.ip | html_entity %] [% END %] [% END %] [% END %] [% IF params.n_netbios %] [% FOREACH nbt IN node.netbios %] \\[% nbt.domain | html_entity %]\[% nbt.nbname | html_entity %] [% nbt.nbuser || '[No User]' | html_entity %]@[% nbt.ip | html_entity %] [% END %] [% END %] [% END %] [% END %] | [% row.stp | html_entity %][% END %] [% IF params.c_up %] | [% row.up_admin.ucfirst | html_entity %] / [% row.up.ucfirst | html_entity %][% END %] [% FOREACH config IN settings._extra_device_port_cols %] [% NEXT UNLESS config.position == 'right' AND params.${config.name} %] | [% TRY %] [% INCLUDE "plugin/${config.name}/device_port_column.tt" %] [% CATCH %] [% END %][% END %] |