Files

47 lines
1.9 KiB
PHP
Raw Permalink Normal View History

2014-02-26 22:33:45 +00:00
<?php
2015-07-13 20:10:26 +02:00
if ($services['total']) {
2016-03-15 22:16:08 +10:00
// Build the string.
2016-08-18 20:28:22 -05:00
foreach (service_get($device['device_id']) as $data) {
if ($data['service_status'] == '0') {
2016-03-15 22:16:08 +10:00
// Ok
$status = 'green';
} elseif ($data['service_status'] == '1') {
// Warning
2015-07-13 20:10:26 +02:00
$status = 'red';
2016-03-15 22:16:08 +10:00
} elseif ($data['service_status'] == '2') {
// Critical
2016-03-15 22:16:08 +10:00
$status = 'red';
} else {
// Unknown
$status = 'grey';
2015-07-13 20:10:26 +02:00
}
2016-08-18 20:28:22 -05:00
$string .= $break . '<a class=' . $status . '>' . strtolower($data['service_type']) . '</a>';
2015-07-13 20:10:26 +02:00
$break = ', ';
}
2016-03-15 22:16:08 +10:00
?>
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<div class="panel panel-default panel-condensed">
<div class="panel-heading">
<i class="fa fa-cogs fa-lg icon-theme" aria-hidden="true"></i> <strong>Services</strong>
</div>
<table class="table table-hover table-condensed table-striped">
<tr>
<td title="Total"><i class="fa fa-cog" style="color:#0080FF" aria-hidden="true"></i> <?php echo $services['total']?></td>
<td title="Status - Ok"><i class="fa fa-cog" style="color:green" aria-hidden="true"></i> <?php echo $services[0]?></td>
<td title="Status - Warning"><i class="fa fa-cog" style="color:orange" aria-hidden="true"></i> <?php echo $services[1]?></td>
<td title="Status - Critical"><i class="fa fa-cog" style="color:red" aria-hidden="true"></i> <?php echo $services[2]?></td>
</tr>
<tr>
<td colspan='4'><?php echo $string?></td>
</tr>
</table>
2016-03-15 22:16:08 +10:00
</div>
</div>
</div>
</div>
<?php
2016-05-02 18:43:06 +00:00
}