From c40187f09f617c54dd22cb70ca26a37c819a532a Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Fri, 17 Oct 2025 10:05:18 -0400 Subject: [PATCH] Align CDN health badge checking icon with torrent badge --- js/app.js | 20 ++++++++++---------- js/state/cache.js | 2 +- js/ui/components/VideoCard.js | 9 ++++++++- js/ui/views/VideoListView.js | 2 +- 4 files changed, 20 insertions(+), 13 deletions(-) diff --git a/js/app.js b/js/app.js index 6b750f84..b22fcbc0 100644 --- a/js/app.js +++ b/js/app.js @@ -4097,7 +4097,7 @@ class Application { aria-live="polite" role="status" > - Checking hosted URL… + ⏳ CDN `; } @@ -4155,17 +4155,17 @@ class Application { } const status = state?.status || "checking"; + const fallbackMessages = { + healthy: "✅ CDN", + offline: "❌ CDN", + unknown: "⚠️ CDN", + timeout: "⚠️ CDN timed out", + checking: "⏳ CDN", + }; const message = state?.message || - (status === "healthy" - ? "✅ CDN" - : status === "offline" - ? "❌ CDN" - : status === "unknown" - ? "⚠️ CDN" - : status === "timeout" - ? "⚠️ CDN timed out" - : "Checking hosted URL…"); + fallbackMessages[status] || + fallbackMessages.checking; const hadCompactMargin = badgeEl.classList.contains("mt-sm") || badgeEl.classList.contains("mt-3"); diff --git a/js/state/cache.js b/js/state/cache.js index 52332ff6..8dc2910d 100644 --- a/js/state/cache.js +++ b/js/state/cache.js @@ -685,7 +685,7 @@ export function storeUrlHealth(eventId, url, result, ttlMs = URL_HEALTH_TTL_MS) const now = Date.now(); const entry = { status: result?.status || "checking", - message: result?.message || "Checking hosted URL…", + message: result?.message || "⏳ CDN", url: url || result?.url || "", expiresAt: now + ttl, lastCheckedAt: now, diff --git a/js/ui/components/VideoCard.js b/js/ui/components/VideoCard.js index f25e9253..262b814b 100644 --- a/js/ui/components/VideoCard.js +++ b/js/ui/components/VideoCard.js @@ -989,10 +989,17 @@ export class VideoCard { typeof entry?.status === "string" && entry.status ? entry.status : "checking"; + const fallbackMessages = { + healthy: "✅ CDN", + offline: "❌ CDN", + unknown: "⚠️ CDN", + timeout: "⚠️ CDN timed out", + checking: "⏳ CDN" + }; const message = typeof entry?.message === "string" && entry.message ? entry.message - : "Checking hosted URL…"; + : fallbackMessages[status] || fallbackMessages.checking; badge.className = ["badge", "url-health-badge"].join(" "); diff --git a/js/ui/views/VideoListView.js b/js/ui/views/VideoListView.js index 05b4625e..efa33ab2 100644 --- a/js/ui/views/VideoListView.js +++ b/js/ui/views/VideoListView.js @@ -645,7 +645,7 @@ export class VideoListView { message: typeof entry.message === "string" && entry.message ? entry.message - : "Checking hosted URL…", + : "⏳ CDN", }; if (Number.isFinite(entry.lastCheckedAt)) {