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 = {
Accept: "application/json",
};
const BASE_URL = "";
async function fetchJson(path) {
const response = await fetch(path, {
headers: DEFAULT_HEADERS,
cache: "no-store",
});
if (!response.ok) {
throw new Error(`Request failed for ${path}: ${response.status}`);
}
return response.json();
const res = await fetch(`${BASE_URL}${path}`);
if (!res.ok) throw new Error(`HTTP ${res.status} for ${path}`);
return res.json();
}
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/system"),
fetchJson("/api/services"),
fetchJson("/api/storage"),
fetchJson("/api/adguard"),
fetchJson("/api/scrutiny"),
]);
return { overview, system, services, storage };
return { overview, system, services, storage, adguard, scrutiny };
}