v0.2.4 - Hotfix: Unknown status + copy UX + update banner context
Bug fix: - config.py: empty PARAKEET_CONTAINER / MAGPIE_CONTAINER env vars (from migrating to v0.2.0+ where the field is optional and saved as '') now fall back to 'parakeet-asr' / 'magpie-tts' via the 'or' idiom. Confirmed live: services classify as 'running' instead of 'unknown'. UX: - Replaced text 'Copy' buttons with compact icon buttons (clipboard SVG) - Endpoint Base URL + Model ID + curl snippet are now click-to-copy themselves (the value AND a separate icon button) - Service cards: host, base URL, and model are now three separate copyable rows - Update banner: leading explanatory line — 'Updates to eugr/spark-vllm-docker — the upstream project that orchestrates vLLM on your Sparks. These are not firmware, OS, or model updates.' with a link to the repo.
This commit is contained in:
+2
-2
@@ -55,10 +55,10 @@ class Settings:
|
||||
spark2_user=spark2_user,
|
||||
parakeet_host=_env("PARAKEET_HOST") or spark2_host,
|
||||
parakeet_user=_env("PARAKEET_USER") or spark2_user,
|
||||
parakeet_container=_env("PARAKEET_CONTAINER", "parakeet-asr"),
|
||||
parakeet_container=_env("PARAKEET_CONTAINER") or "parakeet-asr",
|
||||
magpie_host=_env("MAGPIE_HOST") or spark2_host,
|
||||
magpie_user=_env("MAGPIE_USER") or spark2_user,
|
||||
magpie_container=_env("MAGPIE_CONTAINER", "magpie-tts"),
|
||||
magpie_container=_env("MAGPIE_CONTAINER") or "magpie-tts",
|
||||
ssh_key_path=_env("SSH_KEY_PATH"),
|
||||
ssh_known_hosts=_env("SSH_KNOWN_HOSTS"),
|
||||
models_yaml=_resolve_models_yaml(),
|
||||
|
||||
+48
-23
@@ -143,11 +143,16 @@ async function renderServices() {
|
||||
if (action === 'stop' && cls !== 'running' && cls !== 'starting' && cls !== 'unhealthy') return true;
|
||||
return false;
|
||||
};
|
||||
const copyIcon = `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg>`;
|
||||
const hostStr = s.host ? `${s.host}:${s.port}` : '';
|
||||
const hostRow = s.host
|
||||
? `<div class="row"><span class="k">Host</span><span class="v">${escapeHtml(s.host)}:${s.port}</span></div>`
|
||||
? `<div class="row"><span class="k">Host</span><span class="v copyable" data-copy-self title="Click to copy">${escapeHtml(hostStr)}</span><button class="icon-btn" data-copy-text="${escapeHtml(hostStr)}" title="Copy host" aria-label="Copy">${copyIcon}</button></div>`
|
||||
: `<div class="row"><span class="k">Host</span><span class="v muted-v">not configured</span></div>`;
|
||||
const urlRow = s.base_url
|
||||
? `<div class="row"><span class="k">URL</span><span class="v copyable" data-copy-self title="Click to copy">${escapeHtml(s.base_url)}</span><button class="icon-btn" data-copy-text="${escapeHtml(s.base_url)}" title="Copy URL" aria-label="Copy">${copyIcon}</button></div>`
|
||||
: '';
|
||||
const modelRow = s.model
|
||||
? `<div class="row"><span class="k">Model</span><span class="v">${escapeHtml(s.model)}</span></div>`
|
||||
? `<div class="row"><span class="k">Model</span><span class="v copyable" data-copy-self title="Click to copy">${escapeHtml(s.model)}</span><button class="icon-btn" data-copy-text="${escapeHtml(s.model)}" title="Copy model" aria-label="Copy">${copyIcon}</button></div>`
|
||||
: '';
|
||||
const restartsRow = s.restart_count != null && s.restart_count > 1
|
||||
? `<div class="row"><span class="k">Restarts</span><span class="v">${s.restart_count}</span></div>`
|
||||
@@ -159,6 +164,7 @@ async function renderServices() {
|
||||
<span class="status">${statusLabel(cls)}</span>
|
||||
</div>
|
||||
${hostRow}
|
||||
${urlRow}
|
||||
${modelRow}
|
||||
${restartsRow}
|
||||
<div class="service-actions">
|
||||
@@ -212,31 +218,50 @@ function renderEndpoint(status) {
|
||||
el('#ep-curl-snippet').textContent = snippet;
|
||||
}
|
||||
|
||||
function setupCopyButtons() {
|
||||
document.body.addEventListener('click', async (e) => {
|
||||
const btn = e.target.closest('.copy-btn');
|
||||
if (!btn) return;
|
||||
const targetSel = btn.dataset.copy;
|
||||
if (!targetSel) return;
|
||||
const target = el(targetSel);
|
||||
if (!target) return;
|
||||
const text = target.textContent;
|
||||
try {
|
||||
await navigator.clipboard.writeText(text);
|
||||
const original = btn.textContent;
|
||||
btn.classList.add('copied');
|
||||
btn.textContent = 'Copied';
|
||||
setTimeout(() => {
|
||||
btn.classList.remove('copied');
|
||||
btn.textContent = original;
|
||||
}, 1400);
|
||||
} catch {
|
||||
// Clipboard API may fail over plain HTTP; fall back to selection
|
||||
async function copyText(text, indicatorEl) {
|
||||
try {
|
||||
await navigator.clipboard.writeText(text);
|
||||
if (indicatorEl) {
|
||||
indicatorEl.classList.add('copied');
|
||||
setTimeout(() => indicatorEl.classList.remove('copied'), 1200);
|
||||
}
|
||||
return true;
|
||||
} catch {
|
||||
// Plain HTTP fallback: select the text so the user can ⌘C
|
||||
if (indicatorEl) {
|
||||
const range = document.createRange();
|
||||
range.selectNode(target);
|
||||
range.selectNode(indicatorEl);
|
||||
window.getSelection().removeAllRanges();
|
||||
window.getSelection().addRange(range);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function setupCopyButtons() {
|
||||
document.body.addEventListener('click', async (e) => {
|
||||
// Inline icon copy with literal text (used for dynamically-rendered service rows)
|
||||
const litBtn = e.target.closest('[data-copy-text]');
|
||||
if (litBtn) {
|
||||
await copyText(litBtn.dataset.copyText, litBtn);
|
||||
return;
|
||||
}
|
||||
// Copy buttons (with svg icon) referenced by data-copy="selector"
|
||||
const btn = e.target.closest('[data-copy]');
|
||||
if (btn) {
|
||||
const target = el(btn.dataset.copy);
|
||||
if (target) {
|
||||
await copyText(target.textContent, btn);
|
||||
target.classList.add('copied');
|
||||
setTimeout(() => target.classList.remove('copied'), 1200);
|
||||
}
|
||||
return;
|
||||
}
|
||||
// Self-copy: clicking the text itself
|
||||
const selfCopy = e.target.closest('[data-copy-self]');
|
||||
if (selfCopy) {
|
||||
await copyText(selfCopy.textContent, selfCopy);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -28,18 +28,24 @@
|
||||
<div class="ep-title muted small">OpenAI-compatible endpoint</div>
|
||||
<div class="ep-row">
|
||||
<span class="ep-label">Base URL</span>
|
||||
<code class="ep-value" id="ep-url">—</code>
|
||||
<button class="copy-btn" data-copy="#ep-url" title="Copy base URL">Copy</button>
|
||||
<code class="ep-value copyable" id="ep-url" data-copy-self title="Click to copy">—</code>
|
||||
<button class="icon-btn" data-copy="#ep-url" title="Copy base URL" aria-label="Copy">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg>
|
||||
</button>
|
||||
</div>
|
||||
<div class="ep-row">
|
||||
<span class="ep-label">Model ID</span>
|
||||
<code class="ep-value" id="ep-model">—</code>
|
||||
<button class="copy-btn" data-copy="#ep-model" title="Copy model ID">Copy</button>
|
||||
<code class="ep-value copyable" id="ep-model" data-copy-self title="Click to copy">—</code>
|
||||
<button class="icon-btn" data-copy="#ep-model" title="Copy model ID" aria-label="Copy">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg>
|
||||
</button>
|
||||
</div>
|
||||
<details class="ep-curl">
|
||||
<summary class="muted small">curl example</summary>
|
||||
<pre id="ep-curl-snippet" class="snippet"></pre>
|
||||
<button class="copy-btn small" data-copy="#ep-curl-snippet">Copy snippet</button>
|
||||
<pre id="ep-curl-snippet" class="snippet copyable" data-copy-self title="Click to copy"></pre>
|
||||
<button class="icon-btn" data-copy="#ep-curl-snippet" title="Copy snippet" aria-label="Copy">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg>
|
||||
</button>
|
||||
</details>
|
||||
</section>
|
||||
|
||||
@@ -165,6 +171,10 @@
|
||||
</section>
|
||||
|
||||
<section id="update-banner" class="update-banner hidden">
|
||||
<div class="ub-context muted small">
|
||||
Updates to <strong><a href="https://github.com/eugr/spark-vllm-docker" target="_blank" rel="noopener">eugr/spark-vllm-docker</a></strong>
|
||||
— the upstream project that orchestrates vLLM on your Sparks (launch-cluster.sh, recipes, mods). These are <em>not</em> firmware, OS, or model updates.
|
||||
</div>
|
||||
<div class="ub-row">
|
||||
<span id="ub-text">Checking for updates…</span>
|
||||
<span class="spacer"></span>
|
||||
|
||||
@@ -97,7 +97,8 @@ main {
|
||||
overflow-x: auto;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.copy-btn {
|
||||
.copy-btn,
|
||||
.icon-btn {
|
||||
appearance: none;
|
||||
background: var(--surface-2);
|
||||
border: 1px solid var(--border);
|
||||
@@ -108,15 +109,27 @@ main {
|
||||
cursor: pointer;
|
||||
transition: color 0.15s, border-color 0.15s, background 0.15s;
|
||||
flex-shrink: 0;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.copy-btn:hover { color: var(--text); border-color: #34343c; }
|
||||
.copy-btn.copied {
|
||||
.icon-btn { padding: 5px 7px; }
|
||||
.icon-btn svg { width: 14px; height: 14px; display: block; }
|
||||
.copy-btn:hover,
|
||||
.icon-btn:hover { color: var(--text); border-color: #34343c; }
|
||||
.copy-btn.copied,
|
||||
.icon-btn.copied {
|
||||
color: var(--accent);
|
||||
border-color: rgba(74, 222, 128, 0.4);
|
||||
background: rgba(74, 222, 128, 0.08);
|
||||
}
|
||||
.icon-btn.copied svg { color: var(--accent); }
|
||||
.copy-btn.small { padding: 3px 8px; font-size: 11px; }
|
||||
|
||||
.copyable { cursor: pointer; }
|
||||
.copyable:hover { outline: 1px solid rgba(96, 165, 250, 0.5); }
|
||||
.copyable.copied { outline: 1px solid var(--accent); background: rgba(74, 222, 128, 0.05); }
|
||||
|
||||
.ep-curl { margin-top: 8px; }
|
||||
.ep-curl summary { cursor: pointer; padding: 4px 0; }
|
||||
.ep-curl[open] summary { margin-bottom: 6px; }
|
||||
@@ -274,10 +287,14 @@ main {
|
||||
background: var(--surface);
|
||||
border: 1px solid rgba(96, 165, 250, 0.4);
|
||||
border-radius: var(--radius);
|
||||
padding: 10px 14px;
|
||||
padding: 12px 14px;
|
||||
margin-top: 18px;
|
||||
font-size: 13px;
|
||||
}
|
||||
.ub-context { margin-bottom: 8px; line-height: 1.5; }
|
||||
.ub-context a { color: var(--info); text-decoration: none; }
|
||||
.ub-context a:hover { text-decoration: underline; }
|
||||
.ub-context em { font-style: normal; color: var(--text); font-weight: 500; }
|
||||
.update-banner.up-to-date {
|
||||
border-color: var(--border);
|
||||
color: var(--muted);
|
||||
@@ -409,13 +426,25 @@ main {
|
||||
|
||||
.service-card .row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 12px;
|
||||
color: var(--muted);
|
||||
gap: 6px;
|
||||
}
|
||||
.service-card .row .k { width: 60px; flex-shrink: 0; }
|
||||
.service-card .row .v { color: var(--text); font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace; word-break: break-all; }
|
||||
.service-card .row .v {
|
||||
color: var(--text);
|
||||
font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
|
||||
word-break: break-all;
|
||||
flex: 1;
|
||||
padding: 2px 4px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.service-card .row .v.muted-v { color: var(--muted); font-family: inherit; }
|
||||
.service-card .row .v.copyable:hover { outline: 1px solid rgba(96, 165, 250, 0.5); }
|
||||
.service-card .row .v.copyable.copied { outline: 1px solid var(--accent); background: rgba(74, 222, 128, 0.05); }
|
||||
.service-card .row .icon-btn { padding: 3px 6px; }
|
||||
.service-card .row .icon-btn svg { width: 12px; height: 12px; }
|
||||
|
||||
.service-actions {
|
||||
display: flex;
|
||||
|
||||
Reference in New Issue
Block a user