feat: add immich/backrest/HA/UK endpoints to api.js

This commit is contained in:
2026-04-06 07:33:30 +00:00
parent cacb7782db
commit 36e82a78f0
+9 -6
View File
@@ -1,19 +1,22 @@
const BASE_URL = "";
async function fetchJson(path) { async function fetchJson(path) {
const res = await fetch(`${BASE_URL}${path}`); const res = await fetch(path);
if (!res.ok) throw new Error(`HTTP ${res.status} for ${path}`); if (!res.ok) throw new Error(path + " HTTP " + res.status);
return res.json(); return res.json();
} }
export async function fetchDashboardData() { export async function fetchDashboardData() {
const [overview, system, services, storage, adguard, scrutiny] = await Promise.all([ const [overview, system, services, storage, adguard, scrutiny, immich, backrest, home_assistant, uptime_kuma] =
await Promise.all([
fetchJson("/api/overview"), fetchJson("/api/overview"),
fetchJson("/api/system"), fetchJson("/api/system"),
fetchJson("/api/services"), fetchJson("/api/services"),
fetchJson("/api/storage"), fetchJson("/api/storage"),
fetchJson("/api/adguard"), fetchJson("/api/adguard"),
fetchJson("/api/scrutiny"), fetchJson("/api/scrutiny"),
fetchJson("/api/immich"),
fetchJson("/api/backrest"),
fetchJson("/api/home_assistant"),
fetchJson("/api/uptime_kuma"),
]); ]);
return { overview, system, services, storage, adguard, scrutiny }; return { overview, system, services, storage, adguard, scrutiny, immich, backrest, home_assistant, uptime_kuma };
} }