Skip to content

Commit

Permalink
[webui] sort ports in VLANs blade (librenms#15960)
Browse files Browse the repository at this point in the history
* [webui] vlans blade sort

sort ports in VLANs blade

before:
gi1/0/1,gi1/0/10,gi1/0/2,gi1/0/23,gi1/0/24,gi1/0/3,gi1/0/4,gi1/0/5,gi1/0/6,gi1/0/7,gi1/0/8,gi1/0/9,Po1,te1/0/2,te1/0/3,te1/0/4

after:
gi1/0/1,gi1/0/2,gi1/0/3,gi1/0/4,gi1/0/5,gi1/0/6,gi1/0/7,gi1/0/8,gi1/0/9,gi1/0/10,gi1/0/23,gi1/0/24,te1/0/2,te1/0/3,te1/0/4,Po1

Signed-off-by: Peca Nesovanovic <peca.nesovanovic@sattrakt.com>

* sort in controller

* sortby vlan,port

---------

Signed-off-by: Peca Nesovanovic <peca.nesovanovic@sattrakt.com>
  • Loading branch information
Npeca75 committed May 4, 2024
1 parent 2efd30f commit 2ff5728
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Http/Controllers/Device/Tabs/VlansController.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ private static function getVlans(Device $device)
})
->with(['port.device'])
->select('ports_vlans.*', 'vlans.vlan_name')->orderBy('vlan_vlan')->orderBy('ports.ifName')->orderBy('ports.ifDescr')
->get();
->get()->sortBy(['vlan', 'port']);

$data = $portVlan->groupBy('vlan');

Expand Down

0 comments on commit 2ff5728

Please sign in to comment.