Files

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

28 lines
1013 B
PHP
Raw Permalink Normal View History

2020-06-22 22:57:30 +02:00
<?php
$graph_type = 'availability';
2023-10-04 10:32:59 -05:00
$deviceModel = DeviceCache::getPrimary();
foreach ($deviceModel->availability as $index => $duration) {
if (is_integer($index / 2)) {
2020-06-22 22:57:30 +02:00
$row_colour = \LibreNMS\Config::get('list_colour.even');
} else {
$row_colour = \LibreNMS\Config::get('list_colour.odd');
}
2023-10-04 10:32:59 -05:00
$graph_array['device'] = $duration->device_id;
2020-06-22 22:57:30 +02:00
$graph_array['type'] = 'device_' . $graph_type;
2023-10-04 10:32:59 -05:00
$graph_array['duration'] = $duration->duration;
2020-06-22 22:57:30 +02:00
2023-10-04 10:32:59 -05:00
$human_duration = \LibreNMS\Util\Time::formatInterval($duration->duration, parts: 1);
$graph_title = $deviceModel->displayName() . ' - ' . $human_duration;
2020-06-22 22:57:30 +02:00
echo "<div class='panel panel-default'>
<div class='panel-heading'>
2023-10-04 10:32:59 -05:00
<h3 class='panel-title'>" . $human_duration . "<div class='pull-right'>" . round($duration->availability_perc, 3) . '%</div></h3>
2020-06-22 22:57:30 +02:00
</div>';
echo "<div class='panel-body'>";
include 'includes/html/print-graphrow.inc.php';
echo '</div></div>';
}