diff --git a/Netdisco/lib/App/Netdisco/Web/Plugin/Device/Ports.pm b/Netdisco/lib/App/Netdisco/Web/Plugin/Device/Ports.pm index dfae0a0f..e60fa9b6 100644 --- a/Netdisco/lib/App/Netdisco/Web/Plugin/Device/Ports.pm +++ b/Netdisco/lib/App/Netdisco/Web/Plugin/Device/Ports.pm @@ -132,7 +132,12 @@ get '/ajax/content/device/ports' => require_login sub { # retrieve active/all connected nodes, if asked for $rs = $rs->search_rs( {}, - { prefetch => 'nodes', bind => [ $device->ip ] } ) + { prefetch => 'nodes', bind => [ $device->ip ], + order_by => [ + { -desc => 'nodes.active' }, + { -asc => 'nodes.mac' }, + { -asc => 'nodes.ip' }, + ] }) if param('c_nodes'); my @results = $rs->hri->all;