cloud/bmaas: implement webug
Webug (pronounced: /wɛbʌɡ/, not /wiːbʌɡ/) is a web debug interface for
BMDB, inspired by the great web debug interfaces of old.
It uses the new BMDB reflection API to access most
machine/tag/work/backoff information, plus sqlc queries to access
session information.
Change-Id: If0e65b6fc33ad92baef9c6d98333f90a02efa1b3
Reviewed-on: https://review.monogon.dev/c/monogon/+/1132
Reviewed-by: Lorenz Brun <lorenz@monogon.tech>
Tested-by: Jenkins CI
diff --git a/cloud/bmaas/bmdb/webug/templates/base.html b/cloud/bmaas/bmdb/webug/templates/base.html
new file mode 100644
index 0000000..3b8df8e
--- /dev/null
+++ b/cloud/bmaas/bmdb/webug/templates/base.html
@@ -0,0 +1,90 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>BMDB webug</title>
+<style>
+ body {
+ font-family: sans-serif;
+ background: #fff;
+ }
+
+ /* Logotype. */
+ h1 {
+ clear: both;
+ padding-left: 1em;
+ padding-top: 0.5em;
+ }
+ h1 a {
+ text-decoration: none;
+ }
+ h1 a, h1 a:visited, h1 a:hover, h1 a:active {
+ color: inherit;
+ }
+ h1 span.red {
+ background-color: red;
+ color: white;
+ padding: 0.1em;
+ border-radius: 0.4em;
+ }
+ h1 span.info {
+ font-size: 0.5em;
+ font-weight: normal;
+ font-style: italic;
+ }
+
+ /* Section headers. */
+ h2 {
+ clear: both;
+ width: 100%;
+ text-align: center;
+ font-size: 120%;
+ background: #eeeeff;
+ }
+
+ /* Stylish tables. */
+ table, th, td {
+ background-color: #eee;
+ padding: 0.2em 0.4em 0.2em 0.4em;
+ }
+ table th {
+ background-color: #c0c0c0;
+ }
+ table {
+ background-color: #fff;
+ border-spacing: 0.2em;
+ }
+
+ /* Colouring of the Work History log in machine.html. */
+ tr.EventFailed td, tr.EventCanceled td {
+ background-color: #f8e8e8;
+ }
+ tr.EventFinished td {
+ background-color: #e8f8e8;
+ }
+
+ /* Generic font style tags for any element. */
+ .small {
+ font-size: 0.8em;
+ }
+ .faint {
+ color: #333;
+ }
+ .mono {
+ font-family: monospace;
+ }
+ .error {
+ color: #f00;
+ }
+
+ /* For simple column style layouts. */
+ .vsplit {
+ display: flex;
+ flex-direction: row;
+ flex-wrap: nowrap;
+ align-items: stretch;
+ }
+ .column {
+ flex-grow: 1;
+ padding: 0.5em;
+ }
+</style>
+<h1><a href="/">we<span class="red">bug</span></a> <span class="info">BMDB at {{ .BMDBAddress }} schema {{ .BMDBSchema }}</span></h1>
\ No newline at end of file