mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-29 00:42:30 +00:00
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:
4 files changed
+20
-13
No files matched your search
@@ -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
@@ -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,
|
||||
|
||||
@@ -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(" ");
|
||||
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
Reference in new issue
Block a user