From ad79124b647df1715f07a8b5589b91eb6d72cdb5 Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Mon, 18 Aug 2014 19:46:19 +0100 Subject: [PATCH] node sorting by active, mac, ip --- Netdisco/lib/App/Netdisco/Web/Plugin/Device/Ports.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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;