make VLAN names option work for VLANS missing a name

This commit is contained in:
Oliver Gorwits
2022-07-27 21:30:42 +01:00
parent ba7347eafa
commit 48b7447537
3 changed files with 6 additions and 6 deletions

View File

@@ -109,8 +109,8 @@ get '/ajax/content/device/ports' => require_login sub {
select => [
'port',
{ count => 'port_vlans.vlan', -as => 'vlan_count' },
{ array_agg => 'port_vlans.vlan', -as => 'vlan_set' },
{ array_agg => 'vlan_entry.description', -as => 'vlan_name_set' },
{ array_agg => \q{port_vlans.vlan ORDER BY port_vlans.vlan}, -as => 'vlan_set' },
{ array_agg => \q{COALESCE(NULLIF(vlan_entry.description,''), vlan_entry.vlan::text) ORDER BY vlan_entry.vlan}, -as => 'vlan_name_set' },
],
join => {'port_vlans' => 'vlan_entry'},
group_by => 'me.port',