diff --git a/lib/App/Netdisco/DB/Result/Device.pm b/lib/App/Netdisco/DB/Result/Device.pm index c587358a..f240c177 100644 --- a/lib/App/Netdisco/DB/Result/Device.pm +++ b/lib/App/Netdisco/DB/Result/Device.pm @@ -370,7 +370,8 @@ sub renumber { $device->update({ ip => $new_ip, - dns => hostname_from_ip($new_ip), + dns => (hostname_from_ip($new_ip) + || eval { $schema->resultset('DeviceIp')->find($new_ip,$new_ip)->dns } || undef), }); return $device; diff --git a/lib/App/Netdisco/Web/Plugin/Device/Details.pm b/lib/App/Netdisco/Web/Plugin/Device/Details.pm index ced83b18..93f86494 100644 --- a/lib/App/Netdisco/Web/Plugin/Device/Details.pm +++ b/lib/App/Netdisco/Web/Plugin/Device/Details.pm @@ -30,9 +30,14 @@ ajax '/ajax/content/device/details' => require_login sub { = schema('netdisco')->resultset('DevicePower') ->search( { 'me.ip' => $device->ip } )->with_poestats->hri->all; + my @interfaces + = schema('netdisco')->resultset('Device') + ->find($device->ip) + ->device_ips->hri->all; + content_type('text/html'); template 'ajax/device/details.tt', { - d => $results[0], p => \@power + d => $results[0], p => \@power, interfaces => \@interfaces, }, { layout => undef }; }; diff --git a/share/views/ajax/device/details.tt b/share/views/ajax/device/details.tt index 002abb44..e5206435 100644 --- a/share/views/ajax/device/details.tt +++ b/share/views/ajax/device/details.tt @@ -245,8 +245,12 @@
No check is made as to whether the new IP is reachable