Add NAC columns to UI (#941)

* Add NAC columns to UI

* Compact variant with a "NAC Summary" column

* display PAE stuff as very short summary in web and full columbs in csv

* add tooltips for actual port status and state detail

* minor naming tweaks

Co-authored-by: Oliver Gorwits <oliver@cpan.org>
This commit is contained in:
Christian Ramseyer
2022-12-13 09:16:32 +01:00
committed by GitHub
parent 3dc302b445
commit 8cc8bdcd19
6 changed files with 108 additions and 5 deletions

View File

@@ -130,10 +130,11 @@ sidebar_defaults:
c_vmember: { label: 'VLAN Membership', default: checked, idx: 15 }
c_power: { label: 'PoE', default: null, idx: 16 }
c_ssid: { label: 'SSID', default: null, idx: 17 }
c_nodes: { label: 'Connected Nodes', default: null, idx: 18 }
c_neighbors: { label: 'Connected Devices', default: checked, idx: 19 }
c_stp: { label: 'Spanning Tree', default: null, idx: 20 }
c_up: { label: 'Status', default: null, idx: 21 }
c_nac_summary: { label: 'NAC/802.1X Status', default: null, idx: 18 }
c_nodes: { label: 'Connected Nodes', default: null, idx: 19 }
c_neighbors: { label: 'Connected Devices', default: checked, idx: 20 }
c_stp: { label: 'Spanning Tree', default: null, idx: 21 }
c_up: { label: 'Up/Down Status', default: null, idx: 22 }
mac_format: { default: IEEE }
n_inventory: { label: 'Remote Inventory', default: checked, idx: 0 }
n_detailed_inventory: { label: 'Remote Advertisement', default: null, idx: 1 }

View File

@@ -144,6 +144,10 @@
<td>Last Macsuck</td>
<td>[% d.last_macsuck_stamp | html_entity %]</td>
</tr>
<tr>
<td>NAC / 802.1X</td>
<td>[% IF d.pae_is_enabled %] <i class="icon-ok-sign text-success"></i> Enabled [% END %]</td>
</tr>
<tr>
<td>Hardware Status</td>
<td>Fan: [% d.fan | html_entity %]

View File

@@ -318,6 +318,20 @@
<td>[% row.ssid.ssid | html_entity %]</td>
[% END %]
[% IF params.c_nac_summary %]
<td>
[% IF row.up == 'up' AND (row.pae_authconfig_port_status OR row.pae_authconfig_state) %]
<i class="icon-[% row.pae_authconfig_port_status == 'authorized' ? 'ok-sign' : 'ban-circle' %]"
rel="tooltip" data-placement="top" data-offset="3" data-animation="" data-title="[% row.pae_authconfig_port_status %]"></i>
<i class="icon-[% row.pae_authconfig_state == 'authenticated' ? 'link' : 'unlink' %]"
rel="tooltip" data-placement="top" data-offset="3" data-animation="" data-title="[% row.pae_authconfig_state %]"></i>
<i class="icon-[% row.pae_authsess_mab ? 'laptop' : 'user' %]"></i>
[% SET sessuser = (row.pae_authsess_user_net_mac.$mac_format_call || row.pae_authsess_user.remove(settings.domain_suffix)) %]
<a href="[% search_node | none %]&q=[% sessuser | uri %]">[% sessuser | html_entity %]</a>
[% END %]
</td>
[% END %]
[% IF params.c_nodes OR params.c_neighbors %]
<td>
[% IF params.c_neighbors AND (row.remote_ip OR row.is_uplink) %]

View File

@@ -20,6 +20,13 @@
[% ELSIF item.name == 'c_power' %]
[% headers.push('PoE Status') %]
[% headers.push('PoE Power (mW)') %]
[% ELSIF item.name == 'c_nac_summary' %]
[% headers.push('PAE AuthConfig Port Control') %]
[% headers.push('PAE AuthConfig State') %]
[% headers.push('PAE AuthConfig Port Status') %]
[% headers.push('PAE AuthSession User') %]
[% headers.push('PAE AuthSession MAB') %]
[% headers.push('PAE Last EAPOL Frame Source') %]
[% ELSIF item.name == 'c_neighbors' %]
[% headers.push('Neighbor IP') %]
[% headers.push('Neighbor DNS') %]
@@ -137,6 +144,15 @@
[% END %]
[% END %]
[% IF params.c_nac_summary %]
[% myport.push( row.pae_authconfig_port_control ) %]
[% myport.push( row.pae_authconfig_state ) %]
[% myport.push( row.pae_authconfig_port_status ) %]
[% myport.push( row.pae_authsess_user ) %]
[% myport.push( row.pae_authsess_mab ) %]
[% myport.push( row.pae_last_eapol_frame_source ) %]
[% END %]
[% IF params.c_nodes %]
[% myport.push('') %]
[% myport.push('') %]