Fix perf dashboard date card to fit single line

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
John Mizerek 2026-01-30 18:09:58 -08:00
parent cf1c6497ca
commit e92b2a4833

View file

@ -30,6 +30,7 @@ if (remoteAddr != "127.0.0.1" && remoteAddr != "::1" && remoteAddr != "0:0:0:0:0
.card .label { font-size: 11px; color: #8b949e; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.card .value { font-size: 28px; font-weight: 700; color: #fff; }
.card .unit { font-size: 13px; color: #8b949e; font-weight: 400; }
.card .value-sm { font-size: 18px; font-weight: 700; color: #fff; }
.section { margin-bottom: 28px; }
.section h2 { font-size: 15px; font-weight: 600; margin-bottom: 10px; color: #c9d1d9; display: flex; align-items: center; gap: 8px; }
@ -133,7 +134,7 @@ function fmtDate(s) {
if (!s || s === 'none') return 'none';
var d = new Date(s.replace(' ', 'T'));
if (isNaN(d)) return s;
return d.toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric' }) + ' ' + d.toLocaleTimeString('en-US', { hour: 'numeric', minute: '2-digit', hour12: true });
return d.toLocaleDateString('en-US', { month: 'short', day: 'numeric' }) + ', ' + d.toLocaleTimeString('en-US', { hour: 'numeric', minute: '2-digit', hour12: true });
}
function fmtMs(n) {
if (n == null) return '-';
@ -197,7 +198,7 @@ async function loadAll() {
card('Avg DB Time', s.OverallAvgDbMs || 0, 'ms') +
card('Avg App Time', s.OverallAvgAppMs || 0, 'ms') +
card('Avg Queries', s.OverallAvgQueries || 0, '/req') +
card('Data Since', fmtDate(s.FirstLog), '');
cardSm('Data Since', fmtDate(s.FirstLog));
qs('#summarySection').style.display = '';
// Count table
@ -221,6 +222,9 @@ async function loadAll() {
function card(label, value, unit) {
return '<div class="card"><div class="label">' + label + '</div><div class="value">' + value + ' <span class="unit">' + unit + '</span></div></div>';
}
function cardSm(label, value) {
return '<div class="card"><div class="label">' + label + '</div><div class="value-sm">' + value + '</div></div>';
}
function renderCountTable(data) {
if (!data.length) { qs('#countSection').style.display = 'none'; return; }