Redesign Users (STC/LTC split), Errors, and Event pages; add status dots and progress to test lists

This commit is contained in:
claude committed 2026-10-10 00:43:55 +02:00
1 parent e76aa8a977
commit d8045ddb73
5 files changed
+426 -48

No files matched your search

+7 -1
View File
@@ -1,10 +1,16 @@
{% load mytags %}
{% load mytags uitags %}
<td class="col-author"><a href="/user/{{test.author}}">{{test.author|capfirst|slice:":6"}}</a></td>
<td class="col-engine">{{test.dev_engine}}</td>
<td class="col-test">
<span class="status-dot status-{{ test|test_status }}" title="{{ test|test_status|capfirst }}"></span>
<a href="{{test|workload_url}}">{{test|prettyDevName}}</a>
{% if test.error %}<span class="flag flag-error" title="Crash or illegal move">crash</span>{% endif %}
{% if test|test_is_fischer %}<span class="flag flag-frc" title="Fischer random chess">frc</span>{% endif %}
{% with progress=test|progress_info %}
{% if progress %}
<div class="ob-progress ob-progress-{{ progress.tone }}" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="{{ progress.pct }}" title="{{ progress.pct }}%"><span style="width: {{ progress.pct }}%"></span></div>
{% endif %}
{% endwith %}
</td>
<td class="col-diff textcenter"><a href="{{test|gitDiffLink}}">diff</a></td>
<td class="col-tc">
+35 -20
View File
@@ -1,32 +1,47 @@
{% extends "OpenBench/base.html" %}
{% load uitags %}
{% block page_head %}<div><h1 class="page-title">Errors</h1><p class="page-sub">Crashes and illegal moves reported by workers</p></div>{% endblock %}
{% block content %}
<table class="hoverable">
<section class="card">
<table class="hoverable">
<tr class="table-header">
<th>Date</th>
<th>#</th>
<th>User</th>
<th>Test</th>
<th>Summary</th>
<th>Logs</th>
</tr>
{% for event in events %}
<tr>
<td class="timestamp">{{event.created|date:'U'}}</td>
<td><a href="/machines/{{event.machine_id}}">{{event.machine_id}}</a></td>
<td>{{event.author|capfirst}}</td>
<td><a href="/test/{{event.test_id}}">{{event.test_name}}</a></td>
<td>{{event.summary}}</td>
<td>{% if event.log_file %}<a href='/event/{{event.id}}'>View</a>{% endif %}</td>
<tr class="table-header">
<th>Date</th>
<th>Machine</th>
<th>User</th>
<th>Test</th>
<th>Type</th>
<th>Log</th>
</tr>
{% endfor %}
</table>
{% for event in events %}
<tr{% if event.log_file %} data-href="/event/{{ event.id }}/"{% endif %}>
<td class="timestamp">{{ event.created|date:'U' }}</td>
<td><a href="/machines/{{ event.machine_id }}">#{{ event.machine_id }}</a></td>
<td>{{ event.author|capfirst }}</td>
<td>
<a href="/test/{{ event.test_id }}">{{ event.test_name }}</a>
{% if event.test_time_control %}<span class="tc-chip">{{ event.test_time_control }}</span>{% endif %}
</td>
<td><span class="badge badge-{{ event.summary|event_tone }}">{{ event.summary }}</span></td>
<td>
{% if event.log_file %}
<a class="ev-open" href="/event/{{ event.id }}/">View <i class="fa-solid fa-arrow-right-long"></i></a>
{% else %}
<span class="muted">&mdash;</span>
{% endif %}
</td>
</tr>
{% empty %}
<tr class="empty-row"><td colspan="6"><i class="fa-regular fa-circle-check"></i>No errors have been reported.</td></tr>
{% endfor %}
</table>
</section>
{% include "OpenBench/Blocks/pagebrowser.html" %}
+233 -6
View File
@@ -1,7 +1,234 @@
<!DOCTYPE html>
{% extends "OpenBench/base.html" %}
<html lang="en">
<body>
<pre>{{content}}</pre>
</body>
</html>
{% load static %}
{% load uitags %}
{% block scripts %}
<script src="{% static 'event_viewer.js' %}?{{ static_version }}" defer></script>
{% endblock %}
{% block page_head %}
<div data-nav="{{ back_url }}">
<a class="crumb" href="{{ back_url }}"><i class="fa-solid fa-arrow-left fa-fw"></i>{{ back_label }}</a>
<h1 class="page-title">Event #{{ event.id }}</h1>
<p class="page-sub">{{ event.summary|default:"No summary" }}</p>
</div>
{% if kind != 'empty' %}
<div class="page-actions">
<button type="button" class="anchorbutton btn-start" id="ev-copy"><i class="fa-regular fa-copy"></i>Copy</button>
<button type="button" class="anchorbutton btn-start" id="ev-download" data-filename="{{ download_name }}"><i class="fa-solid fa-download"></i>Download</button>
</div>
{% endif %}
{% endblock %}
{% block content %}
<dl class="ev-meta">
<div>
<dt>Type</dt>
<dd><span class="badge badge-{{ tone }}">{{ event.summary|default:"Event" }}</span></dd>
</div>
<div>
<dt>When</dt>
<dd class="timestamp">{{ event.created|date:'U' }}</dd>
</div>
<div>
<dt>User</dt>
<dd>{% if event.author %}<a href="/user/{{ event.author }}">{{ event.author|capfirst }}</a>{% else %}&mdash;{% endif %}</dd>
</div>
<div>
<dt>Machine</dt>
<dd>{% if event.machine_id %}<a href="/machines/{{ event.machine_id }}/">#{{ event.machine_id }}</a>{% else %}&mdash;{% endif %}</dd>
</div>
<div>
<dt>Test</dt>
<dd>{% if event.test_id %}<a href="/test/{{ event.test_id }}/">#{{ event.test_id }}</a>{% else %}&mdash;{% endif %}</dd>
</div>
</dl>
{% if kind == 'pgn' %}
<section class="card">
<header class="card-head">
<h2 class="card-title">Game</h2>
<span class="mono muted">{{ game.ply_count }} plies</span>
</header>
<div class="ev-versus">
<div class="ev-player ev-white">
<strong title="{{ game.white }}">{{ game.white }}</strong>
<small><i class="ev-piece"></i>White</small>
</div>
<div class="ev-result mono">{{ game.result }}</div>
<div class="ev-player ev-black">
<strong title="{{ game.black }}">{{ game.black }}</strong>
<small><i class="ev-piece"></i>Black</small>
</div>
</div>
{% if game.termination or game.final_note %}
<div class="ev-callout ev-callout-{{ tone }}">
<i class="fa-solid fa-circle-exclamation fa-fw"></i>
<div class="ev-callout-body">
<strong>{{ game.termination|default:event.summary }}</strong>
{% if game.final_note %}{{ game.final_note }}{% endif %}
</div>
</div>
{% endif %}
<dl class="ev-facts">
{% if game.time_control %}<div><dt>Time control</dt><dd class="mono">{{ game.time_control }}</dd></div>{% endif %}
{% if game.date %}<div><dt>Date</dt><dd class="mono">{{ game.date }}</dd></div>{% endif %}
{% if game.duration %}<div><dt>Duration</dt><dd class="mono">{{ game.duration }}</dd></div>{% endif %}
{% if game.fen %}<div><dt>Start FEN</dt><dd class="mono">{{ game.fen }}</dd></div>{% endif %}
</dl>
{% if game.headers %}
<details class="ev-headers">
<summary>All PGN headers ({{ game.headers|length }})</summary>
<table>
{% for key, value in game.headers %}
<tr><td>{{ key }}</td><td class="mono">{{ value }}</td></tr>
{% endfor %}
</table>
</details>
{% endif %}
</section>
{% if game.rows %}
<div class="ev-grid">
<section class="card">
<header class="card-head">
<h2 class="card-title">Moves</h2>
<span class="count">{{ game.ply_count }}</span>
</header>
<div class="ev-movelist" id="ev-movelist" role="listbox" aria-label="Moves">
{% for row in game.rows %}
<div class="ev-row">
<span class="ev-num">{{ row.num }}.</span>
{% if row.w %}
<button type="button" class="ev-move{% if row.w.final %} is-final{% endif %}" role="option" data-ply="{{ row.w.ply }}">
<span class="ev-san">{{ row.w.san }}</span>{% if row.w.eval %}<em class="ev-eval {{ row.w.tone }}">{{ row.w.eval }}</em>{% endif %}
</button>
{% else %}
<span class="ev-move ev-empty">&hellip;</span>
{% endif %}
{% if row.b %}
<button type="button" class="ev-move{% if row.b.final %} is-final{% endif %}" role="option" data-ply="{{ row.b.ply }}">
<span class="ev-san">{{ row.b.san }}</span>{% if row.b.eval %}<em class="ev-eval {{ row.b.tone }}">{{ row.b.eval }}</em>{% endif %}
</button>
{% else %}
<span class="ev-move ev-empty"></span>
{% endif %}
</div>
{% endfor %}
</div>
</section>
<aside class="ev-side">
<section class="card">
<header class="card-head">
<h2 class="card-title">Selected move</h2>
<span class="mono muted" id="sel-counter">&ndash;</span>
</header>
<div class="ev-sel">
<div class="ev-sel-main">
<span class="ev-sel-label mono" id="sel-label">&ndash;</span>
<span class="ev-sel-san mono" id="sel-san">&ndash;</span>
</div>
<div class="ev-sel-stats">
<div><span>Eval</span><strong class="mono" id="sel-eval">&ndash;</strong></div>
<div><span>Depth</span><strong class="mono" id="sel-depth">&ndash;</strong></div>
<div><span>Time</span><strong class="mono" id="sel-time">&ndash;</strong></div>
</div>
<p class="ev-sel-note" id="sel-note" hidden></p>
<div class="ev-nav">
<button type="button" class="anchorbutton btn-start" id="ev-first" title="First move (Home)" aria-label="First move"><i class="fa-solid fa-backward-step"></i></button>
<button type="button" class="anchorbutton btn-start" id="ev-prev" title="Previous move (Left arrow)" aria-label="Previous move"><i class="fa-solid fa-chevron-left"></i></button>
<button type="button" class="anchorbutton btn-start" id="ev-next" title="Next move (Right arrow)" aria-label="Next move"><i class="fa-solid fa-chevron-right"></i></button>
<button type="button" class="anchorbutton btn-start" id="ev-last" title="Last move (End)" aria-label="Last move"><i class="fa-solid fa-forward-step"></i></button>
</div>
<p class="ev-hint"><kbd>&larr;</kbd> <kbd>&rarr;</kbd> step through the game, <kbd>Home</kbd> <kbd>End</kbd> jump to the ends</p>
</div>
</section>
<section class="card ev-board-card" id="ev-board-slot">
<header class="card-head">
<h2 class="card-title">Board</h2>
<span class="badge badge-muted">Coming soon</span>
</header>
<div class="ev-board" aria-hidden="true">
<div class="ev-board-msg">
<i class="fa-solid fa-chess-board"></i>
<strong>Board analyser</strong>
<span>Follow the game position by position.</span>
</div>
</div>
</section>
</aside>
</div>
{% else %}
<section class="card">
<div class="empty-state">
<i class="fa-solid fa-chess-pawn"></i>
<p>This game has no moves recorded.</p>
</div>
</section>
{% endif %}
{{ moves_json|json_script:"ev-moves" }}
{% elif kind == 'log' %}
<section class="card">
<header class="card-head">
<h2 class="card-title">Log</h2>
<div class="ev-tools">
<span class="badge">{{ log.total }} lines</span>
{% if log.errors %}<span class="badge badge-bad">{{ log.errors }} error{{ log.errors|pluralize }}</span>{% endif %}
{% if log.warnings %}<span class="badge badge-warn">{{ log.warnings }} warning{{ log.warnings|pluralize }}</span>{% endif %}
<input type="search" id="log-filter" class="ev-input" placeholder="Filter lines" aria-label="Filter log lines" autocomplete="off">
<label class="ev-toggle"><input type="checkbox" id="log-issues"> Issues only</label>
<label class="ev-toggle"><input type="checkbox" id="log-wrap"> Wrap lines</label>
</div>
</header>
{% if log.skipped %}
<div class="ev-log-note">Showing the last {{ log.lines|length }} of {{ log.total }} lines. Download has the full log.</div>
{% endif %}
<div class="ev-logbody" id="log-body" role="log" tabindex="0" aria-label="Log output">
{% for line in log.lines %}<div class="ev-line ev-line-{{ line.level }}" data-level="{{ line.level }}"><span class="ev-ln">{{ line.n }}</span><span class="ev-lt">{{ line.text }}</span></div>{% endfor %}
<div class="empty-state" id="log-empty" hidden><p>No lines match.</p></div>
</div>
</section>
{% else %}
<section class="card">
<div class="empty-state">
<i class="fa-regular fa-file-lines"></i>
<p>No log was attached to this event.</p>
</div>
</section>
{% endif %}
{% if kind != 'empty' %}{{ content|json_script:"ev-raw" }}{% endif %}
{% endblock %}
+41 -2
View File
@@ -1,11 +1,50 @@
{% extends "OpenBench/base.html" %}
{% load mytags %}
{% load mytags uitags %}
{% block page_head %}<div><h1 class="page-title">Tests</h1><p class="page-sub">Pending, active and finished workloads</p></div>{% endblock %}
{% block content %}
<!-- Overview cards for the front page of the Index, and of User pages -->
{% if status and paging.page == 1 %}
{% with fleet=status|fleet_stats %}
<div class="stat-grid">
<div class="stat-card">
<span class="stat-icon"><i class="fa-solid fa-bolt"></i></span>
<div>
<div class="stat-value">{{ active|length }}</div>
<div class="stat-label">Running</div>
</div>
</div>
<div class="stat-card stat-yellow">
<span class="stat-icon"><i class="fa-solid fa-hourglass-half"></i></span>
<div>
<div class="stat-value">{{ pending|length }}</div>
<div class="stat-label">Pending approval</div>
</div>
</div>
<div class="stat-card stat-purple">
<span class="stat-icon"><i class="fa-solid fa-hammer"></i></span>
<div>
<div class="stat-value">{{ awaiting|length }}</div>
<div class="stat-label">Awaiting artifacts</div>
</div>
</div>
{% if fleet %}
<div class="stat-card stat-green">
<span class="stat-icon"><i class="fa-solid fa-microchip"></i></span>
<div>
<div class="stat-value">{{ fleet.machines }}</div>
<div class="stat-label">Machines online</div>
<div class="stat-sub">{{ fleet.threads }} threads &middot; {{ fleet.mnps }} MNPS</div>
</div>
</div>
{% endif %}
</div>
{% endwith %}
{% endif %}
<!-- Only show Pending tests for the front page of the Index -->
{% if paging.page == 1 %}
@@ -93,7 +132,7 @@
{% include "OpenBench/Blocks/testsummary.html" %}
</tr>
{% empty %}
<tr class="empty-row"><td colspan="6">No finished tests yet.</td></tr>
<tr class="empty-row"><td colspan="6"><i class="fa-regular fa-folder-open"></i>No finished tests yet.</td></tr>
{% endfor %}
</tbody>
</table>
+110 -19
View File
@@ -2,32 +2,123 @@
{% load mytags %}
{% block page_head %}<div><h1 class="page-title">Users</h1><p class="page-sub">Contributors and approvers</p></div>{% endblock %}
{% block page_head %}
<div>
<h1 class="page-title">Users</h1>
<p class="page-sub">Contributors and approvers, with games split by time control</p>
</div>
<div class="page-actions">
<div class="seg" role="group" aria-label="Rank users by">
<a class="seg-btn{% if sort == 'total' %} active{% endif %}" href="?sort=total">All games</a>
<a class="seg-btn{% if sort == 'stc' %} active{% endif %}" href="?sort=stc">STC</a>
<a class="seg-btn{% if sort == 'ltc' %} active{% endif %}" href="?sort=ltc">LTC</a>
<a class="seg-btn{% if sort == 'tests' %} active{% endif %}" href="?sort=tests">Tests</a>
</div>
</div>
{% endblock %}
{% block content %}
<table class="hoverable">
<div class="stat-grid">
<div class="stat-card stat-green">
<span class="stat-icon"><i class="fa-solid fa-users"></i></span>
<div>
<div class="stat-value">{{ summary.users|insertCommas }}</div>
<div class="stat-label">Contributors</div>
</div>
</div>
<div class="stat-card">
<span class="stat-icon"><i class="fa-solid fa-chess"></i></span>
<div>
<div class="stat-value">{{ summary.total|insertCommas }}</div>
<div class="stat-label">Total games</div>
</div>
</div>
<div class="stat-card">
<span class="stat-icon"><i class="fa-solid fa-bolt"></i></span>
<div>
<div class="stat-value">{{ summary.stc|insertCommas }}</div>
<div class="stat-label">STC games</div>
<div class="stat-sub">{{ summary.stc_share }}% of classified games</div>
</div>
</div>
<div class="stat-card stat-purple">
<span class="stat-icon"><i class="fa-solid fa-hourglass-half"></i></span>
<div>
<div class="stat-value">{{ summary.ltc|insertCommas }}</div>
<div class="stat-label">LTC games</div>
<div class="stat-sub">{{ summary.ltc_share }}% of classified games</div>
</div>
</div>
</div>
<tr class="table-header">
<th>Username</th>
<th>Games</th>
<th>Tests</th>
<th>Engine</th>
<th>Created</th>
</tr>
<section class="card">
<header class="card-head">
<h2 class="card-title">Games by time control</h2>
<div class="legend">
<span><i class="dot dot-stc"></i>STC</span>
<span><i class="dot dot-ltc"></i>LTC</span>
{% if show_other %}<span><i class="dot dot-other"></i>Other</span>{% endif %}
</div>
</header>
<div class="split-overview">
<div class="splitbar splitbar-lg">
<span class="splitbar-stc" style="width: {{ summary.stc_share }}%"></span>
<span class="splitbar-ltc" style="width: {{ summary.ltc_share }}%"></span>
<span class="splitbar-other" style="width: {{ summary.oth_share }}%"></span>
</div>
<p class="muted-small">
STC is a Fischer time control with a base time under {{ stc_limit }} seconds, like 10+0.1.
LTC is {{ stc_limit }} seconds or more, like 60+0.6.
Fixed nodes, depth, movetime, and cyclic controls count as Other.
Games are credited to the user whose machines played them.
</p>
</div>
</section>
{% for profile in profiles %}
{% if profile.games or profile.tests or profile.approver %}
<section class="card">
<table class="hoverable">
<tr class="table-header">
<th>#</th>
<th>Username</th>
<th class="numeric{% if sort == 'total' %} sorted{% endif %}">Games</th>
<th class="numeric{% if sort == 'stc' %} sorted{% endif %}">STC</th>
<th class="numeric{% if sort == 'ltc' %} sorted{% endif %}">LTC</th>
{% if show_other %}<th class="numeric">Other</th>{% endif %}
<th>Split</th>
<th class="numeric{% if sort == 'tests' %} sorted{% endif %}">Tests</th>
<th>Engine</th>
<th>Created</th>
</tr>
{% for row in rows %}
<tr>
<td><a href="/user/{{profile.user.username}}">{{profile.user.username|capfirst}}</a></td>
<td style="text-align: right">{{profile.games|insertCommas}}</td>
<td style="text-align: right">{{profile.tests|insertCommas}}</td>
<td>{{profile.engine}}</td>
<td class="timestamp">{{profile.user.date_joined|date:'U'}}</td>
<td class="rank">{{ forloop.counter }}</td>
<td>
<a href="/user/{{ row.username }}">{{ row.username|capfirst }}</a>
{% if row.approver %}<span class="badge badge-info">approver</span>{% endif %}
</td>
<td class="numeric">{{ row.total|insertCommas }}</td>
<td class="numeric num-stc">{{ row.stc|insertCommas }}</td>
<td class="numeric num-ltc">{{ row.ltc|insertCommas }}</td>
{% if show_other %}<td class="numeric">{{ row.other|insertCommas }}</td>{% endif %}
<td>
<div class="splitbar" title="STC {{ row.stc_share }}% / LTC {{ row.ltc_share }}%{% if show_other %} / Other {{ row.oth_share }}%{% endif %}">
<span class="splitbar-stc" style="width: {{ row.stc_share }}%"></span>
<span class="splitbar-ltc" style="width: {{ row.ltc_share }}%"></span>
<span class="splitbar-other" style="width: {{ row.oth_share }}%"></span>
</div>
</td>
<td class="numeric">{{ row.tests|insertCommas }}</td>
<td>{{ row.engine }}</td>
<td class="timestamp">{{ row.joined|date:'U' }}</td>
</tr>
{% endif %}
{% endfor %}
{% empty %}
<tr class="empty-row"><td colspan="10"><i class="fa-regular fa-user"></i>No users yet.</td></tr>
{% endfor %}
</table>
</table>
</section>
{% endblock %}