2016-03-10 17:30:32 +10:00
|
|
|
<?php
|
|
|
|
|
2016-08-21 08:07:14 -05:00
|
|
|
$OBJCOMP = new LibreNMS\Component();
|
2016-03-10 17:30:32 +10:00
|
|
|
|
|
|
|
$common_output[] = '
|
|
|
|
<div>
|
|
|
|
<table id="component-status" class="table table-hover table-condensed table-striped">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th data-column-id="status" data-order="desc">Status</th>
|
|
|
|
<th data-column-id="count">Count</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
';
|
|
|
|
foreach ($OBJCOMP->getComponentStatus() as $k => $v) {
|
|
|
|
if ($k == 0) {
|
|
|
|
$status = 'Ok';
|
|
|
|
$color = 'green';
|
2016-08-18 20:28:22 -05:00
|
|
|
} elseif ($k == 1) {
|
2016-03-10 17:30:32 +10:00
|
|
|
$status = 'Warning';
|
|
|
|
$color = 'grey';
|
2016-08-18 20:28:22 -05:00
|
|
|
} else {
|
2016-03-10 17:30:32 +10:00
|
|
|
$status = 'Critical';
|
|
|
|
$color = 'red';
|
|
|
|
}
|
|
|
|
$common_output[] .= '
|
|
|
|
<tr>
|
|
|
|
<td><p class="text-left '.$color.'">'.$status.'</p></td>
|
|
|
|
<td><p class="text-left '.$color.'">'.$v.'</p></td>
|
|
|
|
</tr>
|
|
|
|
';
|
|
|
|
}
|
|
|
|
$common_output[] .= '
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
';
|