Files
corescope-rx/index.html
T
efitenandClaude Opus 4.8 bbf91c2afc feat: move Connect to Settings, open on Settings until connected, name last reception (v1.3.1)
- Connect/Disconnect (+ progress + status) moves from Home to the Settings tab, so
  the recently-heard list moves up — Home stays a pure monitor.
- The app opens on Settings (where Connect lives) until a companion is connected,
  then jumps to Home; the live monitor is shown only when there's something to watch.
- Last reception shows the resolved node name when available, upgrading from the raw
  ID once names.js resolves it (label derived live each tick).

SW cache v8→v9.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-20 15:57:37 +02:00

131 lines
7.8 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
<title>CoreDrive RX — coverage capture</title>
<link rel="manifest" href="/manifest.webmanifest" />
<meta name="theme-color" content="#0f1115" />
<link rel="apple-touch-icon" href="/icon-192.png" />
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css" />
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"></script>
<style>
body { font-family: system-ui, sans-serif; margin: 0; padding: 16px; background: #0f1115; color: #e6e6e6; }
h1 { font-size: 18px; }
.card { background: #1a1d24; border: 1px solid #2a2f3a; border-radius: 8px; padding: 12px; margin: 10px 0; }
label { display: block; font-size: 12px; color: #9aa4b2; margin: 6px 0 2px; }
button { width: 100%; padding: 12px; margin-top: 4px; font-size: 15px; border: 0; border-radius: 8px; background: #2ecc71; color: #07120a; font-weight: 600; }
button.danger { background: #e74c3c; color: #fff; }
button:disabled { opacity: .6; }
.btn2 { background: #3b82f6; color: #fff; }
.btn2.on { background: #2ecc71; color: #07120a; }
.stats { display: flex; gap: 16px; font-size: 28px; font-weight: 700; }
.stats div { flex: 1; text-align: center; }
.stats small { display: block; font-size: 11px; color: #9aa4b2; font-weight: 400; }
.muted { font-size: 12px; color: #9aa4b2; margin-top: 6px; }
.progress { margin-top: 10px; font: 12px/1.7 ui-monospace, monospace; }
.progress div { color: #9fe6b8; }
.progress div.pending { color: #9aa4b2; }
.progress div.err { color: #ff8b7a; }
.row { display: flex; gap: 8px; }
.row button { flex: 1; }
label.inline { display: flex; align-items: center; gap: 8px; margin: 8px 0 0; font-size: 13px; color: #e6e6e6; }
label.inline input { width: auto; }
#log { background: #0a0c10; border: 1px solid #2a2f3a; border-radius: 6px; padding: 8px; font: 11px/1.4 ui-monospace, monospace; white-space: pre-wrap; word-break: break-all; max-height: 300px; overflow: auto; margin-top: 8px; }
#log .lg-ok { color: #9fe6b8; } /* captured / published (the data product) */
#log .lg-no { color: #ff8b7a; } /* held back / failed */
#log .lg-st { color: #9aa4b2; } /* status */
#log .lg-tx { color: #e6a23c; } /* our own outbound radio sends (discover / flood) */
.statusstrip { font-size: 12px; color: #9aa4b2; margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.statusstrip .udot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #9aa4b2; margin-right: 3px; }
.discstatus { font-size: 12px; margin-top: 6px; min-height: 15px; color: #9aa4b2; }
.lh { font-size: 13px; }
.meter { position: relative; height: 18px; background: #0a0c10; border: 1px solid #2a2f3a; border-radius: 5px; overflow: hidden; margin-top: 6px; }
.meterfill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: #2ecc71; transition: width .2s linear; }
.meterpeak { position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; left: 0; transition: left .2s linear; }
.meterval { font: 12px ui-monospace, monospace; color: #9aa4b2; margin-top: 4px; }
.recent { display: flex; flex-direction: column; gap: 4px; }
.rr { display: flex; align-items: center; gap: 8px; padding: 7px 9px; background: #11141a; border: 1px solid #2a2f3a; border-radius: 6px; font-size: 13px; }
.rr .dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.rr .rk { font-family: ui-monospace, monospace; }
.rr .rname { flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rr .rsnr { margin-left: auto; font-weight: 600; flex: 0 0 auto; }
.rr .rc { color: #9aa4b2; font-size: 11px; min-width: 34px; text-align: right; }
body { padding-bottom: 70px; }
.bottombar { position: fixed; bottom: 0; left: 0; right: 0; height: 56px; display: flex; background: #1a1d24; border-top: 1px solid #2a2f3a; z-index: 1000; }
.bottombar .tab { flex: 1; background: transparent; color: #9aa4b2; border: 0; border-radius: 0; margin: 0; font-size: 14px; font-weight: 600; }
.bottombar .tab.active { color: #2ecc71; }
#view-map #liveMap { height: calc(100vh - 140px); min-height: 300px; border: 1px solid #2a2f3a; border-radius: 6px; }
</style>
</head>
<body>
<h1>📡 CoreDrive RX <span id="appver" style="font-size:11px;font-weight:400;color:#9aa4b2"></span></h1>
<div class="muted" style="margin-top:-6px;margin-bottom:8px">Mobile RX coverage for CoreScope</div>
<div id="btnotice" style="display:none;background:#3a1414;color:#ff8b7a;border:1px solid #6b2020;border-radius:8px;padding:10px 12px;margin:10px 0;font-size:13px">⚠️ Web Bluetooth isn't available in this browser. On <b>iOS</b>, open this page in the <b>Bluefy</b> browser; on <b>Android</b>, use <b>Chrome</b>.</div>
<div id="view-home">
<div class="card">
<div class="stats">
<div><span id="cNodes">0</span><small>nodes</small></div>
<div><span id="cHex">0</span><small>hex cells</small></div>
<div><span id="cRx">0</span><small>receptions</small></div>
</div>
<div class="statusstrip">
<span id="sGps">… no fix</span><span>·</span>
<span id="sPending">0 pending</span><span>·</span>
<span id="sUpload"><span class="udot" id="uDot"></span>upload</span><span>·</span>
<span id="sRate">0 pkt/min</span>
</div>
<div class="discstatus" id="discStatus"></div>
</div>
<div class="card" id="lastHeardCard" style="display:none">
<label>Last reception</label>
<div class="lh" id="lhLine">—</div>
<div class="meter"><div class="meterfill" id="snrFill"></div><div class="meterpeak" id="snrPeak"></div></div>
<div class="meterval" id="snrVal"></div>
</div>
<div id="pausechip" style="display:none;background:#3a2e10;color:#e6a23c;border:1px solid #6b5212;border-radius:8px;padding:10px 12px;margin:10px 0;font-size:13px;font-weight:600"></div>
<div class="card">
<label>Recently heard nodes (latest SNR)</label>
<div id="recent" class="recent"><div class="muted">— nothing yet —</div></div>
</div>
</div><!-- /view-home -->
<div id="view-map" style="display:none">
<label>Live coverage (this session) — hexes persist until you reload</label>
<div id="liveMap"></div>
</div>
<div id="view-settings" style="display:none">
<div class="card">
<button id="btnConnect">Connect companion (BLE)</button>
<div class="progress" id="progress"></div>
<div class="muted" id="status"></div>
</div>
<div class="card">
<label>CoreScope</label>
<div class="muted" id="brokerStatus">— not connected —</div>
<button id="btnPush" class="btn2" style="margin-top:8px">Push pending now</button>
</div>
<div class="card">
<label>Companion</label>
<div class="muted" id="companionInfo">— not connected —</div>
<div class="muted" id="hashinfo"></div>
</div>
<div class="card">
<label>Diagnostics</label>
<label class="inline"><input type="checkbox" id="chkVerbose"> Verbose (raw packet bytes + unattributable frames)</label>
<div class="row" style="margin-top:10px">
<button id="btnDbg" class="btn2">Show debug log</button>
<button id="btnClear" class="btn2">Clear log</button>
</div>
<button id="btnShareLog" class="btn2" style="margin-top:8px">📤 Share / mail debug log</button>
<pre id="log" style="display:none"></pre>
</div>
</div>
<nav class="bottombar">
<button id="tabHome" class="tab active">🏠 Home</button>
<button id="tabMap" class="tab">🗺️ Map</button>
<button id="tabSettings" class="tab">⚙️ Settings</button>
</nav>
<script type="module" src="/src/app.js"></script>
</body>
</html>