bug fix: add order_by after nodes name build

This commit is contained in:
Oliver Gorwits
2013-09-08 21:40:48 +01:00
parent e1896242fd
commit e77a806f65

View File

@@ -65,9 +65,9 @@ ajax '/ajax/content/device/ports' => require_login sub {
# what kind of nodes are we interested in? # what kind of nodes are we interested in?
my $nodes_name = (param('n_archived') ? 'nodes' : 'active_nodes'); my $nodes_name = (param('n_archived') ? 'nodes' : 'active_nodes');
$nodes_name .= '_with_age' if param('c_nodes') and param('n_age');
$set = $set->search_rs({}, { order_by => ["${nodes_name}.mac", "ips.ip"] }) $set = $set->search_rs({}, { order_by => ["${nodes_name}.mac", "ips.ip"] })
if param('c_nodes'); if param('c_nodes');
$nodes_name .= '_with_age' if param('c_nodes') and param('n_age');
# retrieve active/all connected nodes, if asked for # retrieve active/all connected nodes, if asked for
$set = $set->search_rs({}, { prefetch => [{$nodes_name => 'ips'}] }) $set = $set->search_rs({}, { prefetch => [{$nodes_name => 'ips'}] })