Display Up/Down time in Device List (#9951)

* First attempt of Up/Down time

* First attempt of Up/Down time

* Moved to Time::formatInterval()

* cleaning

* last polled in casts

* Cleaning the variants of formatUptime()

* Cleaning in ./html/includes/dev-overview-data.inc.php

* Cleaning in ./html/includes/dev-overview-data.inc.php

* Cleaning in ./html/includes/dev-overview-data.inc.php

* updated includes/polling/core.inc.php

* updated includes/alerts.inc.php

* clean accessors
This commit is contained in:
PipoCanaja
2019-03-17 21:09:58 -05:00
committed by Tony Murray
parent 3f5d8e3633
commit a2d378e0be
8 changed files with 60 additions and 88 deletions
@@ -31,6 +31,7 @@ use Illuminate\Database\Eloquent\Builder;
use LibreNMS\Config;
use LibreNMS\Util\Rewrite;
use LibreNMS\Util\Url;
use LibreNMS\Util\Time;
class DeviceController extends TableController
{
@@ -125,7 +126,7 @@ class DeviceController extends TableController
'metrics' => $this->getMetrics($device),
'hardware' => Rewrite::ciscoHardware($device),
'os' => $this->getOsText($device),
'uptime' => $device->formatUptime(true),
'uptime' => Time::formatInterval($device->status ? $device->uptime : $device->last_polled->diffInSeconds(), 'short'),
'location' => $this->getLocation($device),
'actions' => $this->getActions($device),
];