Sanitized mirror from private repository - 2026-04-04 12:42:10 UTC
Some checks failed
Documentation / Build Docusaurus (push) Failing after 5m2s
Documentation / Deploy to GitHub Pages (push) Has been skipped

This commit is contained in:
Gitea Mirror Bot
2026-04-04 12:42:10 +00:00
commit 27d742a147
1381 changed files with 353139 additions and 0 deletions

13
dashboard/ui/lib/api.ts Normal file
View File

@@ -0,0 +1,13 @@
const API = process.env.NEXT_PUBLIC_API_URL || "http://localhost:18888";
export async function fetchAPI<T>(path: string): Promise<T> {
const res = await fetch(`${API}${path}`);
if (!res.ok) throw new Error(`API error: ${res.status}`);
return res.json();
}
export async function postAPI<T>(path: string): Promise<T> {
const res = await fetch(`${API}${path}`, { method: "POST" });
if (!res.ok) throw new Error(`API error: ${res.status}`);
return res.json();
}