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

Show sensorsNOK

parent acb1588d
No related branches found
No related tags found
No related merge requests found
......@@ -101,6 +101,16 @@ class Server extends Model
return $status_array;
}
public function getSensorsNOK() {
$sensorsNOK = [];
foreach ($this->getSensors() as $sensor) {
if ($sensor->status() > 0) {
$sensorsNOK[] = $sensor;
}
}
return $sensorsNOK;
}
public function statusString() {
switch ($this->status()) {
case 0:
......
......@@ -16,11 +16,9 @@
</div>
<div class="card-body">
<ul>
@foreach ($server->getSensors() as $sensor)
@if ($sensor->status() > 0)
<ul class="list-unstyled">
@foreach ($server->getSensorsNOK() as $sensor)
<li>{{ $sensor->getName() }}</li>
@endif
@endforeach
</ul>
......
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