#875 Node Search - swap IP and DNS, add system name, highlight most recent, in the Switch Port rows

This commit is contained in:
Oliver Gorwits
2022-08-16 22:25:27 +01:00
parent dd468efdd5
commit 4d49f04d2a
4 changed files with 50 additions and 43 deletions

View File

@@ -182,7 +182,7 @@ get '/ajax/content/search/node' => require_login sub {
my $rs_dp = schema('netdisco')->resultset('DevicePort');
if ($sightings->has_rows or $ips->has_rows or $netbios->has_rows) {
my $ports = param('deviceports')
? $rs_dp->search({ -and => [@where_mac] }) : undef;
? $rs_dp->search({ -and => [@where_mac] }, { order_by => { '-desc' => 'creation' }}) : undef;
return template 'ajax/search/node_by_mac.tt', {
ips => $ips,
@@ -194,7 +194,7 @@ get '/ajax/content/search/node' => require_login sub {
}
else {
my $ports = param('deviceports')
? $rs_dp->search({ -and => [@where_mac, @porttimes] }) : undef;
? $rs_dp->search({ -and => [@where_mac, @porttimes] }, { order_by => { '-desc' => 'creation' }}) : undef;
if (defined $ports and $ports->has_rows) {
return template 'ajax/search/node_by_mac.tt', {