feat(dashboard): add AdGuard + Scrutiny frontend integration

This commit is contained in:
2026-04-05 21:16:53 +00:00
parent bd6b7feab6
commit 78f3201e7b
+8 -16
View File
@@ -1,27 +1,19 @@
const DEFAULT_HEADERS = { const BASE_URL = "";
Accept: "application/json",
};
async function fetchJson(path) { async function fetchJson(path) {
const response = await fetch(path, { const res = await fetch(`${BASE_URL}${path}`);
headers: DEFAULT_HEADERS, if (!res.ok) throw new Error(`HTTP ${res.status} for ${path}`);
cache: "no-store", return res.json();
});
if (!response.ok) {
throw new Error(`Request failed for ${path}: ${response.status}`);
}
return response.json();
} }
export async function fetchDashboardData() { export async function fetchDashboardData() {
const [overview, system, services, storage] = await Promise.all([ const [overview, system, services, storage, adguard, scrutiny] = 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/scrutiny"),
]); ]);
return { overview, system, services, storage, adguard, scrutiny };
return { overview, system, services, storage };
} }