mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-31 09:52:24 +00:00
Merge pull request #99 from PR0M3TH3AN/codex/fix-video-grid-status-message
Ensure url health badges update after mounting
This commit is contained in:
1 file changed
+12
-6
@@ -2176,9 +2176,9 @@ class bitvidApp {
|
||||
const message =
|
||||
state?.message ||
|
||||
(status === "healthy"
|
||||
? "✅ CDN Healthy"
|
||||
? "✅ CDN"
|
||||
: status === "offline"
|
||||
? "⚠️ URL offline — using P2P fallback"
|
||||
? "❌ CDN"
|
||||
: status === "unknown"
|
||||
? "⚠️ Hosted URL reachable (CORS restricted)"
|
||||
: status === "timeout"
|
||||
@@ -2202,7 +2202,13 @@ class bitvidApp {
|
||||
"text-green-200"
|
||||
);
|
||||
} else if (status === "offline") {
|
||||
badgeEl.classList.add("block", "bg-red-900", "text-red-200");
|
||||
badgeEl.classList.add(
|
||||
"inline-flex",
|
||||
"items-center",
|
||||
"gap-1",
|
||||
"bg-red-900",
|
||||
"text-red-200"
|
||||
);
|
||||
} else if (status === "unknown" || status === "timeout") {
|
||||
badgeEl.classList.add(
|
||||
"inline-flex",
|
||||
@@ -2266,7 +2272,7 @@ class bitvidApp {
|
||||
let entry;
|
||||
|
||||
if (outcome === "ok") {
|
||||
entry = { status: "healthy", message: "✅ CDN Healthy" };
|
||||
entry = { status: "healthy", message: "✅ CDN" };
|
||||
} else if (outcome === "opaque") {
|
||||
entry = {
|
||||
status: "unknown",
|
||||
@@ -2280,7 +2286,7 @@ class bitvidApp {
|
||||
} else {
|
||||
entry = {
|
||||
status: "offline",
|
||||
message: "⚠️ URL offline — using P2P fallback",
|
||||
message: "❌ CDN",
|
||||
};
|
||||
}
|
||||
|
||||
@@ -2290,7 +2296,7 @@ class bitvidApp {
|
||||
console.warn(`[urlHealth] probe failed for ${trimmedUrl}:`, err);
|
||||
const entry = {
|
||||
status: "offline",
|
||||
message: "⚠️ URL offline — using P2P fallback",
|
||||
message: "❌ CDN",
|
||||
};
|
||||
return this.storeUrlHealth(eventId, trimmedUrl, entry);
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user