feat: add immich/backrest/HA/UK endpoints to api.js
This commit is contained in:
@@ -1,19 +1,22 @@
|
||||
const BASE_URL = "";
|
||||
|
||||
async function fetchJson(path) {
|
||||
const res = await fetch(`${BASE_URL}${path}`);
|
||||
if (!res.ok) throw new Error(`HTTP ${res.status} for ${path}`);
|
||||
const res = await fetch(path);
|
||||
if (!res.ok) throw new Error(path + " HTTP " + res.status);
|
||||
return res.json();
|
||||
}
|
||||
|
||||
export async function fetchDashboardData() {
|
||||
const [overview, system, services, storage, adguard, scrutiny] = await Promise.all([
|
||||
fetchJson("/api/overview"),
|
||||
fetchJson("/api/system"),
|
||||
fetchJson("/api/services"),
|
||||
fetchJson("/api/storage"),
|
||||
fetchJson("/api/adguard"),
|
||||
fetchJson("/api/scrutiny"),
|
||||
]);
|
||||
return { overview, system, services, storage, adguard, scrutiny };
|
||||
const [overview, system, services, storage, adguard, scrutiny, immich, backrest, home_assistant, uptime_kuma] =
|
||||
await Promise.all([
|
||||
fetchJson("/api/overview"),
|
||||
fetchJson("/api/system"),
|
||||
fetchJson("/api/services"),
|
||||
fetchJson("/api/storage"),
|
||||
fetchJson("/api/adguard"),
|
||||
fetchJson("/api/scrutiny"),
|
||||
fetchJson("/api/immich"),
|
||||
fetchJson("/api/backrest"),
|
||||
fetchJson("/api/home_assistant"),
|
||||
fetchJson("/api/uptime_kuma"),
|
||||
]);
|
||||
return { overview, system, services, storage, adguard, scrutiny, immich, backrest, home_assistant, uptime_kuma };
|
||||
}
|
||||
Reference in New Issue
Block a user