#875 Node Search - swap IP and DNS, add system name, highlight most recent, in the Switch Port rows
This commit is contained in:
@@ -92,7 +92,7 @@ See also the C<node_sightings> helper routine, below.
|
||||
=cut
|
||||
|
||||
__PACKAGE__->has_many( nodes => 'App::Netdisco::DB::Result::Node',
|
||||
{ 'foreign.mac' => 'self.mac' } );
|
||||
{ 'foreign.mac' => 'self.mac' }, { order_by => { '-desc' => 'time_last' }} );
|
||||
|
||||
=head2 netbios
|
||||
|
||||
|
||||
@@ -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', {
|
||||
|
||||
Reference in New Issue
Block a user