[projects/pld-builder.new] queue.html: a new page that shows when builds ran and how long

arekm arekm at pld-linux.org
Thu Nov 12 09:18:44 CET 2026


commit 9c47734c3e1a74461984048eaf31b4d1efc7d2a3
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Thu Nov 12 09:17:38 2026 +0100

    queue.html: a new page that shows when builds ran and how long
    
    One row per batch, each builder with status, start and end, duration
    and log in columns that line up; only failures and work in progress
    are coloured. On top: what each builder does now, a live search and
    filters; at the bottom: a legend. No jQuery from other sites.
    
    The page copies its style.css and script.js to www itself and links
    them with a version, so browsers do not keep old ones after an update.

 PLD_Builder/bqueue.py                 |   2 +-
 PLD_Builder/queue_html.py             | 383 ++++++++++++++++++++++++----------
 PLD_Builder/request_handler_server.py |  28 ---
 PLD_Builder/script.js                 |  99 +++++----
 PLD_Builder/style.css                 | 349 +++++++++++++++++++++++++------
 5 files changed, 613 insertions(+), 248 deletions(-)
---
diff --git a/PLD_Builder/bqueue.py b/PLD_Builder/bqueue.py
index 9a9278d..3e59256 100644
--- a/PLD_Builder/bqueue.py
+++ b/PLD_Builder/bqueue.py
@@ -36,7 +36,7 @@ class B_Queue:
     def dump_html(self, fname):
         (fdno, tmpfname) = tempfile.mkstemp(dir=os.path.dirname(fname))
         f = os.fdopen(fdno, "w")
-        queue_html.write(f, self.requests)
+        queue_html.write(f, self.requests, os.path.dirname(fname))
         f.flush()
         os.fsync(f.fileno())
         f.close()
diff --git a/PLD_Builder/queue_html.py b/PLD_Builder/queue_html.py
index be39f5a..1565cf0 100644
--- a/PLD_Builder/queue_html.py
+++ b/PLD_Builder/queue_html.py
@@ -1,129 +1,280 @@
 # vi: ts=8 sts=4 sw=4 et
-"""The queue as a web page: queue.html of the src builder."""
+"""The queue as a web page: queue.html of the src builder.
 
-import html
+    line of builders    what each builds right now, and how much waits for it
+    requests            newest first, under the day they were queued
+      batches           what to build, then what each builder made of it and when
+    legend              a request with its parts named instead of filled in
+
+style.css draws it. script.js fills in the times that go on running ("5 min ago") and filters
+the requests.
+"""
+
+import os
+import tempfile
 import time
 import urllib.parse
 from datetime import datetime
 
-import pytz
-
 from config import config
 from request import escape, is_final
 
+quote = urllib.parse.quote
 
-# return timestamp with timezone information
-# so we could parse it in javascript
-def tzdate(t):
-    # %z of localtime(t) is the offset in effect at t, DST included
-    return time.strftime("%a %b %d %Y %H:%M:%S %z", time.localtime(t))
-
-# return date in iso8601 format
-def iso8601(ts, timezone='UTC'):
-    tz = pytz.timezone(timezone)
-    dt = datetime.fromtimestamp(ts, tz)
-    return dt.isoformat()
-
-
-def write(f, requests):
-    f.write("""
-<html>
-    <head>
-    <link rel="Shortcut Icon" href="//www.pld-linux.org/favicon.ico"/>
-        <title>PLD builder queue</title>
-        <link rel="stylesheet" type="text/css" charset="utf-8" media="all" href="style.css">
-        <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
-        <script src="//cdnjs.cloudflare.com/ajax/libs/jquery-timeago/1.4.3/jquery.timeago.min.js"></script>
-        <script type="text/javascript" src="script.js"></script>
-    </head>
-<body>
-<div id="header">
-    <div id="requesters-filter">Filter by requesters:<br></div>
-</div>
-<div id="content">
-"""
+
+def write(f, requests, www):
+    """Write the page, which is to be in www, and put the files it uses there"""
+    f.write(page(requests, {name: publish(name, www) for name in ("style.css", "script.js")}))
+
+
+def publish(name, www):
+    """Copy a file of the page to www when it changed, and say how the page refers to it
+
+    The address changes with the copy, so a browser fetches it again rather than draw the page
+    with an older one it keeps.
+    """
+    src = os.path.join(os.path.dirname(__file__), name)
+    dst = os.path.join(www, name)
+    if not os.path.exists(dst) or os.stat(src).st_mtime > os.stat(dst).st_mtime:
+        (fd, tmp) = tempfile.mkstemp(dir=www)
+        with open(src) as r, os.fdopen(fd, "w") as w:
+            w.write(r.read())
+        os.chmod(tmp, 0o644)
+        os.rename(tmp, dst)
+    return f"{name}?{int(os.stat(dst).st_mtime)}"
+
+
+def page(requests, files):
+    newest_first = sorted(requests, key=lambda r: r.no, reverse=True)
+    return (
+        '<!DOCTYPE html>\n'
+        '<html lang="en">\n'
+        '<head>\n'
+        '<meta charset="utf-8">\n'
+        '<meta name="viewport" content="width=device-width, initial-scale=1">\n'
+        '<link rel="Shortcut Icon" href="//www.pld-linux.org/favicon.ico">\n'
+        '<title>PLD builder queue</title>\n'
+        f'<link rel="stylesheet" href="{files["style.css"]}">\n'
+        f'<script src="{files["script.js"]}" defer></script>\n'
+        '</head>\n'
+        '<body>\n'
+        '<header id="top">\n'
+        '<h1>PLD builder queue</h1>\n'
+        '<input type="search" id="search" placeholder="Search: package, requester, status, id" size="34">\n'
+        '<span id="shown"></span>\n'
+        '<label>Requester <select id="requester"><option value="">everyone</option></select></label>\n'
+        '<label><input type="checkbox" id="unfinished"> only failed or unfinished</label>\n'
+        '</header>\n'
+        + builders_line(requests)
+        + '<main>\n'
+        + requests_by_day(newest_first)
+        + LEGEND.format(zone=time.strftime("%Z"))
+        + '</main>\n'
+        '</body>\n'
+        '</html>\n'
     )
-    for r in reversed(requests):
-        write_group(f, r)
-    f.write("</div></body></html>\n")
-
-
-def write_group(f, r):
-    flags = escape(' '.join(r.flags))
-    dt = escape(iso8601(r.time))
-    f.write(
-        f"<div id=\"{r.no}\" class=\"request {flags}\">\n"
-        f"<a href=\"#{r.no}\">{r.no}</a>. "
-        f"<time class=\"timeago\" title=\"{dt}\" datetime=\"{dt}\">{escape(tzdate(r.time))}</time> "
-        f"from <b class=requester>{escape(r.requester)}</b> "
-        f"<small><a href=\"srpms/{r.id}\">{r.id}</a>, "
-        f"prio={r.priority}, jobs={r.max_jobs}, {flags}</small>\n"
+
+
+# -- times and statuses
+
+def clock(t):
+    return time.strftime("%H:%M", time.localtime(t))
+
+
+def clock_zone(t):
+    """The zone goes with the time a request was queued; the times under it are of the same clock"""
+    return time.strftime("%H:%M %Z", time.localtime(t))
+
+
+def iso(t):
+    """For script.js, which counts the time from then till now"""
+    return datetime.fromtimestamp(t).astimezone().isoformat(timespec="seconds")
+
+
+def duration(seconds):
+    seconds = int(seconds)
+    if seconds < 60:
+        return f"{seconds}s"
+    if seconds < 3600:
+        return f"{seconds // 60}m {seconds % 60:02d}s"
+    return f"{seconds // 3600}h {seconds % 3600 // 60:02d}m"
+
+
+def kind(status):
+    """The css class of a status: its colour"""
+    for prefix, name in (("OK", "ok"), ("FAIL", "fail"), ("SKIP", "skip"), ("UNSUPP", "skip")):
+        if status.startswith(prefix):
+            return name
+    return {"?": "wait", "UPLOADING": "up"}.get(status, "run")
+
+
+def plaque(status):
+    word = {"?": "waiting"}.get(status, status if is_final(status) else status.lower())
+    # FAIL_GENERATE_BUILDREQUIRES and the like may break at an underscore rather than push the times aside
+    return f'<b class="s {kind(status)}">{escape(word).replace("_", "_<wbr>")}</b>'
+
+
+def running_since(t):
+    """script.js writes into it how long ago t was"""
+    return f'<time class=since datetime="{iso(t)}" title="since {clock_zone(t)}"></time>'
+
+
+# -- the line of builders
+
+def builders_line(requests):
+    names = [b for b in config.binary_builders]
+    for r in requests:
+        for batch in r.batches:
+            names += [b for b in batch.builders if b not in names]
+    return '<div id="now">\n' + "".join(builder_now(name, requests) for name in names) + '</div>\n'
+
+
+def builder_now(name, requests):
+    """A builder builds one batch at a time, taking requests by priority, then by age"""
+    mine = [(r, batch) for r in sorted(requests, key=lambda r: (r.priority, r.time))
+            for batch in r.batches if name in batch.builders]
+
+    doing = '<b class="s idle">idle</b>'
+    # a batch built earlier may still be on its way to ftp: shown when nothing is being built
+    for status, since in (("BUILDING", "builders_build_start"), ("UPLOADING", "builders_build_end")):
+        found = [(r, batch) for r, batch in mine if batch.builders_status[name] == status]
+        if found:
+            r, batch = found[0]
+            t = getattr(batch, since).get(name) or batch.builders_status_time[name]
+            doing = f'{plaque(status)} <a href="#{r.no}">{escape(batch_name(batch))}</a> {running_since(t)}'
+            break
+
+    waiting = [f"{r.no} {batch_name(batch)}, queued {time.strftime('%b %-d %H:%M', time.localtime(r.time))}"
+               for r, batch in mine if batch.builders_status[name] == "?"]
+    waits = f' <i title="{escape(chr(10).join(waiting))}">+{len(waiting)} waiting</i>' if waiting else ""
+    return f'<span><b>{escape(name)}</b> {doing}{waits}</span>\n'
+
+
+# -- requests
+
+def requests_by_day(requests):
+    out = []
+    day = None
+    for r in requests:
+        queued = time.strftime("%A, %-d %B %Y", time.localtime(r.time))
+        if queued != day:
+            day = queued
+            out.append(f'<h2>{day}</h2>\n')
+        out.append(request_html(r))
+    return "".join(out)
+
+
+def request_state(r):
+    """Decides the stripe on the left of a request, and what the filter of unfinished ones keeps"""
+    statuses = [s for batch in r.batches for s in batch.builders_status.values()]
+    if any(s.startswith("FAIL") for s in statuses):
+        return "fail"
+    return "done" if all(is_final(s) for s in statuses) else "open"
+
+
+def request_html(r):
+    flags = "".join(f' <span class="flag {escape(flag)}">{escape(flag)}</span>' for flag in r.flags)
+    jobs = f", jobs {r.max_jobs}" if r.max_jobs else ""
+    return (
+        f'<section class="request {request_state(r)}" id="{r.no}" data-requester="{escape(r.requester)}">\n'
+        f'<header><a class=no href="#{r.no}">{r.no}</a> <b class=from>{escape(r.requester)}</b>{flags}'
+        f' <span class=rid>priority {r.priority}{jobs}, <a href="srpms/{escape(r.id)}">{escape(r.id)}</a></span>'
+        f' <span class=sent>queued {clock_zone(r.time)}, <time class=ago datetime="{iso(r.time)}"></time></span></header>\n'
+        + "".join(batch_html(batch, r.id) for batch in r.batches)
+        + '</section>\n'
     )
-    f.write("<ol>\n")
-    for b in r.batches:
-        write_batch(f, b, r.id)
-    f.write("</ol>\n")
-    f.write("</div>\n")
-
-
-def write_batch(f, b, rid):
-    quote = urllib.parse.quote
-    f.write("<li>\n")
-    if b.is_command():
-        flags = escape(' '.join(b.command_flags))
-        desc = f"SH: <pre>{escape(b.command)}</pre> flags: [{flags}]"
+
+
+def batch_name(batch):
+    return "command" if batch.is_command() else batch.src_rpm.removesuffix(".src.rpm")
+
+
+def batch_html(batch, request_id):
+    wide = False
+    if batch.is_command():
+        flags = f" [{escape(' '.join(batch.command_flags))}]" if batch.command_flags else ""
+        command = batch.command.strip()
+        # a command of several lines takes the whole width, with its builders under it
+        wide = "\n" in command
+        what = f'<b>command</b>{flags}' + (f'<pre>{escape(command)}</pre>' if wide else f' <code>{escape(command)}</code>')
     else:
-        package_url = ("http://git.pld-linux.org/gitweb.cgi"
-                       f"?p=packages/{quote(b.spec[:-5])}.git"
-                       f";f={quote(b.spec)};h={quote(b.branch)};a=shortlog")
-        link = f"<a href=\"{escape(package_url)}\">{escape(b.spec)} -r {escape(b.branch)}</a>"
-        rpmopts = b.bconds_string() + b.kernel_string() + b.target_string() + b.defines_string()
-        desc = f"{escape(b.src_rpm)} ({link}{escape(rpmopts)})"
-    f.write(f"{desc} <small>[")
-    builders = []
-    for builder in b.builders:
-        s = b.builders_status[builder]
-        if s.startswith("OK"):
-            c = "green"
-        elif s.startswith("FAIL"):
-            c = "red"
-        elif s.startswith("SKIP"):
-            c = "blue"
-        elif s.startswith("UNSUPP"):
-            c = "fuchsia"
-        elif s != "?":
-            c = "darkorange"
-        else:
-            c = "black"
-        link_pre = ""
-        link_post = ""
-        if is_final(s) and len(b.spec) > 5:
-            if b.is_command():
-                bl_name = "command"
-            else:
-                bl_name = b.spec[:len(b.spec)-5]
-            lin_ar = builder.replace('noauto-','')
-            is_ok = 0
-            if s.startswith("OK"):
-                is_ok = 1
-            bld = lin_ar.split('-')
-            tree_name = '-'.join(bld[:-1])
-            tree_arch = '-'.join(bld[-1:])
-            link_pre = f"<a href=\"{config.buildlogs}/index.php?dist={quote(tree_name)}&arch={quote(tree_arch)}" \
-                f"&ok={is_ok}&name={quote(bl_name)}&id={quote(rid)}&action=tail\">"
-            link_post = "</a>"
-
-        def ftime(t):
-            if t > 0:
-                return time.asctime(time.localtime(t))
-            else:
-                return 'N/A'
-
-        tooltip = (f"last update: {ftime(b.builders_status_time[builder])}\n"
-                   f"build started: {ftime(b.builders_build_start.get(builder, 0))}\n"
-                   f"build ended: {ftime(b.builders_build_end.get(builder, 0))}")
-        builders.append(link_pre +
-            f"<font color='{c}'><b title=\"{html.escape(tooltip, True)}\">"
-            f"{escape(builder)}:{escape(s)}</b></font>"
-        + link_post)
-    f.write("{}]</small></li>\n".format(' '.join(builders)))
+        package = batch.spec.removesuffix(".spec")
+        git_log = ("http://git.pld-linux.org/gitweb.cgi"
+                   f"?p=packages/{quote(package)}.git;f={quote(batch.spec)};h={quote(batch.branch)};a=shortlog")
+        options = batch.bconds_string() + batch.kernel_string() + batch.target_string() + batch.defines_string()
+        what = (f'<b>{escape(batch_name(batch))}</b> '
+                f'<a href="{escape(git_log)}">{escape(batch.spec)} -r {escape(batch.branch)}</a>{escape(options)}')
+    return (
+        f'<div class="batch{" wide" if wide else ""}">\n<div class=what>{what}</div>\n<div class=builders>\n'
+        + "".join(builder_html(batch, name, request_id) for name in batch.builders)
+        + '</div>\n</div>\n'
+    )
+
+
+def builder_html(batch, name, request_id):
+    """What one builder made of a batch: status, start and end, duration and log, each in a column of its own"""
+    status = batch.builders_status[name]
+    start = batch.builders_build_start.get(name)
+    end = batch.builders_build_end.get(name)
+
+    span = took = log = ""
+    if start and end:
+        span, took = f'{clock(start)} → {clock(end)}', duration(end - start)
+    elif start:
+        span, took = f'{clock(start)} → …', running_since(start)
+    elif status != "?":
+        # nothing was built, or an older builder did not say when: the time of the status alone
+        span = clock(batch.builders_status_time[name])
+
+    # a skipped batch was not built, so it has no log
+    if is_final(status) and not status.startswith("SKIP"):
+        log = f'<a href="{escape(build_log(batch, name, status, request_id))}">log</a>'
+    return (f'<div class=builder><span class=who>{escape(name)}</span>{plaque(status)}'
+            f'<span class=span>{span}</span><span class=took>{took}</span><span class=log>{log}</span></div>\n')
+
+
+def build_log(batch, builder, status, request_id):
+    dist, _, arch = builder.replace("noauto-", "").rpartition("-")
+    name = "command" if batch.is_command() else batch.spec.removesuffix(".spec")
+    return (f"{config.buildlogs}/index.php?dist={quote(dist)}&arch={quote(arch)}&ok={int(status.startswith('OK'))}"
+            f"&name={quote(name)}&id={quote(request_id)}&action=tail")
+
+
+# a request laid out as the real ones, saying what stands in each place
+LEGEND = """<h2>How to read a request</h2>
+<section class="request legend">
+<header><span class=no>number</span> <b class=from>who sent it</b> <span class="flag upgrade">upgrade</span>
+ or <span class="flag test-build">test-build</span> <span class=rid>priority, request id with its src.rpm files</span>
+ <span class=sent>queued: when the src builder took the request in</span></header>
+<div class=batch>
+<div class=what><b>package-version-release</b> spec and branch with their git log, build options</div>
+<div class=builders>
+<div class=builder><span class=who>builder</span><b class="s ok">OK</b><span class=span>start → end</span>
+<span class=took>took</span><span class=log><a>log</a></span>
+<p>Built, and its rpms have reached ftp. log: the build log.</p></div>
+<div class=builder><span class=who>builder</span><b class="s fail">FAIL_<wbr>BUILD</b><span class=span>start → end</span>
+<span class=took>took</span><span class=log><a>log</a></span>
+<p>Failed, here in %build of the spec.</p></div>
+<div class=builder><span class=who>builder</span><b class="s skip">SKIP</b><span class=span>time</span>
+<span class=took></span><span class=log></span>
+<p>Not built: a package earlier in this request failed. UNSUPP: the spec excludes this architecture.</p></div>
+</div>
+</div>
+<div class=batch>
+<div class=what>The next package of the request: they are built one after another.</div>
+<div class=builders>
+<div class=builder><span class=who>builder</span><b class="s wait">waiting</b><span class=span></span>
+<span class=took></span><span class=log></span>
+<p>Not started yet.</p></div>
+<div class=builder><span class=who>builder</span><b class="s run">building</b><span class=span>start → …</span>
+<span class=took>so far</span><span class=log></span>
+<p>Being built right now.</p></div>
+<div class=builder><span class=who>builder</span><b class="s up">uploading</b><span class=span>start → end</span>
+<span class=took>took</span><span class=log></span>
+<p>Built; its rpms are on the way to ftp. The times are of the build.</p></div>
+</div>
+</div>
+<p class=note>The stripe on the left is red when anything failed, yellow while something waits or builds, green when
+all is done. Times are in {zone}.</p>
+</section>
+"""
diff --git a/PLD_Builder/request_handler_server.py b/PLD_Builder/request_handler_server.py
index d700456..7d6c404 100644
--- a/PLD_Builder/request_handler_server.py
+++ b/PLD_Builder/request_handler_server.py
@@ -1,5 +1,4 @@
 import argparse
-import os
 import re
 import signal
 import socket
@@ -11,7 +10,6 @@ from http.server import BaseHTTPRequestHandler, HTTPServer
 from socketserver import ForkingMixIn
 
 import log
-import path
 import request_handler
 from acl import acl
 from blacklist import blacklist
@@ -102,33 +100,7 @@ class MyHandler(BaseHTTPRequestHandler):
             log.error(f"request_handler_server: [{self.client_address[0]}]: exception: {e}\n{traceback.format_exc()}")
             raise
 
-def write_css():
-    css_src = os.path.join(os.path.dirname(__file__), 'style.css')
-    css_file = path.www_dir + "/style.css"
-    # skip if file exists and code is not newer
-    if os.path.exists(css_file) and os.stat(css_src).st_mtime < os.stat(css_file).st_mtime:
-        return
-
-    old_umask = os.umask(0o0022)
-    with open(css_src) as r, open(css_file, "w") as f:
-        f.write(r.read())
-    os.umask(old_umask)
-
-def write_js():
-    js_src = os.path.join(os.path.dirname(__file__), 'script.js')
-    js_file = path.www_dir + '/script.js'
-    # skip if file exists and code is not newer
-    if os.path.exists(js_file) and os.stat(js_src).st_mtime < os.stat(js_file).st_mtime:
-        return
-
-    old_umask = os.umask(0o0022)
-    with open(js_src) as r, open(js_file, 'w') as f:
-        f.write(r.read())
-    os.umask(old_umask)
-
 def main(srv_ssl=False):
-    write_css();
-    write_js();
     socket.setdefaulttimeout(30)
     # Default action for SIGTERM/SIGHUP is silent termination; for SIGINT
     # it's KeyboardInterrupt. Capture all three through the same handler
diff --git a/PLD_Builder/script.js b/PLD_Builder/script.js
index 5b8b060..52ab83e 100644
--- a/PLD_Builder/script.js
+++ b/PLD_Builder/script.js
@@ -1,42 +1,67 @@
-jQuery(function($) {
-	update_tz();
-	filter_requesters();
+// "<1m", "5m", "2h 10m", "3d": short, like the durations the page is written with
+function span(seconds) {
+	var min = Math.floor(seconds / 60);
+	if (min < 1) return '<1m';
+	if (min < 60) return min + 'm';
+	if (min < 1440) return Math.floor(min / 60) + 'h ' + String(min % 60).padStart(2, '0') + 'm';
+	return Math.floor(min / 1440) + 'd';
+}
 
-	// setup relative time display
-	function update_tz() {
-		$('time.timeago').timeago();
-	}
+function elapsed(el) {
+	return span((Date.now() - new Date(el.getAttribute('datetime'))) / 1000);
+}
+
+// counted here and not by the builder: the page is written only when the queue changes
+document.querySelectorAll('time.ago').forEach(function(el) {
+	el.textContent = elapsed(el) + ' ago';
+});
+document.querySelectorAll('time.since').forEach(function(el) {
+	el.textContent = elapsed(el);
+});
+
+// the legend is a request with no id
+var requests = document.querySelectorAll('.request[id]');
+var search = document.getElementById('search');
+var shown = document.getElementById('shown');
+var requester = document.getElementById('requester');
+var unfinished = document.getElementById('unfinished');
+
+var names = new Set();
+requests.forEach(function(r) {
+	names.add(r.dataset.requester);
+	// what the search looks in: all a request shows, its number, packages, statuses and ids
+	r.dataset.text = r.textContent.replace(/\s+/g, ' ').toLowerCase();
+});
+Array.from(names).sort().forEach(function(n) { requester.add(new Option(n)); });
 
-	// draw filter for requesters
-	function filter_requesters() {
-		var requesters = ['everyone'];
-		$('div b.requester').each(function(i, d) {
-			var requester = $(d).text();
-			if (!~requesters.indexOf(requester)) {
-				requesters.push(requester);
-			}
-		});
+function filter() {
+	// every word typed has to be found, in any order
+	var words = search.value.toLowerCase().split(/\s+/).filter(Boolean);
+	var count = 0;
+	requests.forEach(function(r) {
+		r.hidden = (requester.value && r.dataset.requester != requester.value) ||
+			(unfinished.checked && r.matches('.done')) ||
+			!words.every(function(w) { return r.dataset.text.includes(w); });
+		if (!r.hidden) count++;
+	});
+	shown.textContent = count == requests.length ? '' : count + ' of ' + requests.length;
+	// a day with none of its requests left
+	document.querySelectorAll('main h2').forEach(function(day) {
+		var el = day.nextElementSibling, any = false;
+		for (; el && el.tagName != 'H2'; el = el.nextElementSibling) any = any || !el.hidden;
+		day.hidden = !any;
+	});
+}
+requester.onchange = unfinished.onchange = filter;
+search.oninput = filter;
 
-		var $filter = $('#requesters-filter');
-		if ($filter.length == 0) {
-			$filter = $('<div id=requesters-filter>Filter by requesters:<br></div>');
-			$('body').prepend($filter);
-		}
-		requesters.forEach(function(r) {
-			var $button = $('<button class=request-filter>'+ r + '</button>');
-			$button.on('click', function() {
-				$('div#requesters-filter button').removeAttr('disabled');
-				$('div.request').filter(function(i, d) {
-					var c = $(d).find('b.requester').text();
-					if (c == r || r == 'everyone') {
-						$(d).show();
-						$button.attr('disabled', 'disabled');
-					} else {
-						$(d).hide();
-					}
-				})
-			})
-			$filter.append($button);
-		});
+// "/" goes to the search, as on many sites; Escape clears it
+document.addEventListener('keydown', function(e) {
+	if (e.key == '/' && document.activeElement != search) {
+		e.preventDefault();
+		search.focus();
+	} else if (e.key == 'Escape' && document.activeElement == search) {
+		search.value = '';
+		filter();
 	}
 });
diff --git a/PLD_Builder/style.css b/PLD_Builder/style.css
index b5fde19..d42ae60 100644
--- a/PLD_Builder/style.css
+++ b/PLD_Builder/style.css
@@ -1,90 +1,307 @@
-/*
- * css from www.pld-linux.org (moinmoin) wiki theme, using css usage firebug plugin to cleanup
- */
 html {
-	background-color: white;
-	color: #5e5e5e;
-	font-family: Tahoma, Arial, Lucida Grande, sans-serif;
-	font-size: 0.75em;
-	line-height: 1.25em;
+	background: #e9ecef;
+	color: #111;
+	font: 14px/1.45 "DejaVu Sans", Verdana, Arial, sans-serif;
+	font-variant-numeric: tabular-nums;
+}
+
+body {
+	margin: 0;
 }
 
 a {
-	text-decoration: underline;
-	color: #006;
+	color: #0b4f9e;
+}
+
+#top {
+	align-items: center;
+	background: #22303f;
+	color: #fff;
+	display: flex;
+	flex-wrap: wrap;
+	gap: 6px 28px;
+	padding: 10px 16px;
+}
+
+h1 {
+	font-size: 18px;
+	margin: 0;
+}
+
+select, input {
+	font: inherit;
+}
+
+#shown {
+	margin-left: -18px;
+}
+
+/* the line of builders: what each does right now */
+#now {
+	background: #fff;
+	border-bottom: 1px solid #aeb6bf;
+	display: flex;
+	flex-wrap: wrap;
+	gap: 4px 0;
+	padding: 7px 16px;
+}
+
+#now span {
+	border-right: 1px solid #aeb6bf;
+	margin-right: 14px;
+	padding-right: 14px;
+	white-space: nowrap;
+}
+
+#now span:last-child {
+	border: 0;
+}
+
+/* "+2 waiting": the list is in its title */
+#now i {
+	border-bottom: 1px dotted #555;
+	color: #555;
+	cursor: help;
+	font-style: normal;
+}
+
+main {
+	padding: 0 16px 40px;
+}
+
+h2 {
+	font-size: 15px;
+	margin: 14px 0 6px;
+}
+
+/* a request: a box with a stripe on the left that tells how it went */
+.request {
+	background: #fff;
+	border: 1px solid #aeb6bf;
+	border-left: 6px solid #2e7d32;
+	margin-bottom: 6px;
+}
+
+.request.fail {
+	border-left-color: #c62828;
+}
+
+.request.open {
+	border-left-color: #f2a900;
+}
+
+.request:target {
+	outline: 3px solid #0b4f9e;
+}
+
+.request > header {
+	background: #dfe4ea;
+	border-bottom: 1px solid #aeb6bf;
+	padding: 2px 12px;
+}
+
+.no {
+	color: #111;
+	font-size: 15px;
+	font-weight: bold;
+}
+
+.from {
+	margin: 0 8px 0 6px;
+}
+
+.flag {
+	background: #fff;
+	border: 1px solid #555;
+	border-radius: 3px;
+	font-size: 12px;
+	padding: 1px 6px;
+}
+
+.flag.upgrade {
+	background: #22303f;
+	border-color: #22303f;
+	color: #fff;
+}
+
+.sent {
+	margin-left: 12px;
+}
+
+.rid {
+	color: #555;
+	font-size: 12px;
+	margin-left: 12px;
+}
+
+.rid a {
+	color: inherit;
+	text-decoration: none;
+}
+
+/* a batch in one row: what to build in a column of its own, the builders beside it; where the row
+   is too narrow, the builders go under it */
+.batch {
+	align-items: baseline;
+	display: flex;
+	flex-wrap: wrap;
+	padding: 3px 12px;
 }
 
-a:hover {
-	color: #006;
+.batch + .batch {
+	border-top: 1px solid #dde1e5;
 }
 
-pre {
-	background: #FFF8EB;
-	border: 1pt solid #FFE2AB;
-	font-family: courier, monospace;
-	padding: 0.5em;
+.what {
+	box-sizing: border-box;
+	overflow-wrap: anywhere;
+	padding-right: 12px;
+	width: 360px;
+}
+
+.what b {
+	margin-right: 6px;
+}
+
+.what code {
+	font: 13px "DejaVu Sans Mono", monospace;
+}
+
+/* a command of several lines takes the whole width, its builders go under it */
+.batch.wide .what {
+	width: 100%;
+}
+
+.what pre {
+	background: #f1f3f5;
+	font: 13px/1.4 "DejaVu Sans Mono", monospace;
+	margin: 4px 0;
+	padding: 5px 8px;
 	white-space: pre-wrap;
-	word-wrap: break-word;
+	word-break: break-word;
 }
 
- at media screen, projection {
-	html {
-		background-color: #f3efe3;
-	}
+.builders {
+	display: flex;
+	flex-wrap: wrap;
+}
 
-	body {
-		position: relative;
-	}
+/* a builder: name, status, start and end, duration, log, each in a column of its own and all builders
+   the same width, so a glance down the page finds each thing in one place */
+.builder {
+	align-items: baseline;
+	border-left: 1px solid #dde1e5;
+	box-sizing: border-box;
+	column-gap: 8px;
+	display: grid;
+	grid-template-columns: 76px 1fr 100px 66px 22px;
+	padding: 0 12px;
+	width: 470px;
+}
 
-	div.request {
-                background-color: #b2eb91;
-        }
-	div > a {
-		font-weight: bold;
-		color: #5e5e5e;
-	}
-	div > a:hover {
-		color: #5e5e5e;
-	}
-	div.upgrade {
-                background-color: #81c784;
-	}
-	div.test-build {
-		background-color: #f8d7da;
-	}
-	div:target {
-		background-color: #fff3cd;
-		color: black;
+/* under a command of several lines the builders keep the columns of the rows around them */
+.batch.wide .builders {
+	margin-left: 360px;
+}
+
+/* a plaque as wide as its word, not as its column */
+.builder > .s {
+	justify-self: start;
+}
+
+.who {
+	color: #22303f;
+	font-size: 12px;
+	font-weight: bold;
+	white-space: nowrap;
+}
+
+.span {
+	color: #555;
+	font-size: 13px;
+	white-space: nowrap;
+}
+
+.took {
+	font-weight: bold;
+	text-align: right;
+	white-space: nowrap;
+}
+
+.log {
+	font-size: 12px;
+}
+
+/* a status */
+.s {
+	border-radius: 3px;
+	color: #fff;
+	display: inline-block;
+	font-size: 12px;
+	padding: 1px 8px;
+}
+
+.s.fail { background: #c62828; }
+.s.run { background: #f2a900; color: #111; }
+.s.up { background: #1565c0; }
+
+/* what needs no attention is only text: the colour of a plaque is kept for failures and work going on */
+.s.ok, .s.skip, .s.wait, .s.idle {
+	background: none;
+	font-size: inherit;
+	padding: 0;
+}
+
+.s.ok { color: #2e7d32; }
+.s.skip { color: #6c757d; }
+.s.wait, .s.idle { color: #6c757d; font-weight: normal; }
+
+/* the request at the bottom that explains the others */
+.legend {
+	border-left-color: #aeb6bf;
+}
+
+.legend .builder p {
+	color: #444;
+	font-size: 13px;
+	grid-column: 1 / -1;
+	margin: 0 0 6px;
+}
+
+.legend p.note {
+	border-top: 1px solid #dde1e5;
+	color: #444;
+	font-size: 13px;
+	margin: 0 12px;
+	padding: 6px 0;
+}
+
+ at media (max-width: 700px) {
+	.rid {
+		display: none;
 	}
 
-	#header {
-		background-color: white;
-		border: 1px solid black;
-		padding: 0.5em;
-		position: fixed;
-		right: 0px;
-		bottom: 0px;
-		z-index: 100;
+	/* the builders are one under another here, each in the flow of a line */
+	.builder {
+		border-left: 0;
+		display: flex;
+		flex-wrap: wrap;
+		gap: 0 8px;
+		padding: 0;
+		width: 100%;
 	}
 
-	#content {
-		clear: both;
-		overflow: auto;
-		position: absolute;
+	.what {
 		width: 100%;
 	}
+
+	.batch.wide .builders {
+		margin-left: 0;
+	}
 }
+
 @media print {
-	a {
-		background-color: inherit;
-		color: inherit;
-	}
-	#header {
+	#top label {
 		display: none;
 	}
 }
-
- at media projection {
-	html { line-height: 1.8em; }
-	body, b, a, p { font-size: 22pt; }
-}
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/projects/pld-builder.new.git/commitdiff/9c47734c3e1a74461984048eaf31b4d1efc7d2a3



More information about the pld-cvs-commit mailing list