Spaces:
Running
Running
Upload hub_dashboard.html
Browse files- hub_dashboard.html +17 -13
hub_dashboard.html
CHANGED
|
@@ -3762,20 +3762,24 @@ setInterval(function(){
|
|
| 3762 |
let _lastLogTs = null;
|
| 3763 |
let _prevLoss = null;
|
| 3764 |
|
| 3765 |
-
// Parse "key=value | key=value" pairs
|
| 3766 |
function renderKVPairs(msg) {
|
| 3767 |
-
|
| 3768 |
-
if (!msg.includes('=')) return `<span style="color:var(--t0)">${escHtml(msg)}</span>`;
|
| 3769 |
const parts = msg.split('|').map(s => s.trim()).filter(Boolean);
|
| 3770 |
-
|
|
|
|
| 3771 |
const eq = part.indexOf('=');
|
| 3772 |
-
if (eq === -1) return `<span style="color:var(--t2)">${escHtml(part)}</span>`;
|
| 3773 |
const key = part.slice(0, eq).trim();
|
| 3774 |
const val = part.slice(eq + 1).trim();
|
| 3775 |
-
|
| 3776 |
-
|
| 3777 |
-
|
| 3778 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3779 |
}
|
| 3780 |
|
| 3781 |
// Format a log entry into a coloured terminal line
|
|
@@ -3806,10 +3810,10 @@ setInterval(function(){
|
|
| 3806 |
const catLabel = cat || lvl;
|
| 3807 |
const rendered = renderKVPairs(msg);
|
| 3808 |
|
| 3809 |
-
return `<div class="${lineClass}" style="display:flex;align-items:
|
| 3810 |
-
`<span class="tlog-ts" style="flex-shrink:0;width:70px;font-size:0.
|
| 3811 |
-
`<span style="flex-shrink:0;margin-right:
|
| 3812 |
-
`<span style="flex:1;min-width:0;display:flex;align-items:
|
| 3813 |
`</div>`;
|
| 3814 |
}
|
| 3815 |
|
|
|
|
| 3762 |
let _lastLogTs = null;
|
| 3763 |
let _prevLoss = null;
|
| 3764 |
|
| 3765 |
+
// Parse "key=value | key=value" pairs — render as evenly-spaced columns filling the full row
|
| 3766 |
function renderKVPairs(msg) {
|
| 3767 |
+
if (!msg.includes('=')) return `<span style="color:var(--t0);flex:1">${escHtml(msg)}</span>`;
|
|
|
|
| 3768 |
const parts = msg.split('|').map(s => s.trim()).filter(Boolean);
|
| 3769 |
+
if (!parts.length) return `<span style="color:var(--t0);flex:1">${escHtml(msg)}</span>`;
|
| 3770 |
+
return parts.map((part, i) => {
|
| 3771 |
const eq = part.indexOf('=');
|
| 3772 |
+
if (eq === -1) return `<span style="flex:1;text-align:center;color:var(--t2)">${escHtml(part)}</span>`;
|
| 3773 |
const key = part.slice(0, eq).trim();
|
| 3774 |
const val = part.slice(eq + 1).trim();
|
| 3775 |
+
const sep = i < parts.length - 1
|
| 3776 |
+
? `<span style="width:1px;background:rgba(255,255,255,0.07);align-self:stretch;flex-shrink:0;margin:6px 0"></span>`
|
| 3777 |
+
: '';
|
| 3778 |
+
return `<span style="flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;padding:3px 8px">` +
|
| 3779 |
+
`<span style="color:var(--t3);font-size:0.58rem;letter-spacing:0.14em;text-transform:uppercase">${escHtml(key)}</span>` +
|
| 3780 |
+
`<span style="color:var(--t0);font-weight:700;font-size:0.82rem;font-variant-numeric:tabular-nums">${escHtml(val)}</span>` +
|
| 3781 |
+
`</span>${sep}`;
|
| 3782 |
+
}).join('');
|
| 3783 |
}
|
| 3784 |
|
| 3785 |
// Format a log entry into a coloured terminal line
|
|
|
|
| 3810 |
const catLabel = cat || lvl;
|
| 3811 |
const rendered = renderKVPairs(msg);
|
| 3812 |
|
| 3813 |
+
return `<div class="${lineClass}" style="display:flex;align-items:stretch;gap:0;padding:6px 24px;border-bottom:1px solid rgba(255,255,255,0.04);transition:background 0.15s ease" onmouseover="this.style.background='rgba(255,255,255,0.025)'" onmouseout="this.style.background=''">`+
|
| 3814 |
+
`<span class="tlog-ts" style="flex-shrink:0;width:70px;font-size:0.68rem;opacity:0.5;font-variant-numeric:tabular-nums;display:flex;align-items:center">${ts}</span>`+
|
| 3815 |
+
`<span style="flex-shrink:0;margin-right:20px;padding:2px 8px;border-radius:4px;background:${catBg};color:${catCol};font-size:0.58rem;font-weight:800;letter-spacing:0.12em;text-transform:uppercase;display:flex;align-items:center">${escHtml(catLabel)}</span>`+
|
| 3816 |
+
`<span style="flex:1;min-width:0;display:flex;align-items:stretch;flex-wrap:nowrap">${rendered}</span>`+
|
| 3817 |
`</div>`;
|
| 3818 |
}
|
| 3819 |
|