Files
spark-control/image/app/static/style.css
T
Grant 27699a2469 v0.2.0 - Always-on services panel with per-service host config
Dashboard:
- New 'Always-on services' section with cards for Parakeet and Magpie
- Each card: host:port, model loaded, status pill (Healthy/Unhealthy/Starting/Not configured)
- Start, Restart, Stop buttons. Buttons disabled when not applicable for current state
- Restart counter shown when > 1 (would have surfaced the old magpie crash loop)

Backend:
- New /api/services GET: docker container state + http health for each support service
- New POST /api/services/{name}/{action} for start | stop | restart
- services.py module: docker_state, run_action via SSH
- config.py: PARAKEET_HOST/USER/CONTAINER and MAGPIE_* env vars, default to spark2_*
- health.py: use per-service hosts (no longer hard-wired to spark2_host)

Package:
- sparkConfig.yaml.ts: add 6 new optional fields
- configureSparks action: optional 'Parakeet host', 'Parakeet container', 'Magpie host', 'Magpie container' fields; descriptions explain they default to Spark 2 when blank
- Handler normalizes nulls to empty strings before merge
- main.ts: pass new env vars to container
- bump to 0.2.0:0
2026-05-12 11:21:15 -05:00

377 lines
9.9 KiB
CSS

:root {
--bg: #0a0a0d;
--surface: #15151a;
--surface-2: #1c1c22;
--border: #25252c;
--text: #e6e6ea;
--muted: #7e7e8a;
--accent: #4ade80;
--warn: #f59e0b;
--error: #ef4444;
--info: #60a5fa;
--radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
background: var(--bg);
color: var(--text);
font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
min-height: 100vh;
-webkit-font-smoothing: antialiased;
}
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }
.spacer { flex: 1; }
.topbar {
position: sticky;
top: 0;
background: rgba(10, 10, 13, 0.85);
backdrop-filter: saturate(160%) blur(10px);
-webkit-backdrop-filter: saturate(160%) blur(10px);
border-bottom: 1px solid var(--border);
display: flex;
align-items: center;
gap: 16px;
padding: 12px 20px;
z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.logo-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.current { flex: 1; text-align: right; font-size: 14px; }
.current strong { color: var(--accent); }
main {
max-width: 880px;
margin: 0 auto;
padding: 24px 20px 80px;
}
.banner {
background: var(--surface);
border: 1px solid var(--warn);
color: var(--warn);
padding: 12px 16px;
border-radius: var(--radius);
margin-bottom: 16px;
font-size: 14px;
}
.banner em { font-style: normal; background: rgba(245, 158, 11, 0.15); padding: 2px 6px; border-radius: 4px; }
/* ===== Endpoint panel ===== */
.endpoint-panel {
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 12px 16px;
margin-bottom: 16px;
}
.ep-title { margin-bottom: 8px; letter-spacing: 0.05em; text-transform: uppercase; }
.ep-row {
display: flex;
align-items: center;
gap: 10px;
padding: 6px 0;
}
.ep-row + .ep-row { border-top: 1px solid var(--border); }
.ep-label {
color: var(--muted);
font-size: 12px;
min-width: 78px;
flex-shrink: 0;
}
.ep-value {
flex: 1;
font: 13px/1.4 ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
background: var(--surface-2);
padding: 4px 8px;
border-radius: 5px;
border: 1px solid var(--border);
color: var(--text);
overflow-x: auto;
white-space: nowrap;
}
.copy-btn {
appearance: none;
background: var(--surface-2);
border: 1px solid var(--border);
color: var(--muted);
padding: 4px 10px;
border-radius: 5px;
font: 12px/1 inherit;
cursor: pointer;
transition: color 0.15s, border-color 0.15s, background 0.15s;
flex-shrink: 0;
}
.copy-btn:hover { color: var(--text); border-color: #34343c; }
.copy-btn.copied {
color: var(--accent);
border-color: rgba(74, 222, 128, 0.4);
background: rgba(74, 222, 128, 0.08);
}
.copy-btn.small { padding: 3px 8px; font-size: 11px; }
.ep-curl { margin-top: 8px; }
.ep-curl summary { cursor: pointer; padding: 4px 0; }
.ep-curl[open] summary { margin-bottom: 6px; }
.snippet {
background: #08080b;
border: 1px solid var(--border);
border-radius: 6px;
padding: 10px 12px;
margin: 0 0 8px;
font: 12px/1.55 ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
color: #c7c7d1;
max-height: 200px;
overflow: auto;
white-space: pre-wrap;
word-break: break-word;
}
/* ===== Swap panel ===== */
.swap-panel {
background: var(--surface);
border: 1px solid var(--info);
border-radius: var(--radius);
padding: 16px 18px;
margin-bottom: 20px;
}
.swap-header { display: flex; align-items: center; gap: 12px; }
.swap-header #swap-title { font-weight: 600; color: var(--info); }
.timer {
font: 14px/1 ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
background: var(--surface-2);
border: 1px solid var(--border);
padding: 5px 10px;
border-radius: 6px;
color: var(--text);
letter-spacing: 0.04em;
}
.spinner {
width: 14px; height: 14px;
border: 2px solid var(--info);
border-right-color: transparent;
border-radius: 50%;
animation: spin 0.8s linear infinite;
flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }
.phase-row {
display: flex;
align-items: baseline;
gap: 10px;
margin-top: 14px;
}
.phase {
font-size: 16px;
font-weight: 500;
color: var(--text);
}
.phase-detail { font-size: 13px; }
.phase-track {
margin-top: 10px;
height: 6px;
background: var(--surface-2);
border-radius: 3px;
overflow: hidden;
}
.phase-fill {
height: 100%;
width: 2%;
background: linear-gradient(90deg, var(--info), var(--accent));
border-radius: 3px;
transition: width 0.5s ease-out;
}
#swap-log-details {
margin-top: 14px;
}
#swap-log-details summary {
cursor: pointer;
user-select: none;
padding: 2px 0;
}
#swap-log-details summary:hover { color: var(--text); }
#swap-log-details[open] summary { margin-bottom: 8px; }
.log {
background: #08080b;
border: 1px solid var(--border);
border-radius: 6px;
padding: 10px 12px;
margin: 0;
font: 12px/1.55 ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
color: #c7c7d1;
max-height: 260px;
overflow: auto;
white-space: pre-wrap;
word-break: break-word;
}
/* ===== Section titles ===== */
.section-title {
font-size: 13px;
font-weight: 500;
color: var(--muted);
margin: 24px 0 12px;
letter-spacing: 0.06em;
text-transform: uppercase;
}
.section-title:first-child { margin-top: 0; }
/* ===== Services panel ===== */
.services-grid {
display: grid;
gap: 14px;
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.service-card {
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 14px 16px;
display: flex;
flex-direction: column;
gap: 10px;
}
.service-card.running { border-color: rgba(74, 222, 128, 0.45); }
.service-card.unhealthy { border-color: rgba(239, 68, 68, 0.55); }
.service-card.missing,
.service-card.unconfigured { border-color: rgba(245, 158, 11, 0.45); }
.service-card .head {
display: flex;
align-items: center;
gap: 8px;
}
.service-card .head .name { font-weight: 600; font-size: 15px; }
.service-card .head .kind { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.service-card .head .status {
margin-left: auto;
font-size: 12px;
padding: 2px 8px;
border-radius: 999px;
background: var(--surface-2);
border: 1px solid var(--border);
color: var(--muted);
}
.service-card.running .status { color: var(--accent); border-color: rgba(74, 222, 128, 0.4); }
.service-card.unhealthy .status { color: var(--error); border-color: rgba(239, 68, 68, 0.4); }
.service-card.missing .status,
.service-card.unconfigured .status { color: var(--warn); border-color: rgba(245, 158, 11, 0.4); }
.service-card .row {
display: flex;
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.muted-v { color: var(--muted); font-family: inherit; }
.service-actions {
display: flex;
gap: 6px;
margin-top: 4px;
}
.service-actions .btn { padding: 6px 12px; font-size: 12px; flex: 1; }
.service-actions .btn.danger { color: var(--error); border-color: rgba(239, 68, 68, 0.3); }
.service-actions .btn.danger:hover:not(:disabled) { background: rgba(239, 68, 68, 0.08); border-color: var(--error); }
/* ===== Cards ===== */
.cards {
display: grid;
gap: 14px;
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.card {
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 16px;
display: flex;
flex-direction: column;
gap: 12px;
transition: border-color 0.15s, transform 0.15s;
}
.card.active {
border-color: var(--accent);
box-shadow: 0 0 0 1px var(--accent) inset, 0 0 24px rgba(74, 222, 128, 0.08);
}
.card .name { font-weight: 600; font-size: 15px; }
.card .meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; color: var(--muted); }
.card .desc {
font-size: 13.5px;
line-height: 1.5;
color: #b9b9c4;
}
.card .repo {
word-break: break-all;
font-size: 11px;
color: #5c5c66;
}
.tag {
background: var(--surface-2);
border: 1px solid var(--border);
padding: 2px 8px;
border-radius: 999px;
font-size: 11px;
}
.tag.mode-cluster { color: var(--info); border-color: rgba(96, 165, 250, 0.4); }
.tag.mode-solo { color: var(--accent); border-color: rgba(74, 222, 128, 0.4); }
.tag.cap { color: var(--muted); }
.btn {
appearance: none;
border: 1px solid var(--border);
background: var(--surface-2);
color: var(--text);
padding: 8px 14px;
border-radius: 8px;
cursor: pointer;
font: inherit;
font-weight: 500;
transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}
.btn:hover:not(:disabled) { background: #24242c; border-color: #34343c; }
.btn.primary { background: var(--accent); color: #052e16; border-color: var(--accent); }
.btn.primary:hover:not(:disabled) { background: #6ee19a; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.card.active .btn { background: rgba(74, 222, 128, 0.12); color: var(--accent); border-color: rgba(74, 222, 128, 0.4); }
.footer {
margin-top: 28px;
padding-top: 16px;
border-top: 1px solid var(--border);
display: flex;
align-items: center;
gap: 14px;
flex-wrap: wrap;
}
.health { display: flex; gap: 14px; flex-wrap: wrap; }
.health-item { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); display: inline-block; }
.dot.ok { background: var(--accent); box-shadow: 0 0 8px rgba(74, 222, 128, 0.7); }
.dot.bad { background: var(--error); box-shadow: 0 0 8px rgba(239, 68, 68, 0.7); }
.dot.warn { background: var(--warn); }
@media (max-width: 640px) {
.topbar { padding: 10px 14px; }
main { padding: 16px 14px 80px; }
.cards { grid-template-columns: 1fr; }
}