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:
parent
c94765ba52
commit
8fd6631667
1 changed files with 15 additions and 2 deletions
|
@ -40,12 +40,25 @@
|
|||
<?php
|
||||
$counter = 1;
|
||||
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>";
|
||||
for ($i = 0; $i < 5; $i++) {
|
||||
echo"<td>$reflector[$i]</td>";
|
||||
}
|
||||
echo "</tr>";
|
||||
echo "</tr>\n";
|
||||
$counter++;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue