Modern redesign #9
No files matched your search
+283
-72
@@ -1,106 +1,172 @@
|
||||
/* ==========================================================================
|
||||
OpenBench - forms (modern dark theme)
|
||||
========================================================================== */
|
||||
|
||||
/* A .form is a grid of cards: .col (half width), .col-full (full width) */
|
||||
|
||||
#content .form {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 20px;
|
||||
align-items: start;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
#content .form > .col,
|
||||
#content .form > .col-full {
|
||||
min-width: 0;
|
||||
padding: 4px 20px 20px;
|
||||
background-color: var(--color2);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: var(--radius);
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
#content .form > .col-full {
|
||||
grid-column: 1 / -1;
|
||||
}
|
||||
|
||||
#content .form > .col:only-child {
|
||||
grid-column: 1 / -1;
|
||||
max-width: 640px;
|
||||
}
|
||||
|
||||
#content .form .col-half {
|
||||
display: inline-block;
|
||||
width: 25%;
|
||||
white-space: normal;
|
||||
box-sizing: border-box;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
#content .form .col {
|
||||
display: inline-block;
|
||||
width: 50%;
|
||||
white-space: normal;
|
||||
margin-left: 0;
|
||||
box-sizing: border-box;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
#content .form .col-full {
|
||||
display: block;
|
||||
width: 100%;
|
||||
width: auto;
|
||||
white-space: normal;
|
||||
margin-left: 0;
|
||||
box-sizing: border-box;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
/* Styles for screen widths less than 600px */
|
||||
|
||||
@media (max-width: 1024px) {
|
||||
#content .form .col {
|
||||
display: block;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
#content .form h3 {
|
||||
font-size: 14px;
|
||||
color: var(--color-font3);
|
||||
margin: 20px 0 14px;
|
||||
padding: 0 0 8px;
|
||||
border-bottom: 1px solid var(--line);
|
||||
color: var(--muted);
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.1em;
|
||||
text-align: left;
|
||||
padding-left: 1.5rem;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
/* Rows: label on the left, control fills the rest */
|
||||
|
||||
#content .form .row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 0.25rem;
|
||||
gap: 12px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
#content .row label {
|
||||
font-size: 13px;
|
||||
width: 25%;
|
||||
min-width: 128px;
|
||||
margin-right: 1rem;
|
||||
text-align: right;
|
||||
color: var(--color-font2)
|
||||
}
|
||||
|
||||
|
||||
#content .row input, #content .row select, #content .row textarea {
|
||||
flex-grow: 1;
|
||||
flex: 0 0 150px;
|
||||
width: auto;
|
||||
min-width: 0;
|
||||
border: 1px solid var(--color3);
|
||||
border-radius: 4px;
|
||||
padding: 9px 6px 6px;
|
||||
background-color: var(--color2);
|
||||
margin: 0;
|
||||
color: var(--color-font2);
|
||||
font-family: "Courier Prime", serif;
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#content .row input[type="file"]{
|
||||
padding: 2px 2px;
|
||||
#content .row label select {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#content .row input:focus, #content .row select:focus, #content .row textarea:focus {
|
||||
#content .row input,
|
||||
#content .row select,
|
||||
#content .row textarea {
|
||||
flex: 1 1 auto;
|
||||
min-width: 0;
|
||||
padding: 8px 10px;
|
||||
background-color: #0C1016;
|
||||
border: 1px solid var(--line-strong);
|
||||
border-radius: var(--radius);
|
||||
color: var(--color-font1);
|
||||
font-family: var(--font-sans);
|
||||
font-size: 13.5px;
|
||||
transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
|
||||
}
|
||||
|
||||
#content .row textarea {
|
||||
font-family: var(--font-mono);
|
||||
font-size: 12.5px;
|
||||
line-height: 1.5;
|
||||
resize: vertical;
|
||||
}
|
||||
|
||||
#content .row input::placeholder,
|
||||
#content .row textarea::placeholder {
|
||||
color: #566074;
|
||||
}
|
||||
|
||||
#content .row input:hover,
|
||||
#content .row select:hover,
|
||||
#content .row textarea:hover {
|
||||
border-color: #3A4862;
|
||||
}
|
||||
|
||||
#content .row input:focus,
|
||||
#content .row select:focus,
|
||||
#content .row textarea:focus {
|
||||
outline: none;
|
||||
border-color: var(--color3);
|
||||
box-shadow: 0 0 0 2px rgba(77, 144, 254, 0.75);
|
||||
background-color: var(--color2);
|
||||
color: var(--color-font2);
|
||||
border-color: var(--accent);
|
||||
box-shadow: 0 0 0 3px rgba(76, 141, 255, 0.22);
|
||||
background-color: #0E131B;
|
||||
}
|
||||
|
||||
#content .row select > option{
|
||||
font-family: "Helvetica", serif;
|
||||
#content .row input[type="file"] {
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
#content .row input[type="file"]::file-selector-button {
|
||||
background-color: var(--color3);
|
||||
border: 1px solid var(--color2);
|
||||
border-radius: 4px;
|
||||
padding: 6px 6px 3px;
|
||||
color: var(--color-font2);
|
||||
#content .row input[type="checkbox"],
|
||||
#content .row input[type="radio"] {
|
||||
flex: 0 0 auto;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
padding: 0;
|
||||
accent-color: var(--accent);
|
||||
cursor: pointer;
|
||||
transition: background-color 0.3s, border-color 0.3s;
|
||||
font-family: "Courier Prime", serif;
|
||||
}
|
||||
|
||||
#content .row input[type="file"]::file-selector-button:hover {
|
||||
background-color: rgba(77, 144, 254, 0.8);
|
||||
border-color: var(--color2);
|
||||
#content .row select > option {
|
||||
font-family: var(--font-sans);
|
||||
background-color: #0C1016;
|
||||
color: var(--color-font1);
|
||||
}
|
||||
|
||||
#content .row input[readonly] {
|
||||
background-color: var(--color2);
|
||||
color: var(--color-font1);
|
||||
font-family: var(--font-mono);
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
#content .row input[type="file"]::file-selector-button {
|
||||
margin-right: 10px;
|
||||
padding: 6px 12px;
|
||||
background-color: var(--color3);
|
||||
border: 1px solid var(--line-strong);
|
||||
border-radius: var(--radius);
|
||||
color: var(--color-font1);
|
||||
font-family: var(--font-sans);
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
cursor: pointer;
|
||||
transition: background-color 0.15s, border-color 0.15s;
|
||||
}
|
||||
|
||||
#content .row input[type="file"]::file-selector-button:hover {
|
||||
background-color: var(--accent);
|
||||
border-color: var(--accent);
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
/* Buttons that sit directly in a form card */
|
||||
|
||||
#content .form .col > .anchorbutton,
|
||||
#content .form .col-full > .anchorbutton {
|
||||
margin-top: 14px;
|
||||
}
|
||||
|
||||
#content .form .flex {
|
||||
@@ -108,17 +174,162 @@
|
||||
flex-wrap: wrap;
|
||||
max-width: 100%;
|
||||
justify-content: flex-start;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
#content .form .flex button{
|
||||
#content .form .flex button {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
/* Sticky submit bar (create workload) */
|
||||
|
||||
#content .form-actions {
|
||||
position: sticky;
|
||||
bottom: 0;
|
||||
z-index: 5;
|
||||
padding: 16px 0 4px;
|
||||
background: linear-gradient(to top, var(--color1) 65%, rgba(11, 14, 20, 0));
|
||||
}
|
||||
|
||||
#content .form-actions .anchorbutton {
|
||||
min-width: 260px;
|
||||
padding: 12px 22px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
/* Presets generated by create_workload.js */
|
||||
|
||||
#content #test-mode-buttons {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
#content #test-mode-buttons .col-half {
|
||||
width: auto;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#content #test-mode-buttons .anchorbutton {
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* Search filters */
|
||||
|
||||
#content .chips {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
#content .chip {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
padding: 7px 12px;
|
||||
background-color: #0C1016;
|
||||
border: 1px solid var(--line-strong);
|
||||
border-radius: var(--radius);
|
||||
color: var(--color-font2);
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
transition: border-color 0.15s ease, background-color 0.15s ease;
|
||||
}
|
||||
|
||||
#content .chip:hover {
|
||||
border-color: #3A4862;
|
||||
background-color: var(--surface-hover);
|
||||
}
|
||||
|
||||
#content .chip input {
|
||||
margin: 0;
|
||||
accent-color: var(--accent);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#content .chip::before {
|
||||
content: "";
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
background-color: var(--muted);
|
||||
}
|
||||
|
||||
#content .chip-green::before { background-color: #34D399; }
|
||||
#content .chip-blue::before { background-color: #4C8DFF; }
|
||||
#content .chip-yellow::before { background-color: #F5B941; }
|
||||
#content .chip-red::before { background-color: #F87171; }
|
||||
|
||||
/* Sign in / sign up */
|
||||
|
||||
#content .auth-wrap {
|
||||
max-width: 440px;
|
||||
margin: 24px auto 0;
|
||||
}
|
||||
|
||||
#content .auth-wrap .form > .col:only-child {
|
||||
max-width: none;
|
||||
}
|
||||
|
||||
#content .auth-wrap .row {
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
gap: 6px;
|
||||
margin-bottom: 14px;
|
||||
}
|
||||
|
||||
#content .auth-wrap .row label {
|
||||
flex-basis: auto;
|
||||
}
|
||||
|
||||
/* Profile engine list */
|
||||
|
||||
#content #engines-container span {
|
||||
margin: 0px 4px 0px 4px;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
margin: 0 4px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#content #engines-container span input {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#content #engines-container .fa-trash-can {
|
||||
color: #C25555;
|
||||
}
|
||||
|
||||
#content #engines-container span:hover .fa-trash-can {
|
||||
color: var(--bad);
|
||||
}
|
||||
|
||||
@media (max-width: 1024px) {
|
||||
#content .form {
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 640px) {
|
||||
|
||||
#content .form .row {
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
#content .row label {
|
||||
flex-basis: auto;
|
||||
}
|
||||
|
||||
#content .form > .col,
|
||||
#content .form > .col-full {
|
||||
padding: 4px 14px 16px;
|
||||
}
|
||||
|
||||
#content .form-actions .anchorbutton {
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,433 @@
|
||||
/* ==========================================================================
|
||||
OpenBench - LLR history graph
|
||||
|
||||
The server (mytags.llr_history_graph) supplies the data as a
|
||||
<div class="llr-chart" data-chart="{json}">, and the graph is drawn here
|
||||
so that it fills the width of its panel.
|
||||
|
||||
Hovering snaps the marker to the nearest point of the graph, and to the
|
||||
peaks / valleys of the line when the pointer is near one.
|
||||
========================================================================== */
|
||||
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
var SVG_NS = 'http://www.w3.org/2000/svg';
|
||||
var MINUS = '\u2212';
|
||||
var HEIGHT = 124;
|
||||
var MARGIN = { l: 40, r: 8, t: 8, b: 20 };
|
||||
var MAGNET = 12; // px: how far a peak / valley pulls the marker
|
||||
var SWING = 3; // px: smallest rise / fall that counts as a peak / valley
|
||||
var uid = 0;
|
||||
|
||||
/* ---------- helpers ---------- */
|
||||
|
||||
function svg(name, attrs, parent) {
|
||||
var node = document.createElementNS(SVG_NS, name);
|
||||
for (var key in attrs)
|
||||
if (Object.prototype.hasOwnProperty.call(attrs, key))
|
||||
node.setAttribute(key, attrs[key]);
|
||||
if (parent)
|
||||
parent.appendChild(node);
|
||||
return node;
|
||||
}
|
||||
|
||||
function div(className, parent) {
|
||||
var node = document.createElement('div');
|
||||
node.className = className;
|
||||
if (parent)
|
||||
parent.appendChild(node);
|
||||
return node;
|
||||
}
|
||||
|
||||
function fmt(value) {
|
||||
return value.toFixed(2).replace('-', MINUS);
|
||||
}
|
||||
|
||||
function commas(value) {
|
||||
return String(Math.round(value)).replace(/\B(?=(\d{3})+(?!\d))/g, ',');
|
||||
}
|
||||
|
||||
function compact(value) {
|
||||
if (value >= 1e6) return parseFloat((value / 1e6).toFixed(1)) + 'M';
|
||||
if (value >= 1e3) return parseFloat((value / 1e3).toFixed(1)) + 'k';
|
||||
return String(Math.round(value));
|
||||
}
|
||||
|
||||
function clamp(value, min, max) {
|
||||
return Math.max(min, Math.min(max, value));
|
||||
}
|
||||
|
||||
// Index of the first point with games >= target
|
||||
function lowerBound(points, target) {
|
||||
|
||||
var lo = 0, hi = points.length;
|
||||
while (lo < hi) {
|
||||
var mid = (lo + hi) >> 1;
|
||||
if (points[mid].games < target) lo = mid + 1;
|
||||
else hi = mid;
|
||||
}
|
||||
return lo;
|
||||
}
|
||||
|
||||
// Keep the first / min / max / last point of every pixel column
|
||||
function decimate(points, sx) {
|
||||
|
||||
var out = [], i = 0, n = points.length;
|
||||
|
||||
while (i < n) {
|
||||
|
||||
var key = Math.round(sx(points[i].games));
|
||||
var j = i, lo = i, hi = i;
|
||||
|
||||
while (j + 1 < n && Math.round(sx(points[j + 1].games)) === key) {
|
||||
j++;
|
||||
if (points[j].llr < points[lo].llr) lo = j;
|
||||
if (points[j].llr > points[hi].llr) hi = j;
|
||||
}
|
||||
|
||||
[i, lo, hi, j].filter(function (value, index, all) {
|
||||
return all.indexOf(value) === index;
|
||||
}).sort(function (a, b) { return a - b; }).forEach(function (k) {
|
||||
out.push(points[k]);
|
||||
});
|
||||
|
||||
i = j + 1;
|
||||
}
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
/* Peaks and valleys: every turning point of the line where it rises or
|
||||
falls by at least `threshold` before turning around. Flat stretches and
|
||||
tiny wiggles (smaller than a few pixels) are ignored, so what snaps is
|
||||
exactly what is visible on the graph. */
|
||||
function findPivots(points, threshold) {
|
||||
|
||||
var pivots = [];
|
||||
var trend = 0, hi = 0, lo = 0;
|
||||
|
||||
for (var i = 1; i < points.length; i++) {
|
||||
|
||||
var value = points[i].llr;
|
||||
|
||||
if (value >= points[hi].llr) hi = i;
|
||||
if (value <= points[lo].llr) lo = i;
|
||||
|
||||
if (trend >= 0 && points[hi].llr - value >= threshold) {
|
||||
pivots.push(hi);
|
||||
trend = -1; hi = i; lo = i;
|
||||
}
|
||||
else if (trend <= 0 && value - points[lo].llr >= threshold) {
|
||||
pivots.push(lo);
|
||||
trend = 1; hi = i; lo = i;
|
||||
}
|
||||
}
|
||||
|
||||
return pivots;
|
||||
}
|
||||
|
||||
/* ======================================================================
|
||||
Graph
|
||||
====================================================================== */
|
||||
|
||||
function Graph(root, data) {
|
||||
|
||||
this.root = root;
|
||||
this.lower = Number(data.lower);
|
||||
this.upper = Number(data.upper);
|
||||
this.games = Number(data.games);
|
||||
this.active = -1;
|
||||
this.rendered = 0;
|
||||
|
||||
this.points = data.history.map(function (p) {
|
||||
return { games: Number(p[0]), llr: Number(p[1]), estimated: !!p[2] };
|
||||
}).sort(function (a, b) { return a.games - b.games; });
|
||||
|
||||
root.textContent = '';
|
||||
|
||||
this.plot = div('llrg-plot', root);
|
||||
this.plot.tabIndex = 0;
|
||||
this.plot.setAttribute('role', 'img');
|
||||
this.plot.setAttribute('aria-label', 'LLR history. Use the arrow keys to inspect the points.');
|
||||
|
||||
this.svgEl = svg('svg', { 'class': 'llrg-svg', 'aria-hidden': 'true' }, this.plot);
|
||||
this.tip = div('llrg-tip', this.plot);
|
||||
|
||||
this.render();
|
||||
this.bind();
|
||||
}
|
||||
|
||||
Graph.prototype.render = function () {
|
||||
|
||||
var W = Math.floor(this.plot.clientWidth);
|
||||
if (W < 120)
|
||||
return;
|
||||
|
||||
this.rendered = W;
|
||||
|
||||
var H = HEIGHT, m = MARGIN;
|
||||
var iw = W - m.l - m.r;
|
||||
var ih = H - m.t - m.b;
|
||||
var points = this.points;
|
||||
var xMax = Math.max(points[points.length - 1].games, this.games, 1);
|
||||
|
||||
/* Vertical range: what was observed, and zero, with a minimum height */
|
||||
|
||||
var lo = 0, hi = 0;
|
||||
points.forEach(function (p) {
|
||||
if (p.llr < lo) lo = p.llr;
|
||||
if (p.llr > hi) hi = p.llr;
|
||||
});
|
||||
|
||||
var yMin, yMax;
|
||||
if (hi - lo < 0.75) {
|
||||
var center = (lo + hi) / 2;
|
||||
yMin = center - 0.375;
|
||||
yMax = center + 0.375;
|
||||
} else {
|
||||
var pad = Math.max((hi - lo) * 0.15, 0.15);
|
||||
yMin = lo - pad;
|
||||
yMax = hi + pad;
|
||||
}
|
||||
|
||||
function sx(games) { return m.l + iw * (games / xMax); }
|
||||
function sy(value) { return m.t + ih * (1 - (value - yMin) / (yMax - yMin)); }
|
||||
|
||||
this.g = { W: W, H: H, m: m, iw: iw, ih: ih, xMax: xMax, sx: sx, sy: sy };
|
||||
|
||||
/* Peaks and valleys, plus both ends, are what the marker snaps to */
|
||||
|
||||
var pivots = findPivots(points, SWING * (yMax - yMin) / ih);
|
||||
pivots.push(0, points.length - 1);
|
||||
this.pivots = pivots.filter(function (value, index, all) {
|
||||
return all.indexOf(value) === index;
|
||||
}).sort(function (a, b) { return a - b; });
|
||||
|
||||
/* Drawing */
|
||||
|
||||
var el = this.svgEl;
|
||||
var id = 'llrg' + (++uid);
|
||||
var zeroY = sy(0);
|
||||
|
||||
el.textContent = '';
|
||||
el.setAttribute('viewBox', '0 0 ' + W + ' ' + H);
|
||||
el.setAttribute('width', W);
|
||||
el.setAttribute('height', H);
|
||||
|
||||
var defs = svg('defs', {}, el);
|
||||
var above = svg('clipPath', { id: id + '-a' }, defs);
|
||||
svg('rect', { x: m.l, y: m.t, width: iw, height: Math.max(zeroY - m.t, 0) }, above);
|
||||
var below = svg('clipPath', { id: id + '-b' }, defs);
|
||||
svg('rect', { x: m.l, y: zeroY, width: iw, height: Math.max(m.t + ih - zeroY, 0) }, below);
|
||||
|
||||
svg('rect', { 'class': 'llrg-bg', x: m.l, y: m.t, width: iw, height: ih }, el);
|
||||
|
||||
// Horizontal grid + labels: top, middle, bottom
|
||||
[yMax, (yMin + yMax) / 2, yMin].forEach(function (value) {
|
||||
var y = sy(value);
|
||||
svg('line', { 'class': 'llrg-grid', x1: m.l, x2: m.l + iw, y1: y, y2: y }, el);
|
||||
var label = svg('text', { 'class': 'llrg-tick', x: m.l - 6, y: y, dy: '0.32em', 'text-anchor': 'end' }, el);
|
||||
label.textContent = fmt(value);
|
||||
});
|
||||
|
||||
// Vertical grid
|
||||
[0.25, 0.5, 0.75].forEach(function (fraction) {
|
||||
var x = m.l + iw * fraction;
|
||||
svg('line', { 'class': 'llrg-grid', x1: x, x2: x, y1: m.t, y2: m.t + ih }, el);
|
||||
});
|
||||
|
||||
// Games axis
|
||||
[[0, 'start', m.l], [xMax / 2, 'middle', m.l + iw / 2], [xMax, 'end', m.l + iw]].forEach(function (tick) {
|
||||
var label = svg('text', { 'class': 'llrg-tick', x: tick[2], y: H - 5, 'text-anchor': tick[1] }, el);
|
||||
label.textContent = tick[0] === 0 ? '0' : compact(tick[0]);
|
||||
});
|
||||
|
||||
// Bounds and zero, when they are in range
|
||||
var lower = this.lower, upper = this.upper;
|
||||
[[lower, 'llrg-bound'], [0, 'llrg-zero'], [upper, 'llrg-bound']].forEach(function (guide) {
|
||||
if (guide[0] >= yMin && guide[0] <= yMax) {
|
||||
var y = sy(guide[0]);
|
||||
svg('line', { 'class': guide[1], x1: m.l, x2: m.l + iw, y1: y, y2: y }, el);
|
||||
}
|
||||
});
|
||||
|
||||
// The line: green above zero, red below
|
||||
var drawn = points.length > iw * 1.5 ? decimate(points, sx) : points;
|
||||
var d = drawn.map(function (p, i) {
|
||||
return (i ? 'L' : 'M') + sx(p.games).toFixed(1) + ' ' + sy(p.llr).toFixed(1);
|
||||
}).join('');
|
||||
|
||||
svg('path', { 'class': 'llrg-line llrg-line-pos', d: d, 'clip-path': 'url(#' + id + '-a)' }, el);
|
||||
svg('path', { 'class': 'llrg-line llrg-line-neg', d: d, 'clip-path': 'url(#' + id + '-b)' }, el);
|
||||
|
||||
// Marker
|
||||
this.hoverLine = svg('line', { 'class': 'llrg-hover-line', y1: m.t, y2: m.t + ih }, el);
|
||||
this.hoverDot = svg('circle', { 'class': 'llrg-hover-dot', r: 3.5 }, el);
|
||||
|
||||
if (this.active >= 0)
|
||||
this.setActive(this.active);
|
||||
};
|
||||
|
||||
/* ---------- snapping ---------- */
|
||||
|
||||
Graph.prototype.pick = function (x) {
|
||||
|
||||
var g = this.g, points = this.points;
|
||||
var target = clamp((x - g.m.l) / g.iw, 0, 1) * g.xMax;
|
||||
|
||||
// Nearest point
|
||||
var after = Math.min(lowerBound(points, target), points.length - 1);
|
||||
var before = Math.max(after - 1, 0);
|
||||
var best = Math.abs(g.sx(points[before].games) - x) <= Math.abs(g.sx(points[after].games) - x) ? before : after;
|
||||
|
||||
// Nearest peak / valley, if the pointer is close enough to one
|
||||
var magnet = -1, magnetDistance = MAGNET + 1;
|
||||
for (var i = 0; i < this.pivots.length; i++) {
|
||||
var distance = Math.abs(g.sx(points[this.pivots[i]].games) - x);
|
||||
if (distance < magnetDistance) {
|
||||
magnet = this.pivots[i];
|
||||
magnetDistance = distance;
|
||||
}
|
||||
}
|
||||
|
||||
return magnet >= 0 ? magnet : best;
|
||||
};
|
||||
|
||||
Graph.prototype.setActive = function (index) {
|
||||
|
||||
if (index < 0 || !this.g) {
|
||||
this.active = -1;
|
||||
this.hoverLine.classList.remove('active');
|
||||
this.hoverDot.classList.remove('active', 'llrg-pos', 'llrg-neg');
|
||||
this.tip.classList.remove('active');
|
||||
return;
|
||||
}
|
||||
|
||||
var g = this.g, p = this.points[index];
|
||||
var x = g.sx(p.games), y = g.sy(p.llr);
|
||||
|
||||
this.active = index;
|
||||
|
||||
this.hoverLine.setAttribute('x1', x);
|
||||
this.hoverLine.setAttribute('x2', x);
|
||||
this.hoverDot.setAttribute('cx', x);
|
||||
this.hoverDot.setAttribute('cy', y);
|
||||
this.hoverDot.setAttribute('class', 'llrg-hover-dot active ' + (p.llr >= 0 ? 'llrg-pos' : 'llrg-neg'));
|
||||
this.hoverLine.classList.add('active');
|
||||
|
||||
this.tip.textContent = commas(p.games) + ' games | LLR ' + (p.estimated ? '\u2248' : '') + fmt(p.llr);
|
||||
this.tip.classList.add('active');
|
||||
|
||||
var left = clamp(x + 8, 0, g.W - this.tip.offsetWidth);
|
||||
var top = clamp(y - this.tip.offsetHeight - 8, 0, g.H - this.tip.offsetHeight);
|
||||
|
||||
this.tip.style.left = left + 'px';
|
||||
this.tip.style.top = top + 'px';
|
||||
};
|
||||
|
||||
/* ---------- events ---------- */
|
||||
|
||||
Graph.prototype.bind = function () {
|
||||
|
||||
var self = this, plot = this.plot;
|
||||
|
||||
function move(event) {
|
||||
if (!self.g)
|
||||
return;
|
||||
var box = self.svgEl.getBoundingClientRect();
|
||||
var x = (event.clientX - box.left) * (self.g.W / (box.width || self.g.W));
|
||||
self.setActive(self.pick(x));
|
||||
}
|
||||
|
||||
plot.addEventListener('pointerenter', move);
|
||||
plot.addEventListener('pointermove', move);
|
||||
plot.addEventListener('pointerdown', move);
|
||||
plot.addEventListener('pointerleave', function (event) {
|
||||
if (event.pointerType === 'mouse')
|
||||
self.setActive(-1);
|
||||
});
|
||||
|
||||
plot.addEventListener('keydown', function (event) {
|
||||
|
||||
var last = self.points.length - 1;
|
||||
var step = event.shiftKey ? 10 : 1;
|
||||
var index = self.active;
|
||||
|
||||
if (event.key === 'ArrowLeft') index = index < 0 ? last : index - step;
|
||||
else if (event.key === 'ArrowRight') index = index < 0 ? last : index + step;
|
||||
else if (event.key === 'Home') index = 0;
|
||||
else if (event.key === 'End') index = last;
|
||||
else if (event.key === 'Escape') { self.setActive(-1); return; }
|
||||
else return;
|
||||
|
||||
event.preventDefault();
|
||||
self.setActive(clamp(index, 0, last));
|
||||
});
|
||||
|
||||
plot.addEventListener('blur', function () { self.setActive(-1); });
|
||||
|
||||
function redraw() {
|
||||
if (Math.floor(plot.clientWidth) !== self.rendered)
|
||||
self.render();
|
||||
}
|
||||
|
||||
if ('ResizeObserver' in window) {
|
||||
var queued = false;
|
||||
new ResizeObserver(function () {
|
||||
if (queued) return;
|
||||
queued = true;
|
||||
window.requestAnimationFrame(function () { queued = false; redraw(); });
|
||||
}).observe(plot);
|
||||
} else {
|
||||
window.addEventListener('resize', redraw);
|
||||
}
|
||||
};
|
||||
|
||||
/* ======================================================================
|
||||
Loading
|
||||
====================================================================== */
|
||||
|
||||
function showError(container, text) {
|
||||
container.removeAttribute('aria-busy');
|
||||
container.innerHTML = '<div class="llr-history-placeholder llr-history-placeholder-error">' + text + '</div>';
|
||||
}
|
||||
|
||||
function load(container) {
|
||||
|
||||
var url = container.getAttribute('data-history-url');
|
||||
if (!url)
|
||||
return;
|
||||
|
||||
container.setAttribute('aria-busy', 'true');
|
||||
|
||||
fetch(url, { credentials: 'same-origin' }).then(function (response) {
|
||||
|
||||
if (!response.ok)
|
||||
throw new Error('Unable to load history graph');
|
||||
|
||||
return response.text();
|
||||
|
||||
}).then(function (markup) {
|
||||
|
||||
container.innerHTML = markup;
|
||||
container.removeAttribute('aria-busy');
|
||||
|
||||
var node = container.querySelector('.llr-chart');
|
||||
if (!node)
|
||||
return showError(container, 'No history to show yet.');
|
||||
|
||||
new Graph(node, JSON.parse(node.getAttribute('data-chart')));
|
||||
|
||||
}).catch(function () {
|
||||
showError(container, 'Unable to load history graph.');
|
||||
});
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
var container = document.getElementById('llr-history-container');
|
||||
if (container)
|
||||
load(container);
|
||||
});
|
||||
|
||||
})();
|
||||
+35
-17
@@ -1,10 +1,14 @@
|
||||
/* ==========================================================================
|
||||
OpenBench - pagination (modern dark theme)
|
||||
========================================================================== */
|
||||
|
||||
.pagination {
|
||||
display: inline-flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
#pagebrowse {
|
||||
#pagebrowser {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
@@ -15,42 +19,56 @@
|
||||
|
||||
.page, .ellipsis {
|
||||
display: inline-block;
|
||||
padding: 6px 1rem;
|
||||
margin: 0;
|
||||
border-left: 1px solid var(--color1);
|
||||
border-right: 1px solid var(--color1);
|
||||
background-color: var(--color2); /* Dark background color */
|
||||
box-sizing: border-box;
|
||||
padding: 0 0.85rem;
|
||||
margin: 0 0 0 -1px;
|
||||
border: 1px solid var(--line-strong);
|
||||
background-color: var(--color2);
|
||||
color: var(--color-font2);
|
||||
font-size: 13px;
|
||||
font-variant-numeric: tabular-nums;
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
transition: background-color 0.2s; /* Add a smooth transition effect to background color */
|
||||
height: 24px; /* This is just an example, adjust according to your needs */
|
||||
line-height: 24px; /* Should be same as height */
|
||||
min-width: 1.6rem;
|
||||
transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
|
||||
height: 30px;
|
||||
line-height: 28px;
|
||||
min-width: 2rem;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.page:hover {
|
||||
background-color: var(--color3); /* Darker background color on hover */
|
||||
background-color: var(--surface-hover);
|
||||
border-color: #3A4862;
|
||||
color: var(--color-font1);
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.previous {
|
||||
border-top-left-radius: 7px;
|
||||
border-bottom-left-radius: 7px;
|
||||
border-top-left-radius: 2px;
|
||||
border-bottom-left-radius: 2px;
|
||||
}
|
||||
|
||||
.current {
|
||||
background-color: var(--color3);
|
||||
background-color: var(--accent);
|
||||
border-color: var(--accent);
|
||||
color: #FFFFFF;
|
||||
font-weight: 600;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.current:hover {
|
||||
background-color: var(--accent);
|
||||
border-color: var(--accent);
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.next {
|
||||
border-top-right-radius: 7px;
|
||||
border-bottom-right-radius: 7px;
|
||||
border-top-right-radius: 2px;
|
||||
border-bottom-right-radius: 2px;
|
||||
}
|
||||
|
||||
.ellipsis, .fa-solid {
|
||||
/*margin: 0 4px;*/
|
||||
pointer-events: none; /* Disable click events on ellipsis */
|
||||
vertical-align: middle; /* Ensure icons are vertically centered */
|
||||
}
|
||||
+1006
-354
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,136 @@
|
||||
/* ==========================================================================
|
||||
OpenBench - small UI helpers (progressive enhancement only).
|
||||
Nothing here changes what the site does: it highlights the current page in
|
||||
the navigation, closes the mobile menu, shows a toast after copying text and
|
||||
lets message banners be dismissed.
|
||||
========================================================================== */
|
||||
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
function ready(fn) {
|
||||
if (document.readyState !== 'loading')
|
||||
fn();
|
||||
else
|
||||
document.addEventListener('DOMContentLoaded', fn);
|
||||
}
|
||||
|
||||
function normalise(path) {
|
||||
path = path.replace(/\/+$/, '');
|
||||
return path === '' ? '/' : path;
|
||||
}
|
||||
|
||||
/* ---------- Navigation: mark the link for the current page ---------- */
|
||||
|
||||
function highlightNavigation() {
|
||||
|
||||
var here = normalise(window.location.pathname);
|
||||
|
||||
// The front page is served from both / and /index
|
||||
if (here === '/')
|
||||
here = '/index';
|
||||
|
||||
var best = null;
|
||||
var bestLength = -1;
|
||||
|
||||
document.querySelectorAll('#sidebar a[href^="/"]').forEach(function (link) {
|
||||
|
||||
var target = normalise(new URL(link.getAttribute('href'), window.location.origin).pathname);
|
||||
var matches = here === target || here.indexOf(target + '/') === 0;
|
||||
|
||||
if (matches && target.length > bestLength) {
|
||||
best = link;
|
||||
bestLength = target.length;
|
||||
}
|
||||
});
|
||||
|
||||
if (best) {
|
||||
best.classList.add('active');
|
||||
best.setAttribute('aria-current', 'page');
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------- Mobile navigation ---------- */
|
||||
|
||||
function setSidebar(open) {
|
||||
document.body.classList.toggle('sidebar-open', open);
|
||||
var toggle = document.getElementById('sidebar-toggle');
|
||||
if (toggle)
|
||||
toggle.setAttribute('aria-expanded', String(open));
|
||||
}
|
||||
|
||||
function initSidebar() {
|
||||
|
||||
var backdrop = document.getElementById('sidebar-backdrop');
|
||||
if (backdrop)
|
||||
backdrop.addEventListener('click', function () { setSidebar(false); });
|
||||
|
||||
document.addEventListener('keydown', function (event) {
|
||||
if (event.key === 'Escape')
|
||||
setSidebar(false);
|
||||
});
|
||||
|
||||
document.querySelectorAll('#sidebar a').forEach(function (link) {
|
||||
link.addEventListener('click', function () { setSidebar(false); });
|
||||
});
|
||||
}
|
||||
|
||||
/* ---------- Toast ---------- */
|
||||
|
||||
var toastTimer = null;
|
||||
|
||||
function toast(message) {
|
||||
|
||||
var element = document.getElementById('toast');
|
||||
if (!element)
|
||||
return;
|
||||
|
||||
element.textContent = message;
|
||||
element.classList.add('show');
|
||||
|
||||
window.clearTimeout(toastTimer);
|
||||
toastTimer = window.setTimeout(function () {
|
||||
element.classList.remove('show');
|
||||
}, 1800);
|
||||
}
|
||||
|
||||
// Give copy_text() (see copy_text.js) some visible feedback
|
||||
function wrapCopyText() {
|
||||
|
||||
if (typeof window.copy_text !== 'function' || window.copy_text.wrapped)
|
||||
return;
|
||||
|
||||
var original = window.copy_text;
|
||||
|
||||
window.copy_text = function () {
|
||||
var result = original.apply(this, arguments);
|
||||
toast('Copied to clipboard');
|
||||
return result;
|
||||
};
|
||||
|
||||
window.copy_text.wrapped = true;
|
||||
}
|
||||
|
||||
/* ---------- Dismissible banners ---------- */
|
||||
|
||||
function initBanners() {
|
||||
document.addEventListener('click', function (event) {
|
||||
|
||||
var button = event.target.closest('.banner-close');
|
||||
if (!button)
|
||||
return;
|
||||
|
||||
var banner = button.closest('.banner');
|
||||
if (banner)
|
||||
banner.remove();
|
||||
});
|
||||
}
|
||||
|
||||
ready(function () {
|
||||
highlightNavigation();
|
||||
initSidebar();
|
||||
initBanners();
|
||||
wrapCopyText();
|
||||
});
|
||||
|
||||
})();
|
||||
@@ -0,0 +1,124 @@
|
||||
/* ==========================================================================
|
||||
OpenBench - workload page: LLR history graph
|
||||
(the panel itself, its label and the placeholder are styled in style.css)
|
||||
========================================================================== */
|
||||
|
||||
#content .llr-history-loader {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#content .llr-history-placeholder {
|
||||
width: 100%;
|
||||
height: 124px;
|
||||
}
|
||||
|
||||
#content .llrg-plot {
|
||||
position: relative;
|
||||
cursor: crosshair;
|
||||
touch-action: pan-y;
|
||||
user-select: none;
|
||||
-webkit-user-select: none;
|
||||
}
|
||||
|
||||
#content .llrg-plot:focus-visible {
|
||||
outline: 2px solid var(--accent);
|
||||
outline-offset: 4px;
|
||||
}
|
||||
|
||||
#content .llrg-svg {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.llrg-bg {
|
||||
fill: var(--color1);
|
||||
stroke: var(--line-strong);
|
||||
stroke-width: 1;
|
||||
}
|
||||
|
||||
.llrg-grid {
|
||||
stroke: rgba(197, 204, 217, 0.09);
|
||||
stroke-width: 1;
|
||||
shape-rendering: crispEdges;
|
||||
}
|
||||
|
||||
.llrg-zero {
|
||||
stroke: #6E7FA6;
|
||||
stroke-width: 1;
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.llrg-bound {
|
||||
stroke: var(--bad);
|
||||
stroke-width: 1;
|
||||
stroke-dasharray: 4 3;
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
.llrg-tick {
|
||||
fill: var(--muted);
|
||||
font: 500 10px var(--font-mono);
|
||||
}
|
||||
|
||||
.llrg-line {
|
||||
fill: none;
|
||||
stroke-width: 2;
|
||||
stroke-linecap: round;
|
||||
stroke-linejoin: round;
|
||||
}
|
||||
|
||||
.llrg-line-pos { stroke: var(--ok); }
|
||||
.llrg-line-neg { stroke: var(--bad); }
|
||||
|
||||
.llrg-hover-line {
|
||||
stroke: var(--color-font1);
|
||||
stroke-width: 1;
|
||||
stroke-dasharray: 2 2;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.llrg-hover-dot {
|
||||
fill: var(--color-font1);
|
||||
stroke-width: 1.5;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.llrg-hover-line.active,
|
||||
.llrg-hover-dot.active {
|
||||
opacity: 0.85;
|
||||
}
|
||||
|
||||
.llrg-hover-dot.llrg-pos { stroke: var(--ok); }
|
||||
.llrg-hover-dot.llrg-neg { stroke: var(--bad); }
|
||||
|
||||
#content .llrg-tip {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
z-index: 1;
|
||||
padding: 0.2rem 0.5rem 0.18rem;
|
||||
background-color: rgba(11, 14, 20, 0.96);
|
||||
border: 1px solid var(--line-strong);
|
||||
border-radius: var(--radius);
|
||||
color: var(--color-font1);
|
||||
font-family: var(--font-mono);
|
||||
font-size: 0.72rem;
|
||||
white-space: nowrap;
|
||||
pointer-events: none;
|
||||
opacity: 0;
|
||||
transform: translateY(2px);
|
||||
transition: opacity 0.12s ease, transform 0.12s ease;
|
||||
}
|
||||
|
||||
#content .llrg-tip.active {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
#content .llrg-tip {
|
||||
transition: none;
|
||||
}
|
||||
}
|
||||
@@ -204,7 +204,7 @@ def machine_name(machine_id):
|
||||
return machine.info['machine_name']
|
||||
except: return 'None'
|
||||
|
||||
def llr_history_graph(test, width=320, height=112):
|
||||
def _llr_history_graph_static(test, width=320, height=112):
|
||||
|
||||
if test.test_mode != 'SPRT':
|
||||
return ''
|
||||
@@ -407,6 +407,36 @@ def llr_history_graph(test, width=320, height=112):
|
||||
return mark_safe(svg)
|
||||
|
||||
|
||||
def llr_history_graph(test):
|
||||
"""Data for the LLR history chart, which is drawn in the browser by llr_history.js"""
|
||||
|
||||
import html as _html
|
||||
import json as _json
|
||||
from django.utils.safestring import mark_safe as _mark_safe
|
||||
|
||||
if test.test_mode != 'SPRT':
|
||||
return ''
|
||||
|
||||
history = [list(point) for point in OpenBench.utils.get_llr_history(test)]
|
||||
|
||||
# The line starts at the origin, and ends on the current state of the test
|
||||
if not history or history[0][0] > 0:
|
||||
history.insert(0, [0, 0.0, False])
|
||||
if history[-1][0] != test.games or history[-1][1] != test.currentllr:
|
||||
history.append([test.games, test.currentllr, False])
|
||||
|
||||
data = {
|
||||
'history' : [[int(p[0]), round(float(p[1]), 4), bool(p[2]) if len(p) > 2 else False] for p in history],
|
||||
'lower' : float(test.lowerllr),
|
||||
'upper' : float(test.upperllr),
|
||||
'current' : float(test.currentllr),
|
||||
'games' : int(test.games),
|
||||
'finished' : bool(test.finished),
|
||||
}
|
||||
|
||||
payload = _html.escape(_json.dumps(data, separators=(',', ':')), quote=True)
|
||||
return _mark_safe('<div class="llr-chart" data-chart="%s"></div>' % payload)
|
||||
|
||||
register = django.template.Library()
|
||||
register.filter('oneDigitPrecision', oneDigitPrecision)
|
||||
register.filter('twoDigitPrecision', twoDigitPrecision)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<div class="mt-3" id="pagebrowse">
|
||||
<nav class="mt-3" id="pagebrowser" aria-label="Pagination">
|
||||
{% if paging.prev != paging.next %}
|
||||
<div class="pagination">
|
||||
<a class="page previous" href="/{{ paging.url }}/{{ paging.prev }}">
|
||||
<a class="page previous" href="/{{ paging.url }}/{{ paging.prev }}" aria-label="Previous page">
|
||||
<i class="fa-solid fa-arrow-left"></i>
|
||||
</a>
|
||||
<div class="pages">
|
||||
@@ -9,15 +9,15 @@
|
||||
{% if page == "..." %}
|
||||
<span class="page ellipsis"><i class="fa-solid fa-fw fa-1x fa-ellipsis"></i></span>
|
||||
{% elif page == paging.page %}
|
||||
<a class="page current" href="/{{ paging.url }}/{{ page }}">{{ page }}</a>
|
||||
<a class="page current" href="/{{ paging.url }}/{{ page }}" aria-current="page">{{ page }}</a>
|
||||
{% else %}
|
||||
<a class="page" href="/{{ paging.url }}/{{ page }}">{{ page }}</a>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
<a class="page next" href="/{{ paging.url }}/{{ paging.next }}">
|
||||
<a class="page next" href="/{{ paging.url }}/{{ paging.next }}" aria-label="Next page">
|
||||
<i class="fa-solid fa-arrow-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</nav>
|
||||
@@ -0,0 +1,10 @@
|
||||
<thead>
|
||||
<tr class="table-header">
|
||||
<th>Author</th>
|
||||
<th>Engine</th>
|
||||
<th>Test</th>
|
||||
<th class="textcenter">Diff</th>
|
||||
<th>Time Control</th>
|
||||
<th>Result</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -1,15 +1,15 @@
|
||||
{% load mytags %}
|
||||
<td><a href="/user/{{test.author}}">{{test.author|capfirst|slice:":6"}}</a></td>
|
||||
<td>{{test.dev_engine}}</td>
|
||||
<td>
|
||||
<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">
|
||||
<a href="{{test|workload_url}}">{{test|prettyDevName}}</a>
|
||||
{% if test.error %} <span style="color: red; cursor: pointer" title="Crash or illegal move">*</span> {% endif %}
|
||||
{% if test|test_is_fischer %} <span style="color: green; cursor: pointer" title="Fischer random chess">*</span> {% endif %}
|
||||
{% 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 %}
|
||||
</td>
|
||||
<td class="textcenter"><a href="{{test|gitDiffLink}}">diff</a></td>
|
||||
<td>
|
||||
<td class="col-diff textcenter"><a href="{{test|gitDiffLink}}">diff</a></td>
|
||||
<td class="col-tc">
|
||||
{{test.dev_time_control}}
|
||||
{% if test|test_is_time_odds %} <span style="color: yellow; cursor: pointer" title="Time odds">*</span> {% endif %}
|
||||
{% if test|test_is_smp_odds %} <span style="color: orange; cursor: pointer" title="Thread odds">*</span> {% endif %}
|
||||
{% if test|test_is_time_odds %}<span class="flag flag-time" title="Time odds">time odds</span>{% endif %}
|
||||
{% if test|test_is_smp_odds %}<span class="flag flag-smp" title="Thread odds">thread odds</span>{% endif %}
|
||||
</td>
|
||||
<td class='statblock statblock-{{test|testResultColour}}'><strong>{{test|shortStatBlock|linebreaksbr}}</strong></td>
|
||||
<td class='statblock statblock-{{test|testResultColour}} col-result'><strong>{{test|shortStatBlock|linebreaksbr}}</strong></td>
|
||||
+142
-86
@@ -5,7 +5,10 @@
|
||||
{% load static %}
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="theme-color" content="#0B0E14">
|
||||
<meta name="color-scheme" content="dark">
|
||||
|
||||
<link rel="icon" type="image/svg+xml" href="{% static 'logo.svg' %}?{{ static_version }}">
|
||||
<link rel="stylesheet" href="{% static 'style.css' %}?{{ static_version }}">
|
||||
@@ -15,14 +18,17 @@
|
||||
|
||||
<link href='https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.0/css/all.min.css' rel='stylesheet'>
|
||||
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com">
|
||||
<link href="https://fonts.googleapis.com/css2?family=Courier+Prime&display=swap" rel="stylesheet">
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap" rel="stylesheet">
|
||||
|
||||
<title>RektBench</title>
|
||||
|
||||
{% block scripts %}
|
||||
{% endblock %}
|
||||
|
||||
<script src="{% static 'ui.js' %}?{{ static_version }}" defer></script>
|
||||
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
|
||||
@@ -59,109 +65,159 @@
|
||||
}, false);
|
||||
|
||||
function toggle_sidebar() {
|
||||
document.body.classList.toggle('sidebar-open')
|
||||
var open = document.body.classList.toggle('sidebar-open');
|
||||
var toggle = document.getElementById('sidebar-toggle');
|
||||
if (toggle)
|
||||
toggle.setAttribute('aria-expanded', String(open));
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div id="sidebar">
|
||||
<a class="skip-link" href="#content">Skip to content</a>
|
||||
|
||||
<ul>
|
||||
<li class="header">Admin</li>
|
||||
<header id="topbar">
|
||||
|
||||
<button id="sidebar-toggle" type="button" onclick="toggle_sidebar()"
|
||||
aria-label="Toggle navigation" aria-controls="sidebar" aria-expanded="false">
|
||||
<i class="fa-solid fa-bars fa-fw"></i>
|
||||
</button>
|
||||
|
||||
<a class="brand" href="/">
|
||||
<img class="brand-logo" src="{% static 'logo.svg' %}?{{ static_version }}" alt="" width="26" height="26">
|
||||
<span class="brand-name">RektBench</span>
|
||||
<span class="brand-sub">Testing Framework</span>
|
||||
</a>
|
||||
|
||||
<div class="topbar-spacer"></div>
|
||||
|
||||
<nav class="topbar-actions" aria-label="Quick actions">
|
||||
<a class="topbar-btn" href="/search" title="Search tests">
|
||||
<i class="fa-solid fa-magnifying-glass fa-fw"></i><span>Search</span>
|
||||
</a>
|
||||
<a class="topbar-btn topbar-btn-primary" href="/newTest" title="Create a new test">
|
||||
<i class="fa-solid fa-plus fa-fw"></i><span>Create Test</span>
|
||||
</a>
|
||||
{% if user.is_authenticated %}
|
||||
<li><a href="/logout/"><i class="fa-solid fa-right-from-bracket fa-fw"></i> Logout</a></li>
|
||||
<li><a href="/profile/"><i class="fa-solid fa-user fa-fw"></i> Profile</a></li>
|
||||
<a class="topbar-btn" href="/profile/" title="Profile">
|
||||
<i class="fa-solid fa-user fa-fw"></i><span>{{ user.username|capfirst }}</span>
|
||||
</a>
|
||||
{% else %}
|
||||
<li><a href="/login"><i class="fa-solid fa-right-to-bracket fa-fw"></i> Login</a></li>
|
||||
<li><a href="/register"><i class="fa-solid fa-registered fa-fw"></i> Register</a></li>
|
||||
<a class="topbar-btn" href="/login" title="Login">
|
||||
<i class="fa-solid fa-right-to-bracket fa-fw"></i><span>Login</span>
|
||||
</a>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
<hr>
|
||||
</header>
|
||||
|
||||
<ul>
|
||||
<li class="header">Tests</li>
|
||||
<li><a href="/index"><i class="fa-solid fa-house fa-fw"></i> Index</a></li>
|
||||
<li><a href="/greens"><i class="fa-solid fa-heart fa-fw"></i> Greens</a></li>
|
||||
<li><a href="/search"><i class="fa-solid fa-magnifying-glass fa-fw"></i> Search</a></li>
|
||||
</ul>
|
||||
<div id="layout">
|
||||
|
||||
<hr>
|
||||
<nav id="sidebar" aria-label="Main navigation">
|
||||
|
||||
<ul>
|
||||
<li class="header">Actions</li>
|
||||
<li><a href="/newTest"><i class="fa-solid fa-plus fa-fw"></i> Create Test</a></li>
|
||||
<li><a href="/newTune"><i class="fa-solid fa-vial fa-fw"></i> Create Tune</a></li>
|
||||
<li><a href="/newDatagen"><i class="fa-solid fa-database fa-fw"></i> Create Datagen</a></li>
|
||||
<li><a href="/newNetwork"><i class="fa-solid fa-upload fa-fw"></i> Upload Net</a></li>
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
|
||||
<ul>
|
||||
<li class="header">Info</li>
|
||||
<li><a href="/users"><i class="fa-solid fa-users fa-fw"></i> Users</a></li>
|
||||
<li><a href="/events"><i class="fa-solid fa-circle-exclamation fa-fw"></i> Events</a></li>
|
||||
<li><a href="/errors"><i class="fa-solid fa-exclamation-triangle fa-fw"></i> Errors</a></li>
|
||||
<li><a href="/machines"><i class="fa-solid fa-microchip fa-fw"></i> Machines</a></li>
|
||||
<li><a href="/networks"><i class="fa-solid fa-circle-nodes fa-fw"></i> Networks</a></li>
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
|
||||
<ul>
|
||||
<li class="header">Support</li>
|
||||
<li><a href="{{config.client_repo_url}}"><i class="fa-brands fa-github fa-fw"></i> OpenBench</a></li>
|
||||
<li><a href="https://discord.gg/9MVg7fBTpM"><i class="fa-brands fa-discord fa-fw"></i> Discord</a></li>
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
|
||||
<ul>
|
||||
<li class="header">Engines</li>
|
||||
{% for engine, data in config.engines.items %}
|
||||
<li><a href="{{data.source}}">{{engine}}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content-parent">
|
||||
<div id="content" class="pb-5">
|
||||
<div id="content-header">
|
||||
<button id="sidebar-toggle" onclick="toggle_sidebar()">
|
||||
<i class="fa-solid fa-bars fa-fw"></i>
|
||||
</button>
|
||||
<h2>
|
||||
<a class="site-title" href="/">RektBench Testing Framework</a>
|
||||
</h2>
|
||||
<div class="nav-section">
|
||||
<div class="nav-title">Account</div>
|
||||
<ul>
|
||||
{% if user.is_authenticated %}
|
||||
<li><a href="/profile/"><i class="fa-solid fa-user fa-fw"></i> Profile</a></li>
|
||||
<li><a href="/logout/"><i class="fa-solid fa-right-from-bracket fa-fw"></i> Logout</a></li>
|
||||
{% else %}
|
||||
<li><a href="/login"><i class="fa-solid fa-right-to-bracket fa-fw"></i> Login</a></li>
|
||||
<li><a href="/register"><i class="fa-solid fa-registered fa-fw"></i> Register</a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
{% if request.session.error_message %}
|
||||
<div class="error-message">
|
||||
<pre>{{request.session.error_message}}</pre>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="nav-section">
|
||||
<div class="nav-title">Tests</div>
|
||||
<ul>
|
||||
<li><a href="/index"><i class="fa-solid fa-house fa-fw"></i> Index</a></li>
|
||||
<li><a href="/greens"><i class="fa-solid fa-heart fa-fw"></i> Greens</a></li>
|
||||
<li><a href="/search"><i class="fa-solid fa-magnifying-glass fa-fw"></i> Search</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
{% if request.session.warning_message %}
|
||||
<div class="warning-message">
|
||||
<pre>{{request.session.warning_message}}</pre>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="nav-section">
|
||||
<div class="nav-title">Actions</div>
|
||||
<ul>
|
||||
<li><a href="/newTest"><i class="fa-solid fa-plus fa-fw"></i> Create Test</a></li>
|
||||
<li><a href="/newTune"><i class="fa-solid fa-vial fa-fw"></i> Create Tune</a></li>
|
||||
<li><a href="/newDatagen"><i class="fa-solid fa-database fa-fw"></i> Create Datagen</a></li>
|
||||
<li><a href="/newNetwork"><i class="fa-solid fa-upload fa-fw"></i> Upload Net</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
{% if request.session.status_message %}
|
||||
<div class="status-message">
|
||||
<pre>{{request.session.status_message}}</pre>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="nav-section">
|
||||
<div class="nav-title">Info</div>
|
||||
<ul>
|
||||
<li><a href="/users"><i class="fa-solid fa-users fa-fw"></i> Users</a></li>
|
||||
<li><a href="/events"><i class="fa-solid fa-circle-exclamation fa-fw"></i> Events</a></li>
|
||||
<li><a href="/errors"><i class="fa-solid fa-triangle-exclamation fa-fw"></i> Errors</a></li>
|
||||
<li><a href="/machines"><i class="fa-solid fa-microchip fa-fw"></i> Machines</a></li>
|
||||
<li><a href="/networks"><i class="fa-solid fa-circle-nodes fa-fw"></i> Networks</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="nav-section">
|
||||
<div class="nav-title">Support</div>
|
||||
<ul>
|
||||
<li><a href="{{config.client_repo_url}}"><i class="fa-brands fa-github fa-fw"></i> OpenBench</a></li>
|
||||
<li><a href="https://discord.gg/9MVg7fBTpM"><i class="fa-brands fa-discord fa-fw"></i> Discord</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="nav-section">
|
||||
<div class="nav-title">Engines</div>
|
||||
<ul>
|
||||
{% for engine, data in config.engines.items %}
|
||||
<li><a href="{{data.source}}"><i class="fa-solid fa-chess-knight fa-fw"></i> {{engine}}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</nav>
|
||||
|
||||
<div id="sidebar-backdrop"></div>
|
||||
|
||||
<main id="content-parent">
|
||||
<div id="content">
|
||||
|
||||
{% if request.session.error_message %}
|
||||
<div class="banner error-message" role="alert">
|
||||
<i class="fa-solid fa-circle-exclamation banner-icon"></i>
|
||||
<pre>{{request.session.error_message}}</pre>
|
||||
<button class="banner-close" type="button" aria-label="Dismiss"><i class="fa-solid fa-xmark"></i></button>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if request.session.warning_message %}
|
||||
<div class="banner warning-message" role="alert">
|
||||
<i class="fa-solid fa-triangle-exclamation banner-icon"></i>
|
||||
<pre>{{request.session.warning_message}}</pre>
|
||||
<button class="banner-close" type="button" aria-label="Dismiss"><i class="fa-solid fa-xmark"></i></button>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if request.session.status_message %}
|
||||
<div class="banner status-message" role="status">
|
||||
<i class="fa-solid fa-circle-check banner-icon"></i>
|
||||
<pre>{{request.session.status_message}}</pre>
|
||||
<button class="banner-close" type="button" aria-label="Dismiss"><i class="fa-solid fa-xmark"></i></button>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="page-head">{% block page_head %}{% endblock %}</div>
|
||||
|
||||
{% block content %}
|
||||
{% endblock %}
|
||||
|
||||
</div>
|
||||
</main>
|
||||
|
||||
{% block content %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="toast" role="status" aria-live="polite"></div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -22,8 +22,20 @@
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
{% block page_head %}<div><h1 class="page-title">{{submit_text}}</h1><p class="page-sub">Pick a preset to fill in the defaults, then adjust anything below.</p></div>{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<!-- Presets are generated by create_workload.js, based on the selected Engine -->
|
||||
<div class="form">
|
||||
<div class="col-full">
|
||||
<h3>Presets</h3>
|
||||
<div id="test-mode-buttons">
|
||||
<!-- Generated based on the selected Engine -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form method="POST" action="{{submit_endpoint}}">
|
||||
{% csrf_token %}
|
||||
|
||||
@@ -121,7 +133,7 @@
|
||||
<h3> SPSA Input </h3>
|
||||
|
||||
<div class="row">
|
||||
<textarea style="margin-left:24px" id="spsa_inputs" name="spsa_inputs" rows=9></textarea>
|
||||
<textarea id="spsa_inputs" name="spsa_inputs" rows=9></textarea>
|
||||
</div>
|
||||
|
||||
{% endif %}
|
||||
@@ -187,7 +199,7 @@
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<label for="test_mode"> Play Reverses </label>
|
||||
<label for="datagen_play_reverses"> Play Reverses </label>
|
||||
<select id="datagen_play_reverses" name="datagen_play_reverses">
|
||||
<option value="YES"> Yes </option>
|
||||
<option selected value="NO"> No </option>
|
||||
@@ -226,7 +238,7 @@
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<label for="throughput"> Throughput </label> <input value="1000" id="throughput" , name="throughput">
|
||||
<label for="throughput"> Throughput </label> <input value="1000" id="throughput" name="throughput">
|
||||
</div>
|
||||
|
||||
{% if workload == "TEST" or workload == "DATAGEN" %}
|
||||
@@ -269,15 +281,9 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="submit" class="anchorbutton btn-start mt-3 mw-84" name="submit" value="{{submit_text}}">
|
||||
<div class="form-actions">
|
||||
<input type="submit" class="anchorbutton btn-blue" name="submit" value="{{submit_text}}">
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="form">
|
||||
<div class="col-full">
|
||||
<div id="test-mode-buttons">
|
||||
<!-- Generated based on the selected Engine -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
@@ -1,5 +1,7 @@
|
||||
{% extends "OpenBench/base.html" %}
|
||||
|
||||
{% 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">
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
{% extends "OpenBench/base.html" %}
|
||||
|
||||
{% block page_head %}<div><h1 class="page-title">Events</h1><p class="page-sub">Recent activity across all workloads</p></div>{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<table class="hoverable">
|
||||
|
||||
@@ -2,66 +2,102 @@
|
||||
|
||||
{% load mytags %}
|
||||
|
||||
{% block page_head %}<div><h1 class="page-title">Tests</h1><p class="page-sub">Pending, active and finished workloads</p></div>{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<table class="test-list stripes hoverable">
|
||||
|
||||
<!-- Only show Pending tests for the front page of the Index -->
|
||||
{% if paging.page == 1 %}
|
||||
|
||||
<!-- Currently Pending tests (Waiting to be approved) -->
|
||||
{% if pending %}
|
||||
<tr class="table-header"><th colspan='6'>Pending</th></tr>
|
||||
{% for test in pending %}
|
||||
<tr>
|
||||
{% include "OpenBench/Blocks/testsummary.html" %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
<tr class="table-spacer"><th colspan='6'></th></tr>
|
||||
{% endif %}
|
||||
|
||||
<!-- Currently Awaiting tests (Waiting for Artifacts) -->
|
||||
{% if awaiting %}
|
||||
<tr class="table-header"><th colspan='6'>Awaiting Artifacts</th></tr>
|
||||
{% for test in awaiting %}
|
||||
<tr>
|
||||
{% include "OpenBench/Blocks/testsummary.html" %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
<tr class="table-spacer"><th colspan='6'></th></tr>
|
||||
{% endif %}
|
||||
|
||||
<!-- Currently Running tests (Waiting to be completed) -->
|
||||
{% if active %}
|
||||
<tr class="table-header"><th colspan='6'>Active {{status}}</th></tr>
|
||||
{% for test in active %}
|
||||
|
||||
<!-- Add two empty rows ( for the colouring scheme ) when changing prio -->
|
||||
{% with prev_test=active|previous:forloop.counter0 %}
|
||||
{% if prev_test and prev_test.priority != test.priority %}
|
||||
<tr class="table-spacer-small"><th colspan='6'></th></tr>
|
||||
<tr class="table-spacer-small"><th colspan='6'></th></tr>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
|
||||
<tr>
|
||||
{% include "OpenBench/Blocks/testsummary.html" %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
<tr class="table-spacer"><th colspan='6'></th></tr>
|
||||
{% endif %}
|
||||
<!-- Only show Pending tests for the front page of the Index -->
|
||||
{% if paging.page == 1 %}
|
||||
|
||||
<!-- Currently Pending tests (Waiting to be approved) -->
|
||||
{% if pending %}
|
||||
<section class="card">
|
||||
<header class="card-head">
|
||||
<h2 class="card-title">Pending</h2>
|
||||
<span class="count">{{ pending|length }}</span>
|
||||
</header>
|
||||
<table class="test-list stripes hoverable">
|
||||
{% include "OpenBench/Blocks/testhead.html" %}
|
||||
<tbody>
|
||||
{% for test in pending %}
|
||||
<tr>
|
||||
{% include "OpenBench/Blocks/testsummary.html" %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
{% endif %}
|
||||
|
||||
<!-- Tests which have already finished -->
|
||||
<tr class="table-header"><th colspan='6'>Finished</th></tr>
|
||||
{% for test in completed %}
|
||||
<tr>
|
||||
{% include "OpenBench/Blocks/testsummary.html" %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
<!-- Currently Awaiting tests (Waiting for Artifacts) -->
|
||||
{% if awaiting %}
|
||||
<section class="card">
|
||||
<header class="card-head">
|
||||
<h2 class="card-title">Awaiting Artifacts</h2>
|
||||
<span class="count">{{ awaiting|length }}</span>
|
||||
</header>
|
||||
<table class="test-list stripes hoverable">
|
||||
{% include "OpenBench/Blocks/testhead.html" %}
|
||||
<tbody>
|
||||
{% for test in awaiting %}
|
||||
<tr>
|
||||
{% include "OpenBench/Blocks/testsummary.html" %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
{% endif %}
|
||||
|
||||
</table>
|
||||
<!-- Currently Running tests (Waiting to be completed) -->
|
||||
{% if active %}
|
||||
<section class="card">
|
||||
<header class="card-head">
|
||||
<h2 class="card-title">Active {{status}}</h2>
|
||||
<span class="count">{{ active|length }}</span>
|
||||
</header>
|
||||
<table class="test-list stripes hoverable">
|
||||
{% include "OpenBench/Blocks/testhead.html" %}
|
||||
<tbody>
|
||||
{% for test in active %}
|
||||
|
||||
<!-- Add two empty rows ( for the colouring scheme ) when changing prio -->
|
||||
{% with prev_test=active|previous:forloop.counter0 %}
|
||||
{% if prev_test and prev_test.priority != test.priority %}
|
||||
<tr class="table-spacer-small"><td colspan='6'></td></tr>
|
||||
<tr class="table-spacer-small"><td colspan='6'></td></tr>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
|
||||
<tr>
|
||||
{% include "OpenBench/Blocks/testsummary.html" %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
<!-- Tests which have already finished -->
|
||||
<section class="card">
|
||||
<header class="card-head">
|
||||
<h2 class="card-title">Finished</h2>
|
||||
</header>
|
||||
<table class="test-list stripes hoverable">
|
||||
{% include "OpenBench/Blocks/testhead.html" %}
|
||||
<tbody>
|
||||
{% for test in completed %}
|
||||
<tr>
|
||||
{% include "OpenBench/Blocks/testsummary.html" %}
|
||||
</tr>
|
||||
{% empty %}
|
||||
<tr class="empty-row"><td colspan="6">No finished tests yet.</td></tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
|
||||
{% include "OpenBench/Blocks/pagebrowser.html" %}
|
||||
|
||||
|
||||
@@ -1,20 +1,26 @@
|
||||
{% extends "OpenBench/base.html" %}
|
||||
|
||||
{% block page_head %}<div><h1 class="page-title">Login</h1><p class="page-sub">Sign in to create and manage tests.</p></div>{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<form method="POST" action="/login/">
|
||||
{% csrf_token %}
|
||||
<div class="form">
|
||||
<div class="col">
|
||||
<div class="row">
|
||||
<label type="text">Username</label> <input type="text" name="username"><br>
|
||||
<div class="auth-wrap">
|
||||
<form method="POST" action="/login/">
|
||||
{% csrf_token %}
|
||||
<div class="form">
|
||||
<div class="col">
|
||||
<div class="row">
|
||||
<label for="username">Username</label>
|
||||
<input id="username" type="text" name="username" autocomplete="username" autofocus>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label for="password">Password</label>
|
||||
<input id="password" type="password" name="password" autocomplete="current-password">
|
||||
</div>
|
||||
<input type="submit" name="submit" value="Login" class="anchorbutton btn-blue w-100">
|
||||
</div>
|
||||
<div class="row">
|
||||
<label type="text">Password</label> <input type="password" name="password"><br>
|
||||
</div>
|
||||
<input type="submit" name="submit" value="Login" class="anchorbutton btn-blue w-100">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
@@ -6,11 +6,13 @@
|
||||
{% load static %}
|
||||
{% endblock %}
|
||||
|
||||
{% block page_head %}<div><h1 class="page-title">Machine {{ machine.id }}</h1><p class="page-sub">{{ machine.info.machine_name }}</p></div><div class="page-actions"><a class="anchorbutton btn-start" href="/machines"><i class="fa-solid fa-arrow-left fa-fw"></i> All machines</a></div>{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div id="config" style="display: block; overflow-x: auto;">
|
||||
<div id="config" class="card">
|
||||
|
||||
<table class="test-config left-align wrappable" style="table-layout: auto; width: 100%;">
|
||||
<table class="test-config left-align wrappable">
|
||||
|
||||
<tr><td class="td-label">User</td><td>{{machine.user.username}}</td></tr>
|
||||
<tr><td class="td-label">Machine Name</td><td>{{machine.info.machine_name}}</td></tr>
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
{% load mytags %}
|
||||
|
||||
{% block page_head %}<div><h1 class="page-title">Machines</h1><p class="page-sub">Workers that have connected to this server</p></div>{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<table class="hoverable">
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
{% load static %}
|
||||
|
||||
{% block page_head %}<div><h1 class="page-title">Edit Network</h1><p class="page-sub">{{network.name}}</p></div>{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<form method="POST" action="/networks/{{network.engine}}/EDIT/{{network.sha256}}/">
|
||||
@@ -44,7 +46,7 @@
|
||||
<option value="TRUE"> True </option>
|
||||
<option selected value="FALSE"> False </option>
|
||||
{% endif %}
|
||||
<select>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
@@ -57,7 +59,7 @@
|
||||
<option value="TRUE"> True </option>
|
||||
<option selected value="FALSE"> False </option>
|
||||
{% endif %}
|
||||
<select>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<input class="anchorbutton btn-blue w-100" type="submit" value="Update Network">
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block page_head %}<div><h1 class="page-title">Networks</h1><p class="page-sub">Click a column header to sort</p></div><div class="page-actions"><a class="anchorbutton btn-blue" href="/newNetwork"><i class="fa-solid fa-upload fa-fw"></i> Upload Network</a></div>{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<table id="network-table" class="hoverable">
|
||||
@@ -27,7 +29,7 @@
|
||||
<th class="cursor" onclick="sort_networks(['engine'])">Engine</th>
|
||||
<th class="cursor" onclick="sort_networks(['author'])">Author</th>
|
||||
<th class="cursor" onclick="sort_networks(['name'])">Name</th>
|
||||
<th class="cursor" onclick="sort_networks(['sha256'])")>Hash</th>
|
||||
<th class="cursor" onclick="sort_networks(['sha256'])">Hash</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
@@ -51,7 +53,7 @@
|
||||
|
||||
<td>
|
||||
<a href="/networks/{{network.engine}}/EDIT/{{network.sha256}}">
|
||||
<i class="fa-solid fa-pen-to-square" style="color: grey;"></i>
|
||||
<i class="fa-solid fa-pen-to-square icon-action"></i>
|
||||
</a>
|
||||
</td>
|
||||
|
||||
@@ -59,11 +61,11 @@
|
||||
{% if not network.default and not network.was_default %}
|
||||
<a onclick="return confirm('YOU ARE DELETING THIS NETWORK FILE FOREVER')"
|
||||
href="/networks/{{network.engine}}/DELETE/{{network.sha256}}">
|
||||
<i class="fa-solid fa-trash-can" style="color: #A03030;"></i></a>
|
||||
<i class="fa-solid fa-trash-can icon-danger"></i></a>
|
||||
{% else %}
|
||||
<a onclick="return alert('You must unset the default and previous-default flags manually before deleting')"
|
||||
href="/networks/{{network.engine}}/EDIT/{{network.sha256}}">
|
||||
<i class="fa-solid fa-trash-can" style="color: grey;"></i></a>
|
||||
<i class="fa-solid fa-trash-can icon-action"></i></a>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -11,12 +11,15 @@
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
{% block page_head %}<div><h1 class="page-title">Profile</h1><p class="page-sub">{{ profile.user.username|capfirst }}</p></div>{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<form method="POST" action="/profile/">
|
||||
{% csrf_token %}
|
||||
<div class="form">
|
||||
<div class="col">
|
||||
<h3>Account</h3>
|
||||
<div class="row">
|
||||
<label for="username">Username</label>
|
||||
<input id="username" readonly value="{{ profile.user.username }}">
|
||||
@@ -26,39 +29,40 @@
|
||||
<input id="email" value="{{ profile.user.email }}" name="email">
|
||||
</div>
|
||||
|
||||
<h3>Change password</h3>
|
||||
<div class="row">
|
||||
<label for="password1">New Password</label>
|
||||
<input id="password1" type="password" name="password1">
|
||||
<input id="password1" type="password" name="password1" autocomplete="new-password">
|
||||
</div>
|
||||
<div class="row">
|
||||
<label for="password2">New Password</label>
|
||||
<input id="password2" type="password" name="password2">
|
||||
<label for="password2">Repeat Password</label>
|
||||
<input id="password2" type="password" name="password2" autocomplete="new-password">
|
||||
</div>
|
||||
<input class="anchorbutton btn-blue w-100" type="submit" value="Update Profile">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<br>
|
||||
|
||||
<form method="POST" action="/profileConfig/">
|
||||
{% csrf_token %}
|
||||
<div class="form">
|
||||
<div class="col" id="engines-container">
|
||||
|
||||
<h3>Engines</h3>
|
||||
|
||||
<!-- Display engines which have repos already defined -->
|
||||
{% for engine, repo in profile.repos.items %}
|
||||
<div class="row" id="engine-row-{{ engine }}">
|
||||
<label for="engine-repo-{{engine}}">{{ engine }}</label>
|
||||
<input id="engine-repo-{{engine}}" type="text" name="engine-repo-{{engine}}" value="{{ repo|removePrefix:'https://github.com/' }}">
|
||||
|
||||
<span>
|
||||
<span title="Default engine">
|
||||
<input id="radio-{{engine}}" type="radio" name="default-status" value="{{engine}}"
|
||||
{% if profile.engine == engine %}checked{% endif %}>
|
||||
</span>
|
||||
|
||||
<span onclick="deleteRow(event)">
|
||||
<i class="fa-solid fa-trash-can" style="color: #A00000;" data-engine="{{engine}}" ></i>
|
||||
<span onclick="deleteRow(event)" title="Remove engine">
|
||||
<i class="fa-solid fa-trash-can" data-engine="{{engine}}" ></i>
|
||||
</span>
|
||||
</div>
|
||||
{% endfor %}
|
||||
@@ -110,4 +114,4 @@
|
||||
</script>
|
||||
|
||||
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
@@ -1,26 +1,34 @@
|
||||
{% extends "OpenBench/base.html" %}
|
||||
|
||||
{% block page_head %}<div><h1 class="page-title">Register</h1><p class="page-sub">Create an account to start testing.</p></div>{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<form id="registerForm" method="POST" action="/register/">
|
||||
{% csrf_token %}
|
||||
<div class="form">
|
||||
<div class="col">
|
||||
<div class="row">
|
||||
<label>Username</label><input name="username">
|
||||
<div class="auth-wrap">
|
||||
<form id="registerForm" method="POST" action="/register/">
|
||||
{% csrf_token %}
|
||||
<div class="form">
|
||||
<div class="col">
|
||||
<div class="row">
|
||||
<label for="register-username">Username</label>
|
||||
<input id="register-username" name="username" autocomplete="username" autofocus>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label for="register-password1">Password</label>
|
||||
<input id="register-password1" type="password" name="password1" autocomplete="new-password">
|
||||
</div>
|
||||
<div class="row">
|
||||
<label for="register-password2">Confirm Password</label>
|
||||
<input id="register-password2" type="password" name="password2" autocomplete="new-password">
|
||||
</div>
|
||||
<div class="row">
|
||||
<label for="register-email">Email</label>
|
||||
<input id="register-email" name="email" autocomplete="email">
|
||||
</div>
|
||||
<input class="anchorbutton btn-blue w-100" type="submit" name="submit" value="Create User">
|
||||
</div>
|
||||
<div class="row">
|
||||
<label>Password</label><input type="password" name="password1">
|
||||
</div>
|
||||
<div class="row">
|
||||
<label>Password</label><input type="password" name="password2">
|
||||
</div>
|
||||
<div class="row">
|
||||
<label>Email</label><input name="email">
|
||||
</div>
|
||||
<input class="anchorbutton btn-blue w-100" type="submit" name="submit" value="Create User">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
@@ -27,19 +27,25 @@
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block page_head %}<div><h1 class="page-title">Search Tests</h1>{% if not tests %}<p class="page-sub">Leave a filter empty to match everything.</p>{% endif %}</div>{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% if not tests %}
|
||||
<form method="POST" action="/search/">
|
||||
{% csrf_token %}
|
||||
<div class="form">
|
||||
|
||||
<div class="col">
|
||||
|
||||
<h3>Who & what</h3>
|
||||
|
||||
<div class="row">
|
||||
<label for="keywords">Keywords</label>
|
||||
<input id="keywords" name="keywords" placeholder="Seperated By Spaces"><br>
|
||||
<input id="keywords" name="keywords" placeholder="Seperated By Spaces">
|
||||
</div>
|
||||
<div class="row">
|
||||
<label for="author">Author</label>
|
||||
<input id="author" name="author" placeholder="All Authors By Default"><br>
|
||||
<input id="author" name="author" placeholder="All Authors By Default">
|
||||
</div>
|
||||
<div class="row">
|
||||
<label for="engine">Engine</label>
|
||||
@@ -48,9 +54,8 @@
|
||||
{% for name, data in config.engines.items %}
|
||||
<option value="{{name}}">{{name}}</option>
|
||||
{% endfor %}
|
||||
</select><br>
|
||||
</select>
|
||||
</div>
|
||||
<br>
|
||||
<div class="row">
|
||||
<label for="opening-book">Opening Book</label>
|
||||
<select id="opening-book" name="opening-book">
|
||||
@@ -58,15 +63,15 @@
|
||||
{% for name, data in config.books.items %}
|
||||
<option value="{{name}}">{{name}}</option>
|
||||
{% endfor %}
|
||||
</select><br>
|
||||
</select>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label for="test-mode">Test Mode</label>
|
||||
<select id="test-mode" name="test-mode">
|
||||
<option value="" selected>All Test Types</option>
|
||||
<option value="SPRT">SPRT</option>
|
||||
<option value="GAMES">FIXED</option>
|
||||
</select><br>
|
||||
<option value="SPRT">SPRT</option>
|
||||
<option value="GAMES">FIXED</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label for="syzygy-wdl">Syzygy WDL</label>
|
||||
@@ -78,8 +83,15 @@
|
||||
<option value="5-MAN"> 5-Man </option>
|
||||
<option value="4-MAN"> 4-Man </option>
|
||||
<option value="3-MAN"> 3-Man </option>
|
||||
</select><br>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
|
||||
<h3>Time & threads</h3>
|
||||
|
||||
<div class="row">
|
||||
<label for="tc-type">Time Type</label>
|
||||
<select id="tc-type" name="tc-type" onchange="changed_timecontrol()">
|
||||
@@ -89,71 +101,87 @@
|
||||
<option value="FIXED-TIME">Fixed Time</option>
|
||||
<option value="FISCHER">Fischer</option>
|
||||
<option value="CYCLIC">Cyclic</option>
|
||||
</select><br>
|
||||
</select>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label for="tc-value-input">Time Value</label>
|
||||
<select id="tc-value-select" name="tc-value-select" style="margin-right: 8px; flex-grow: 0">
|
||||
<option value="=" selected>==</option>
|
||||
<select id="tc-value-select" name="tc-value-select" aria-label="Time value comparison" style="flex-grow: 0">
|
||||
<option value="=" selected>=</option>
|
||||
<option value=">=">>=</option>
|
||||
<option value="<="><=</option>
|
||||
</select>
|
||||
<input id="tc-value-input" name="tc-value-input"><br>
|
||||
<input id="tc-value-input" name="tc-value-input">
|
||||
</div>
|
||||
<div class="row">
|
||||
<label for="threads-input">Threads</label>
|
||||
<select id="threads-select" name="threads-select" style="margin-right: 8px; flex-grow: 0">
|
||||
<select id="threads-select" name="threads-select" aria-label="Threads comparison" style="flex-grow: 0">
|
||||
<option value="=">==</option>
|
||||
<option value=">=" selected>>=</option>
|
||||
<option value="<="><=</option>
|
||||
</select>
|
||||
<input id="threads-input" name="threads-input" value="1"><br>
|
||||
<input id="threads-input" name="threads-input" value="1">
|
||||
</div>
|
||||
<br>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="row">
|
||||
<label for="show-greens">Greens</label>
|
||||
<input checked type="checkbox" id="show-greens" name="show-greens" value="">
|
||||
</div>
|
||||
<div class="row">
|
||||
<label for="show-blues">Blues</label>
|
||||
<input checked type="checkbox" id="show-blues" name="show-blues" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="row">
|
||||
<label for="show-yellows">Yellows</label>
|
||||
<input checked type="checkbox" id="show-yellows" name="show-yellows" value="">
|
||||
</div>
|
||||
<div class="row">
|
||||
<label for="show-stopped">Stopped</label>
|
||||
<input checked type="checkbox" id="show-stopped" name="show-stopped" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="row">
|
||||
<label for="show-reds">Reds</label>
|
||||
<input checked type="checkbox" id="show-reds" name="show-reds" value="">
|
||||
</div>
|
||||
<div class="row">
|
||||
<label for="show-deleted">Deleted</label>
|
||||
<input type="checkbox" id="show-deleted" name="show-deleted" value="">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h3>Show results</h3>
|
||||
|
||||
<div class="chips">
|
||||
<label class="chip chip-green" for="show-greens">
|
||||
<input checked type="checkbox" id="show-greens" name="show-greens" value="">Greens
|
||||
</label>
|
||||
<label class="chip chip-blue" for="show-blues">
|
||||
<input checked type="checkbox" id="show-blues" name="show-blues" value="">Blues
|
||||
</label>
|
||||
<label class="chip chip-yellow" for="show-yellows">
|
||||
<input checked type="checkbox" id="show-yellows" name="show-yellows" value="">Yellows
|
||||
</label>
|
||||
<label class="chip chip-red" for="show-reds">
|
||||
<input checked type="checkbox" id="show-reds" name="show-reds" value="">Reds
|
||||
</label>
|
||||
<label class="chip" for="show-stopped">
|
||||
<input checked type="checkbox" id="show-stopped" name="show-stopped" value="">Stopped
|
||||
</label>
|
||||
<label class="chip" for="show-deleted">
|
||||
<input type="checkbox" id="show-deleted" name="show-deleted" value="">Deleted
|
||||
</label>
|
||||
</div>
|
||||
<input type="submit" class="anchorbutton btn-blue w-100" name="submit" value="Search Tests">
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<input type="submit" class="anchorbutton btn-blue" name="submit" value="Search Tests">
|
||||
</div>
|
||||
</form>
|
||||
{% endif %}
|
||||
|
||||
<table class="test-list stripes hoverable">
|
||||
{% for test in tests %}
|
||||
<tr>
|
||||
<td class="datestamp">{{test.creation|date:"U"}}</td>
|
||||
{% include "OpenBench/Blocks/testsummary.html" %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% if tests %}
|
||||
<section class="card">
|
||||
<header class="card-head">
|
||||
<h2 class="card-title">Results</h2>
|
||||
<span class="count">{{ tests|length }}</span>
|
||||
</header>
|
||||
<table class="test-list stripes hoverable">
|
||||
<thead>
|
||||
<tr class="table-header">
|
||||
<th>Date</th>
|
||||
<th>Author</th>
|
||||
<th>Engine</th>
|
||||
<th>Test</th>
|
||||
<th class="textcenter">Diff</th>
|
||||
<th>Time Control</th>
|
||||
<th>Result</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for test in tests %}
|
||||
<tr>
|
||||
<td class="datestamp col-date">{{test.creation|date:"U"}}</td>
|
||||
{% include "OpenBench/Blocks/testsummary.html" %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
@@ -27,6 +27,8 @@
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block page_head %}<div><h1 class="page-title">Upload Network</h1><p class="page-sub">Share a network file with the workers</p></div>{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<form method="post" enctype="multipart/form-data" id="network-form">
|
||||
@@ -56,6 +58,6 @@
|
||||
<input type="submit" class="anchorbutton btn-blue w-100" value="Upload">
|
||||
</div>
|
||||
</div>
|
||||
<form>
|
||||
</form>
|
||||
|
||||
{% endblock %}
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
{% load mytags %}
|
||||
|
||||
{% block page_head %}<div><h1 class="page-title">Users</h1><p class="page-sub">Contributors and approvers</p></div>{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<table class="hoverable">
|
||||
|
||||
@@ -4,195 +4,20 @@
|
||||
{% load static %}
|
||||
|
||||
{% block scripts %}
|
||||
<link rel="stylesheet" href="{% static 'workload.css' %}?{{ static_version }}">
|
||||
<script src="{% static 'copy_text.js' %}?{{ static_version }}"></script>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
var llrHistoryRequest = null;
|
||||
|
||||
function initializeLlrHistoryWidget(widget) {
|
||||
if (!widget || widget.dataset.initialized === 'true') return;
|
||||
|
||||
widget.dataset.initialized = 'true';
|
||||
|
||||
var history = JSON.parse(widget.dataset.history || '[]');
|
||||
if (!history.length) return;
|
||||
var realPoints = history.filter(function(point) { return !point.estimated; });
|
||||
var peakGames = {};
|
||||
|
||||
for (var r = 1; r < realPoints.length - 1; r++) {
|
||||
var prev = realPoints[r - 1];
|
||||
var curr = realPoints[r];
|
||||
var next = realPoints[r + 1];
|
||||
var isPeak = curr.llr > prev.llr && curr.llr > next.llr;
|
||||
var isValley = curr.llr < prev.llr && curr.llr < next.llr;
|
||||
|
||||
if (isPeak || isValley) {
|
||||
peakGames[curr.games] = true;
|
||||
}
|
||||
}
|
||||
|
||||
var svg = widget.querySelector('.llr-history-graph');
|
||||
var plot = widget.querySelector('.llr-history-plot');
|
||||
var hoverLine = widget.querySelector('.llr-hover-line');
|
||||
var hoverPoint = widget.querySelector('.llr-hover-point');
|
||||
var tooltip = widget.querySelector('.llr-history-tooltip');
|
||||
var viewBox = svg.viewBox.baseVal;
|
||||
|
||||
function clamp(value, min, max) {
|
||||
return Math.max(min, Math.min(max, value));
|
||||
}
|
||||
|
||||
function setActivePoint(point) {
|
||||
hoverLine.setAttribute('x1', point.x);
|
||||
hoverLine.setAttribute('x2', point.x);
|
||||
hoverPoint.setAttribute('cx', point.x);
|
||||
hoverPoint.setAttribute('cy', point.y);
|
||||
hoverPoint.classList.toggle('llr-hover-point-positive', point.llr >= 0);
|
||||
hoverPoint.classList.toggle('llr-hover-point-negative', point.llr < 0);
|
||||
|
||||
tooltip.textContent = point.games + ' games | LLR ' + (point.estimated ? '≈' : '') + point.llr.toFixed(2);
|
||||
tooltip.classList.add('active');
|
||||
|
||||
var left = clamp((point.x / viewBox.width) * plot.clientWidth + 8, 8, plot.clientWidth - tooltip.offsetWidth - 8);
|
||||
var top = clamp((point.y / viewBox.height) * svg.clientHeight - tooltip.offsetHeight - 8, 2, svg.clientHeight - tooltip.offsetHeight - 2);
|
||||
tooltip.style.left = left + 'px';
|
||||
tooltip.style.top = top + 'px';
|
||||
}
|
||||
|
||||
function clearActivePoint() {
|
||||
tooltip.classList.remove('active');
|
||||
hoverLine.classList.remove('active');
|
||||
hoverPoint.classList.remove('active', 'llr-hover-point-positive', 'llr-hover-point-negative');
|
||||
}
|
||||
|
||||
function nearestPoint(clientX) {
|
||||
var rect = svg.getBoundingClientRect();
|
||||
var localX = ((clientX - rect.left) / rect.width) * viewBox.width;
|
||||
var best = history[0];
|
||||
var bestDistance = Math.abs(best.x - localX);
|
||||
var bestPeak = null;
|
||||
var bestPeakDistance = Infinity;
|
||||
|
||||
for (var i = 0; i < history.length; i++) {
|
||||
var distance = Math.abs(history[i].x - localX);
|
||||
if (distance < bestDistance) {
|
||||
best = history[i];
|
||||
bestDistance = distance;
|
||||
}
|
||||
|
||||
if (!history[i].estimated && peakGames[history[i].games] && distance < bestPeakDistance) {
|
||||
bestPeak = history[i];
|
||||
bestPeakDistance = distance;
|
||||
}
|
||||
}
|
||||
|
||||
if (bestPeak && bestPeakDistance <= 5) {
|
||||
return bestPeak;
|
||||
}
|
||||
|
||||
return best;
|
||||
}
|
||||
|
||||
svg.addEventListener('mousemove', function(event) {
|
||||
setActivePoint(nearestPoint(event.clientX));
|
||||
hoverLine.classList.add('active');
|
||||
hoverPoint.classList.add('active');
|
||||
});
|
||||
|
||||
svg.addEventListener('mouseleave', function() {
|
||||
clearActivePoint();
|
||||
});
|
||||
|
||||
svg.addEventListener('mouseenter', function(event) {
|
||||
setActivePoint(nearestPoint(event.clientX));
|
||||
hoverLine.classList.add('active');
|
||||
hoverPoint.classList.add('active');
|
||||
});
|
||||
|
||||
clearActivePoint();
|
||||
}
|
||||
|
||||
function initializeLlrHistoryWidgets(root) {
|
||||
(root || document).querySelectorAll('.llr-history-widget').forEach(function(widget) {
|
||||
initializeLlrHistoryWidget(widget);
|
||||
});
|
||||
}
|
||||
|
||||
function ensureLlrHistoryWidget() {
|
||||
var existing = document.querySelector('.llr-history-widget');
|
||||
if (existing) {
|
||||
initializeLlrHistoryWidget(existing);
|
||||
return Promise.resolve(existing);
|
||||
}
|
||||
|
||||
var container = document.getElementById('llr-history-container');
|
||||
if (!container || !container.dataset.historyUrl) {
|
||||
return Promise.resolve(null);
|
||||
}
|
||||
|
||||
if (llrHistoryRequest) {
|
||||
return llrHistoryRequest;
|
||||
}
|
||||
|
||||
llrHistoryRequest = fetch(container.dataset.historyUrl, {
|
||||
credentials: 'same-origin'
|
||||
}).then(function(response) {
|
||||
if (!response.ok) {
|
||||
throw new Error('Unable to load history graph');
|
||||
}
|
||||
|
||||
return response.text();
|
||||
}).then(function(markup) {
|
||||
container.innerHTML = markup;
|
||||
container.removeAttribute('data-history-url');
|
||||
|
||||
var widget = container.querySelector('.llr-history-widget');
|
||||
initializeLlrHistoryWidget(widget);
|
||||
llrHistoryRequest = null;
|
||||
return widget;
|
||||
}).catch(function() {
|
||||
container.innerHTML = '<div class="llr-history-placeholder llr-history-placeholder-error">Unable to load history graph.</div>';
|
||||
llrHistoryRequest = null;
|
||||
return null;
|
||||
});
|
||||
|
||||
return llrHistoryRequest;
|
||||
}
|
||||
|
||||
function queueLlrHistoryWidgetLoad() {
|
||||
var container = document.getElementById('llr-history-container');
|
||||
if (!container || !container.dataset.historyUrl) return;
|
||||
|
||||
function requestGraphAfterPaint() {
|
||||
window.requestAnimationFrame(function() {
|
||||
window.requestAnimationFrame(function() {
|
||||
setTimeout(function() {
|
||||
ensureLlrHistoryWidget();
|
||||
}, 250);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
if (document.readyState === 'complete') {
|
||||
requestGraphAfterPaint();
|
||||
return;
|
||||
}
|
||||
|
||||
window.addEventListener('load', requestGraphAfterPaint, { once: true });
|
||||
}
|
||||
|
||||
initializeLlrHistoryWidgets(document);
|
||||
queueLlrHistoryWidgetLoad();
|
||||
});
|
||||
</script>
|
||||
<script src="{% static 'llr_history.js' %}?{{ static_version }}" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
{% block page_head %}<div><h1 class="page-title">{{ type|title }} #{{ workload.id }}</h1><p class="page-sub">{{ workload.dev.name|prettyName }} · by {{ workload.author|capfirst }}</p></div><div class="page-actions">{% if workload.deleted %}<span class="badge badge-muted">Deleted</span>{% elif workload.passed %}<span class="badge badge-ok">Passed</span>{% elif workload.failed %}<span class="badge badge-bad">Failed</span>{% elif workload.finished %}<span class="badge badge-info">Finished</span>{% elif not workload.approved %}<span class="badge badge-warn">Awaiting approval</span>{% else %}<span class="badge badge-info"><i class="fa-solid fa-circle-notch fa-spin"></i> Running</span>{% endif %}</div>{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="workload-container">
|
||||
|
||||
<div id="config" style="display: block; overflow-x: auto;">
|
||||
<table class="test-config left-align wrappable" style="table-layout: auto; width: 100%;">
|
||||
<div id="config" class="card">
|
||||
<header class="card-head"><h2 class="card-title">Configuration</h2></header>
|
||||
<table class="test-config left-align wrappable">
|
||||
|
||||
<tr><td class="td-label">Author</td><td>{{workload.author|capfirst}}</td></tr>
|
||||
<tr><td class="td-label">Creation</td><td class="timestamp">{{workload.creation|date:'U'}}</td></tr>
|
||||
@@ -244,52 +69,53 @@
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="actions" class="ml-3">
|
||||
<div id="actions" class="card">
|
||||
<header class="card-head"><h2 class="card-title">Actions</h2></header>
|
||||
|
||||
<!-- Dev vs Base [Git Diff Link] -->
|
||||
<h4><a href="{{workload|gitDiffLink}}">{{workload|git_diff_text}}</a></h4>
|
||||
<a class="diff-link" href="{{workload|gitDiffLink}}"><i class="fa-solid fa-code-compare fa-fw"></i> {{workload|git_diff_text}}</a>
|
||||
|
||||
<div class="anchor-container">
|
||||
|
||||
<!-- Approve Button: For Admins, or Cross-approvers -->
|
||||
{% if not workload.approved and profile.approver and profile.user.username != workload.author %}
|
||||
<a class="anchorbutton btn-blue" href="/{{type|lower}}/{{workload.id}}/APPROVE">Approve</a>
|
||||
<a class="anchorbutton btn-blue" href="/{{type|lower}}/{{workload.id}}/APPROVE"><i class="fa-solid fa-check fa-fw"></i> Approve</a>
|
||||
{% elif not workload.approved and request.user.is_superuser %}
|
||||
<a class="anchorbutton btn-blue" href="/{{type|lower}}/{{workload.id}}/APPROVE">Approve</a>
|
||||
<a class="anchorbutton btn-blue" href="/{{type|lower}}/{{workload.id}}/APPROVE"><i class="fa-solid fa-check fa-fw"></i> Approve</a>
|
||||
{% else %}
|
||||
<a class="anchorbutton btn-disabled">Approve</a>
|
||||
<span class="anchorbutton btn-disabled" aria-disabled="true"><i class="fa-solid fa-check fa-fw"></i> Approve</span>
|
||||
{% endif %}
|
||||
|
||||
<!-- Restart Button: For Approvers or Workload Authors of finished workloads -->
|
||||
{% if workload.finished and not workload.passed and not workload.failed and profile.approver %}
|
||||
<a class="anchorbutton btn-yellow" href="/{{type|lower}}/{{workload.id}}/RESTART">Restart</a>
|
||||
<a class="anchorbutton btn-yellow" href="/{{type|lower}}/{{workload.id}}/RESTART"><i class="fa-solid fa-rotate-right fa-fw"></i> Restart</a>
|
||||
{% elif workload.finished and not workload.passed and not workload.failed and profile.user.username == workload.author %}
|
||||
<a class="anchorbutton btn-yellow" href="/{{type|lower}}/{{workload.id}}/RESTART">Restart</a>
|
||||
<a class="anchorbutton btn-yellow" href="/{{type|lower}}/{{workload.id}}/RESTART"><i class="fa-solid fa-rotate-right fa-fw"></i> Restart</a>
|
||||
{% elif workload.finished %}
|
||||
<a class="anchorbutton btn-disabled">Restart</a>
|
||||
<span class="anchorbutton btn-disabled" aria-disabled="true"><i class="fa-solid fa-rotate-right fa-fw"></i> Restart</span>
|
||||
{% endif %}
|
||||
|
||||
<!-- Stop Button: For Approvers or Workload Authors of active workloads -->
|
||||
{% if not workload.finished and profile.approver %}
|
||||
<a class="anchorbutton btn-yellow" href="/{{type|lower}}/{{workload.id}}/STOP">Stop</a>
|
||||
<a class="anchorbutton btn-yellow" href="/{{type|lower}}/{{workload.id}}/STOP"><i class="fa-solid fa-stop fa-fw"></i> Stop</a>
|
||||
{% elif not workload.finished and profile.user.username == workload.author %}
|
||||
<a class="anchorbutton btn-yellow" href="/{{type|lower}}/{{workload.id}}/STOP">Stop</a>
|
||||
<a class="anchorbutton btn-yellow" href="/{{type|lower}}/{{workload.id}}/STOP"><i class="fa-solid fa-stop fa-fw"></i> Stop</a>
|
||||
{% elif not workload.finished %}
|
||||
<a class="anchorbutton btn-disabled">Stop</a>
|
||||
<span class="anchorbutton btn-disabled" aria-disabled="true"><i class="fa-solid fa-stop fa-fw"></i> Stop</span>
|
||||
{% endif %}
|
||||
|
||||
<!-- Delete/Restore Button: For Approvers or Workload Authors -->
|
||||
{% if profile.approver or profile.user.username == workload.author %}
|
||||
{% if workload.deleted %}
|
||||
<a class="anchorbutton btn-preset" href="/{{type|lower}}/{{workload.id}}/RESTORE">Restore</a>
|
||||
<a class="anchorbutton btn-preset" href="/{{type|lower}}/{{workload.id}}/RESTORE"><i class="fa-solid fa-rotate-left fa-fw"></i> Restore</a>
|
||||
{% else %}
|
||||
<a class="anchorbutton btn-red" href="/{{type|lower}}/{{workload.id}}/DELETE">Delete</a>
|
||||
<a class="anchorbutton btn-red" href="/{{type|lower}}/{{workload.id}}/DELETE"><i class="fa-solid fa-trash-can fa-fw"></i> Delete</a>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% if workload.deleted %}
|
||||
<a class="anchorbutton btn-disabled">Restore</a>
|
||||
<span class="anchorbutton btn-disabled" aria-disabled="true"><i class="fa-solid fa-rotate-left fa-fw"></i> Restore</span>
|
||||
{% else %}
|
||||
<a class="anchorbutton btn-disabled">Delete</a>
|
||||
<span class="anchorbutton btn-disabled" aria-disabled="true"><i class="fa-solid fa-trash-can fa-fw"></i> Delete</span>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
@@ -297,21 +123,21 @@
|
||||
<!-- Copy Button: Copy the current results statblock -->
|
||||
{% if type == "TEST" or type == "DATAGEN" %}
|
||||
<div class="anchor-container">
|
||||
<a class="mt-1 anchorbutton btn-blue" onclick="copy_text('long-statblock', true)">Copy Stat Block</a>
|
||||
<button type="button" class="mt-1 anchorbutton btn-start" onclick="copy_text('long-statblock', true)"><i class="fa-regular fa-copy fa-fw"></i> Copy Stat Block</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Copy Button (DC): Copy the current results statblock -->
|
||||
{% if type == "TEST" or type == "DATAGEN" %}
|
||||
<div class="anchor-container">
|
||||
<a class="mt-1 anchorbutton btn-blue" onclick="copy_text('long-statblock', true, true)">Copy Stat Block (DC Block)</a>
|
||||
<button type="button" class="mt-1 anchorbutton btn-start" onclick="copy_text('long-statblock', true, true)"><i class="fa-regular fa-copy fa-fw"></i> Copy Stat Block (DC Block)</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- PGN Download Button -->
|
||||
{% if workload.upload_pgns != "FALSE" %}
|
||||
<div class="anchor-container">
|
||||
<a class="mt-1 anchorbutton btn-blue" href="/api/pgns/{{workload.id}}/">Download PGN Archive</a>
|
||||
<a class="mt-1 anchorbutton btn-start" href="/api/pgns/{{workload.id}}/"><i class="fa-solid fa-download fa-fw"></i> Download PGN Archive</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
@@ -319,7 +145,7 @@
|
||||
{% if type == "TUNE" %}
|
||||
<div class="anchor-container">
|
||||
<pre id="spsa-input" style="display: none">{{workload|spsa_original_input}}</pre>
|
||||
<a class="mt-1 anchorbutton btn-blue" onclick="copy_text('spsa-input', false)">Copy SPSA Inputs</a>
|
||||
<button type="button" class="mt-1 anchorbutton btn-start" onclick="copy_text('spsa-input', false)"><i class="fa-regular fa-copy fa-fw"></i> Copy SPSA Inputs</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
@@ -327,11 +153,11 @@
|
||||
{% if type == "TUNE" %}
|
||||
<div class="anchor-container">
|
||||
<pre id="spsa-output" style="display: none">{{workload|spsa_optimal_values}}</pre>
|
||||
<a class="mt-1 anchorbutton btn-blue" onclick="copy_text('spsa-output', false)">Copy SPSA Outputs</a>
|
||||
<button type="button" class="mt-1 anchorbutton btn-start" onclick="copy_text('spsa-output', false)"><i class="fa-regular fa-copy fa-fw"></i> Copy SPSA Outputs</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Elo, (SPRT/LRR if SPRT, otherwise CONF), Games -->
|
||||
<!-- Elo, (SPRT/LLR if SPRT, otherwise CONF), Games -->
|
||||
{% if type == "TEST" %}
|
||||
<pre class="long-statblock" id="long-statblock">{{workload|longStatBlock|linebreaksbr}}</pre>
|
||||
{% elif type == "TUNE" %}
|
||||
@@ -340,8 +166,8 @@
|
||||
<pre class="long-statblock" id="long-statblock">{{workload|longStatBlock|linebreaksbr}}</pre>
|
||||
{% endif %}
|
||||
|
||||
<!-- Forum to modify the Priority, Throughput, or (Tests only) Workload Size -->
|
||||
<form method="POST" action="/{{type|lower}}/{{workload.id}}/MODIFY">
|
||||
<h3 class="section-label">Adjust</h3>
|
||||
<form class="modify-form" method="POST" action="/{{type|lower}}/{{workload.id}}/MODIFY">
|
||||
{% csrf_token %}
|
||||
<div class="form">
|
||||
<div class="col-full">
|
||||
@@ -373,27 +199,12 @@
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<!-- LLR history for SPRT tests: fetched lazily, and drawn by llr_history.js -->
|
||||
{% if workload.test_mode == "SPRT" %}
|
||||
<div class="llr-history-panel" title="LLR history over the lifetime of the test">
|
||||
<div class="llr-history-label">LLR History</div>
|
||||
<div id="llr-history-container" class="llr-history-loader" data-history-url="{{llr_history_endpoint}}">
|
||||
<div class="llr-history-chart">
|
||||
<div class="llr-history-yaxis">
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
</div>
|
||||
<div class="llr-history-main">
|
||||
<div class="llr-history-plot">
|
||||
<div class="llr-history-placeholder">Loading history graph...</div>
|
||||
</div>
|
||||
<div class="llr-history-xaxis">
|
||||
<div>0</div>
|
||||
<div></div>
|
||||
<div>{{workload.games}} g</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="llr-history-placeholder">Loading history graph...</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
@@ -401,7 +212,8 @@
|
||||
|
||||
<!-- SPSA Paramater Summary, for Tunes -->
|
||||
{% if type == "TUNE" %}
|
||||
<div id="parameters" class="w-100 mt-3" style="float:left;">
|
||||
<div id="parameters" class="card">
|
||||
<header class="card-head"><h2 class="card-title">SPSA Parameters</h2></header>
|
||||
<table class="stripes wrappable">
|
||||
|
||||
<tr class="table-header">
|
||||
@@ -419,24 +231,25 @@
|
||||
<td> {{ element }} </td>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
<tr>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div id="results" class="w-100 mt-3" style="float:left;">
|
||||
<div id="results" class="card">
|
||||
<header class="card-head"><h2 class="card-title">Results by Machine</h2></header>
|
||||
<table class="stripes wrappable">
|
||||
<tr class="table-header">
|
||||
<th>#</th>
|
||||
<th>User</th>
|
||||
<th>Updated</th>
|
||||
<th style="width: 45px">Games</th>
|
||||
<th style="width: 45px">Won</th>
|
||||
<th style="width: 45px">Lost</th>
|
||||
<th style="width: 45px">Drawn</th>
|
||||
<th style="width: 45px">Time</th>
|
||||
<th style="width: 45px">Crash</th>
|
||||
<th class="numeric">Games</th>
|
||||
<th class="numeric">Won</th>
|
||||
<th class="numeric">Lost</th>
|
||||
<th class="numeric">Drawn</th>
|
||||
<th class="numeric">Time</th>
|
||||
<th class="numeric">Crash</th>
|
||||
</tr>
|
||||
|
||||
{% for result in results %}
|
||||
|
||||
Reference in new issue
Block a user