From 815a0d1b4b71e12512cef5a8f59aa9d454d779d7 Mon Sep 17 00:00:00 2001 From: dax Date: Tue, 4 Aug 2026 19:49:03 +0100 Subject: stream import uploads to disk; advertise direct-origin fast uploads; fix /api/paths total --- public/app.css | 13 +++++++++++++ public/app.js | 16 ++++++++++++++++ public/index.html | 5 +++-- 3 files changed, 32 insertions(+), 2 deletions(-) (limited to 'public') diff --git a/public/app.css b/public/app.css index 153c334..a0cde93 100644 --- a/public/app.css +++ b/public/app.css @@ -146,6 +146,19 @@ html, body { } #import-state[hidden] { display: none; } +.direct-hint { + margin-top: 8px; + font-size: 12px; + letter-spacing: .03em; + color: var(--muted); +} +.direct-hint a { + color: var(--ring); + text-decoration: none; + border-bottom: 1px solid rgba(125, 211, 252, .3); +} +.direct-hint a:hover { border-bottom-color: var(--ring); } + #file { position: absolute; width: 1px; diff --git a/public/app.js b/public/app.js index 78584bf..780bc98 100644 --- a/public/app.js +++ b/public/app.js @@ -661,6 +661,21 @@ function hideImportState() { stage.classList.remove("blocked") } +async function initDirectHint() { + try { + const r = await fetch("/api/health") + const data = await r.json() + const d = data.direct || {} + const urls = [d.magic, d.lan, d.tailscale].filter(Boolean) + if (!urls.length) return + if (urls.some((u) => { try { return new URL(u).host === location.host } catch { return false } })) return + const link = $("#direct-link") + link.textContent = d.magic + link.href = d.magic + $("#direct-hint").hidden = false + } catch { /* ignore */ } +} + async function beginWalk() { if (started) return started = true @@ -695,6 +710,7 @@ async function beginWalk() { } catch { showImportState() } + initDirectHint() })() let toastTimer = 0 diff --git a/public/index.html b/public/index.html index ae56eea..736d446 100644 --- a/public/index.html +++ b/public/index.html @@ -5,7 +5,7 @@ pathways - +
@@ -19,6 +19,7 @@ import photos +
@@ -28,6 +29,6 @@
- + -- cgit v1.3.1