Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 115acc0

Browse files
committed
Added some highlighting to the auto-numbered VM names to easily spot missing agents
1 parent 985cb50 commit 115acc0

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

www/getTesters.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,20 @@
4545
}
4646
echo "</tr>\n";
4747
$count = 0;
48+
$lastPC = null;
4849
foreach($location['testers'] as $tester) {
4950
$count++;
50-
echo "<tr><td nowrap class=\"tester\">$count</td>";
51+
$style = '';
52+
if (isset($tester['pc'])) {
53+
if (preg_match('/^VM([0-9A-Za-z][0-9A-Za-z])-([0-9A-Za-z][0-9A-Za-z])/', $tester['pc'], $matches)) {
54+
$pc = intval($matches[2]);
55+
if (isset($lastPC) && $pc !== ($lastPC + 1)) {
56+
$style = ' style="background-color:#ffffb3;"';
57+
}
58+
$lastPC = $pc;
59+
}
60+
}
61+
echo "<tr$style><td nowrap class=\"tester\">$count</td>";
5162
echo "<td nowrap>" . @htmlspecialchars($tester['busy']) . "</td>";
5263
echo "<td nowrap>" . @htmlspecialchars($tester['elapsed']) . "</td>";
5364
echo "<td nowrap>" . @htmlspecialchars($tester['last']) . "</td>";

0 commit comments

Comments
 (0)