Skip to content

Commit

Permalink
First attempt of Up/Down time
Browse files Browse the repository at this point in the history
  • Loading branch information
PipoCanaja committed Mar 14, 2019
1 parent de4cc92 commit 2a29bf5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
1 change: 0 additions & 1 deletion app/Http/Controllers/Table/DeviceController.php
Expand Up @@ -126,7 +126,6 @@ public function formatItem($device)
'hardware' => Rewrite::ciscoHardware($device),
'os' => $this->getOsText($device),
'uptime' => $device->formatUptime(true, ! $device->getStatus()),
//'downtime' => $device->formatUptime(true,true),
'location' => $this->getLocation($device),
'actions' => $this->getActions($device),
];
Expand Down
3 changes: 1 addition & 2 deletions app/Models/Device.php
Expand Up @@ -255,11 +255,10 @@ public function formatUptime($short = false, $downtime = false)
{
$result = '';
if ($downtime) {
$interval = time() - strtotime($this->last_polled); //xxx$this->uptime;
$interval = time() - strtotime($this->last_polled);
} else {
$interval = $this->uptime;
}

$data = [
'years' => 31536000,
'days' => 86400,
Expand Down

0 comments on commit 2a29bf5

Please sign in to comment.