colorizing table lines to warning = yellow and danger = light red if reflector\'s not responding since 30 or 60 minutes.

This commit is contained in:
dg9vh 2016-07-02 13:33:37 +00:00
parent c94765ba52
commit 8fd6631667

View file

@ -40,12 +40,25 @@
<?php <?php
$counter = 1; $counter = 1;
foreach ($activeYSFReflectors as $reflector) { foreach ($activeYSFReflectors as $reflector) {
echo "<tr>"; $timestamp = $reflector[4];
$timestamp2 = new DateTime($timestamp);
$now = new DateTime();
$timestamp2->add(new DateInterval('PT60M'));
if ($now->format('U') >= $timestamp2->format('U')) {
echo "<tr class=\"danger\">";
} else {
$timestamp2 = new DateTime($timestamp);
$timestamp2->add(new DateInterval('PT30M'));
if ($now->format('U') >= $timestamp2->format('U')) {
echo "<tr class=\"warning\">";
} else {echo "<tr>";
}
}
echo "<td>$counter</td>"; echo "<td>$counter</td>";
for ($i = 0; $i < 5; $i++) { for ($i = 0; $i < 5; $i++) {
echo"<td>$reflector[$i]</td>"; echo"<td>$reflector[$i]</td>";
} }
echo "</tr>"; echo "</tr>\n";
$counter++; $counter++;
} }
} }