Merge pull request #614 from PR0M3TH3AN/codex/change-cdn-health-check-display

Align CDN health badge with torrent badge icon
This commit is contained in:
thePR0M3TH3AN authored and GitHub committed 2025-10-17 10:06:04 -04:00
commit d0bca0a4bc
4 files changed
+20 -13

No files matched your search

+10 -10
View File
@@ -4097,7 +4097,7 @@ class Application {
aria-live="polite"
role="status"
>
Checking hosted URL…
⏳ CDN
</span>
`;
}
@@ -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");
+1 -1
View File
@@ -695,7 +695,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,
+8 -1
View File
@@ -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(" ");
+1 -1
View File
@@ -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)) {