mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fix device list down devices that have never been polled (#9994)
* Fix device list down devices that have never been polled * Suggestion with 'Never' in case last_polled empty and down * Improve handling of all cases * fix doc comment
This commit is contained in:
@@ -126,7 +126,7 @@ class DeviceController extends TableController
|
||||
'metrics' => $this->getMetrics($device),
|
||||
'hardware' => Rewrite::ciscoHardware($device),
|
||||
'os' => $this->getOsText($device),
|
||||
'uptime' => Time::formatInterval($device->status ? $device->uptime : $device->last_polled->diffInSeconds(), 'short'),
|
||||
'uptime' => (!$device->status && !$device->last_polled) ? __('Never polled') : Time::formatInterval($device->status ? $device->uptime : $device->last_polled->diffInSeconds(), 'short'),
|
||||
'location' => $this->getLocation($device),
|
||||
'actions' => $this->getActions($device),
|
||||
];
|
||||
@@ -212,6 +212,8 @@ class DeviceController extends TableController
|
||||
/**
|
||||
* @param $device
|
||||
* @param $count
|
||||
* @param $tab
|
||||
* @param $icon
|
||||
* @return string
|
||||
*/
|
||||
private function formatMetric($device, $count, $tab, $icon)
|
||||
|
Reference in New Issue
Block a user