Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 18 additions & 6 deletions src/components/StatusDashboard/cloud_services.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,24 @@ function Status({ api, link, title }) {
void (async () => {
try {
const json = (await (await fetch(api)).json());
const status =
typeof json.status === "object" // support StatusPage API
? json.status.description
: typeof json.monitor === "object" // support UptimeRobot API
? json.monitor.statusClass
: json.status || "unknown";
let status;
if (title === "Blacksmith.sh") {
status = json
.components
.filter((comp) => comp.name === "Blacksmith Managed Runners")[0]
.status;
} else if (title === "Namespace.so" || title === "Depot.dev") {
status = json.summary.affected_components.length > 0
? "Ongoing incident"
: "operational";
} else {
status =
typeof json.status === "object" // support StatusPage API
? json.status.description
: typeof json.monitor === "object" // support UptimeRobot API
? json.monitor.statusClass
: json.status || "unknown";
}
setState({ status });
} catch (error) {
console.warn(`error fetching data for ${title} – ${api}`, error);
Expand Down
15 changes: 15 additions & 0 deletions src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,16 @@ export const urls = {
link: "https://status.dev.azure.com/",
title: "Azure DevOps",
},
blacksmith: {
api: "https://status.blacksmith.sh/v2/components.json",
link: "https://status.blacksmith.sh",
title: "Blacksmith.sh",
},
depot: {
api: "https://status.depot.dev/proxy/status.depot.dev",
link: "https://status.depot.dev",
title: "Depot.dev",
},
// circle: {
// api: "https://status.circleci.com/api/v2/status.json",
// link: "https://status.circleci.com",
Expand All @@ -53,6 +63,11 @@ export const urls = {
link: "https://www.githubstatus.com/",
title: "GitHub",
},
namespace: {
api: "https://namespace-status.com/proxy/namespace-status.com",
link: "https://namespace-status.com/",
title: "Namespace.so",
},
prefix_dev: {
api: "https://status.prefix.dev/api/getMonitorDetails/status.conda-forge.org?m=798888560",
link: "https://status.prefix.dev",
Expand Down