somratpro commited on
Commit
d1ca953
·
1 Parent(s): 06fe1a1

refactor: remove mini-grid and secondary panels from dashboard and update hero-action styling

Browse files
Files changed (1) hide show
  1. health-server.js +5 -24
health-server.js CHANGED
@@ -360,11 +360,7 @@ function renderDashboard(data) {
360
  ? "Cloudflare keep-awake Worker is pending or failed; check Space logs."
361
  : "Add CLOUDFLARE_WORKERS_TOKEN to create a scheduled keep-awake Worker.";
362
  const serviceOk = data.gateway && data.dashboard;
363
- const topCards = [
364
- `<div class="mini-card"><span class="mini-label">Service</span>${toneBadge(serviceOk ? "Running" : "Starting", serviceOk ? "ok" : "warn")}</div>`,
365
- `<div class="mini-card"><span class="mini-label">Uptime</span><strong>${escapeHtml(data.uptime)}</strong></div>`,
366
- `<div class="mini-card"><span class="mini-label">Backup</span>${toneBadge(syncStatus.toUpperCase(), syncTone)}</div>`,
367
- ].join("");
368
  const tiles = [
369
  renderTile({
370
  title: "Gateway",
@@ -424,12 +420,8 @@ function renderDashboard(data) {
424
  header { text-align:center; margin-bottom:22px; }
425
  h1 { margin:0; font-size:1.65rem; line-height:1; letter-spacing:0; }
426
  .subtitle { margin-top:12px; color:var(--muted); font-size:.72rem; text-transform:uppercase; letter-spacing:.14em; font-weight:800; }
427
- .hero-action { display:flex; width:100%; min-height:46px; align-items:center; justify-content:center; border-radius:8px; background:var(--accent); color:#fff; text-decoration:none; font-weight:850; font-size:.98rem; margin:24px 0 20px; }
428
- .hero-action:hover { background:var(--accent2); }
429
- .mini-grid { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:10px; margin-bottom:18px; }
430
- .mini-card { min-height:68px; border:1px solid var(--line); background:var(--panel); border-radius:8px; padding:13px; display:flex; flex-direction:column; justify-content:center; gap:9px; }
431
- .mini-label { color:var(--muted); font-size:.66rem; letter-spacing:.16em; text-transform:uppercase; font-weight:850; }
432
- .mini-card strong { font-size:1.02rem; }
433
  .overview { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:10px; margin-bottom:10px; }
434
  .tile { border:1px solid var(--line); background:var(--panel); border-radius:11px; padding:18px; min-height:124px; display:flex; flex-direction:column; gap:10px; position:relative; }
435
  .tile.ok { border-color:rgba(34,197,94,.22); }
@@ -444,10 +436,7 @@ function renderDashboard(data) {
444
  .tile-value { font-size:1.12rem; font-weight:850; overflow-wrap:anywhere; }
445
  .tile-detail { color:var(--soft); line-height:1.45; font-size:.83rem; }
446
  .tile-meta { color:var(--muted); line-height:1.4; font-size:.75rem; margin-top:auto; overflow-wrap:anywhere; }
447
- .panel { border:1px solid var(--line); background:var(--panel2); border-radius:11px; padding:16px; margin-top:18px; }
448
- .launch-panel { text-align:center; }
449
- .panel-title { color:var(--muted); font-size:.7rem; letter-spacing:.16em; text-transform:uppercase; font-weight:850; margin-bottom:8px; }
450
- .panel-copy { color:var(--soft); line-height:1.5; font-size:.86rem; margin:0 auto 14px; max-width:560px; }
451
  code { background:#232234; border:1px solid #34324c; border-radius:6px; padding:2px 6px; color:var(--text); font-size:.9em; }
452
  pre { margin:0; white-space:pre-wrap; overflow-wrap:anywhere; background:#0d0d0d; border:1px solid var(--line); border-radius:7px; padding:10px; color:var(--soft); font-size:.82rem; line-height:1.45; }
453
  .row { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
@@ -461,7 +450,7 @@ function renderDashboard(data) {
461
  .button.secondary { color:var(--text); background:#242424; border:1px solid var(--line); }
462
  footer { color:var(--muted); text-align:center; font-size:.74rem; margin-top:18px; }
463
  footer .live { color:var(--good); }
464
- @media (max-width: 700px) { .mini-grid, .overview { grid-template-columns:1fr; } main { width:min(100% - 22px, 720px); padding-top:28px; } }
465
  </style>
466
  </head>
467
  <body>
@@ -471,17 +460,9 @@ function renderDashboard(data) {
471
  <div class="subtitle">Self-hosted - Hugging Face Spaces - Hermes Agent</div>
472
  </header>
473
  <a class="hero-action" href="${APP_BASE}/" target="_blank" rel="noopener noreferrer">Open Hermes Agent -></a>
474
- <section class="mini-grid">${topCards}</section>
475
  <section class="overview">
476
  ${tiles}
477
  </section>
478
- <section class="panel launch-panel">
479
- <div>
480
- <div class="panel-title">Hermes Agent</div>
481
- <p class="panel-copy">Open the full Hermes Agent dashboard in a new window. You will be asked for only your <code>GATEWAY_TOKEN</code> if your session is not already active.</p>
482
- </div>
483
- <a class="button" href="${APP_BASE}/" target="_blank" rel="noopener noreferrer">Open Hermes Agent</a>
484
- </section>
485
  <footer><span class="live">Live</span> status - Health endpoint: <code>/health</code></footer>
486
  </main>
487
  </body>
 
360
  ? "Cloudflare keep-awake Worker is pending or failed; check Space logs."
361
  : "Add CLOUDFLARE_WORKERS_TOKEN to create a scheduled keep-awake Worker.";
362
  const serviceOk = data.gateway && data.dashboard;
363
+
 
 
 
 
364
  const tiles = [
365
  renderTile({
366
  title: "Gateway",
 
420
  header { text-align:center; margin-bottom:22px; }
421
  h1 { margin:0; font-size:1.65rem; line-height:1; letter-spacing:0; }
422
  .subtitle { margin-top:12px; color:var(--muted); font-size:.72rem; text-transform:uppercase; letter-spacing:.14em; font-weight:800; }
423
+ .hero-action { display:flex; width:100%; min-height:46px; align-items:center; justify-content:center; border-radius:8px; background:#ffffff; color:#000000; text-decoration:none; font-weight:850; font-size:.98rem; margin:24px 0 20px; transition: background 0.15s ease; }
424
+ .hero-action:hover { background:#e5e5e5; }
 
 
 
 
425
  .overview { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:10px; margin-bottom:10px; }
426
  .tile { border:1px solid var(--line); background:var(--panel); border-radius:11px; padding:18px; min-height:124px; display:flex; flex-direction:column; gap:10px; position:relative; }
427
  .tile.ok { border-color:rgba(34,197,94,.22); }
 
436
  .tile-value { font-size:1.12rem; font-weight:850; overflow-wrap:anywhere; }
437
  .tile-detail { color:var(--soft); line-height:1.45; font-size:.83rem; }
438
  .tile-meta { color:var(--muted); line-height:1.4; font-size:.75rem; margin-top:auto; overflow-wrap:anywhere; }
439
+
 
 
 
440
  code { background:#232234; border:1px solid #34324c; border-radius:6px; padding:2px 6px; color:var(--text); font-size:.9em; }
441
  pre { margin:0; white-space:pre-wrap; overflow-wrap:anywhere; background:#0d0d0d; border:1px solid var(--line); border-radius:7px; padding:10px; color:var(--soft); font-size:.82rem; line-height:1.45; }
442
  .row { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
 
450
  .button.secondary { color:var(--text); background:#242424; border:1px solid var(--line); }
451
  footer { color:var(--muted); text-align:center; font-size:.74rem; margin-top:18px; }
452
  footer .live { color:var(--good); }
453
+ @media (max-width: 700px) { .overview { grid-template-columns:1fr; } main { width:min(100% - 22px, 720px); padding-top:28px; } }
454
  </style>
455
  </head>
456
  <body>
 
460
  <div class="subtitle">Self-hosted - Hugging Face Spaces - Hermes Agent</div>
461
  </header>
462
  <a class="hero-action" href="${APP_BASE}/" target="_blank" rel="noopener noreferrer">Open Hermes Agent -></a>
 
463
  <section class="overview">
464
  ${tiles}
465
  </section>
 
 
 
 
 
 
 
466
  <footer><span class="live">Live</span> status - Health endpoint: <code>/health</code></footer>
467
  </main>
468
  </body>