diff options
| author | dax <me@dax.ist> | 2026-08-04 19:49:03 +0100 |
|---|---|---|
| committer | dax <me@dax.ist> | 2026-08-04 19:49:03 +0100 |
| commit | 815a0d1b4b71e12512cef5a8f59aa9d454d779d7 (patch) | |
| tree | d2193b78b795969e4c84b5a18748a7191525648c /public/app.js | |
| parent | 247390000a0fdf7eeedb89a2c5500c64f36df1c3 (diff) | |
stream import uploads to disk; advertise direct-origin fast uploads; fix /api/paths total
Diffstat (limited to 'public/app.js')
| -rw-r--r-- | public/app.js | 16 |
1 files changed, 16 insertions, 0 deletions
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 |
