llvm bot monitor: Shade every second bot in the tables
This makes it easier to read across a particular line.
While I'm here update the colspan to reflect the "T Since"
column that was added a while back.
Change-Id: I3256f93f679c2c5d77f1b7a1d1f2c42aad00235d
diff --git a/monitor/bot-status.py b/monitor/bot-status.py
index 5a54299..be7851c 100755
--- a/monitor/bot-status.py
+++ b/monitor/bot-status.py
@@ -19,6 +19,7 @@
# The requests allows HTTP keep-alive which re-uses the same TCP connection
# to download multiple files.
import requests
+from textwrap import dedent
from buildkite_status import get_buildkite_bots_status
@@ -161,22 +162,36 @@
# Whether we use the fail favicon or not
found_failure = False
+ temp.write(dedent("""\
+ <style>
+ /* Combine the border between cells to prevent 1px gaps
+ in the row background colour. */
+ table, td, th {
+ border-collapse: collapse;
+ }
+ /* Colour every other row in a table body grey. */
+ tbody tr:nth-child(even) td {
+ background-color: #ededed;
+ }
+ </style>"""))
+
# Dump all servers / bots
for server in filter(not_ignored, config):
base_url = server['base_url']
builder_url = server['builder_url']
build_url = server['build_url']
- temp.write("<table cellspacing=1 cellpadding=2>\n")
- temp.write("<tr><td colspan=5> </td><tr>\n")
- temp.write("<tr><th colspan=5>{} @ {}</td><tr>\n"
+ temp.write("<table border=0 cellspacing=1 cellpadding=2>\n")
+ temp.write("<tr><td colspan=7> </td><tr>\n")
+ temp.write("<tr><th colspan=7>{} @ {}</td><tr>\n"
.format(server['name'], today))
for builder in server['builders']:
- temp.write("<tr><td colspan=5> </td><tr>\n")
- temp.write("<tr><th colspan=5>{}</td><tr>\n".format(builder['name']))
+ temp.write("<tr><td colspan=7> </td><tr>\n")
+ temp.write("<tr><th colspan=7>{}</th><tr>\n".format(builder['name']))
temp.write("<tr><th>Buildbot</th><th>Status</th><th>T Since</th>"
"<th>Duration</th><th>Build #</th><th>Commits</th>"
"<th>Failing steps</th></tr>\n")
+ temp.write("<tbody>\n")
for bot in builder['bots']:
temp.write("<tr>\n")
try:
@@ -222,6 +237,7 @@
else:
temp.write(empty_cell)
temp.write("</tr>\n")
+ temp.write("</tbody>\n")
temp.write("</table>\n")
temp.write("<link rel=\"shortcut icon\" href=\"{}\" "