Skip to content
Snippets Groups Projects
Commit acb1588d authored by Tibo's avatar Tibo
Browse files

Show errors

parent 478378ba
No related branches found
No related tags found
No related merge requests found
......@@ -90,12 +90,15 @@ class Server extends Model
* @return int
*/
public function status() {
$all_status = [];
return max($this->statusArray());
}
public function statusArray() {
$status_array = [];
foreach ($this->getSensors() as $sensor) {
$all_status[] = $sensor->status();
$status_array[\get_class($sensor)] = $sensor->status();
}
return max($all_status);
return $status_array;
}
public function statusString() {
......
......@@ -16,6 +16,14 @@
</div>
<div class="card-body">
<ul>
@foreach ($server->getSensors() as $sensor)
@if ($sensor->status() > 0)
<li>{{ $sensor->getName() }}</li>
@endif
@endforeach
</ul>
{!! $server->getBadge() !!}
<p>
{{ $server->lastRecordTime()->diffForHumans() }}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment