feat: implement the Status API on Settings page (#470)

This commit is contained in:
Fine0830
2025-05-30 12:53:22 +08:00
committed by GitHub
parent a28972bc5c
commit 7dcc67f455
38 changed files with 775 additions and 236 deletions

View File

@@ -34,23 +34,23 @@ class HTTPError extends Error {
}
}
const BasePath = `/graphql`;
export const BasePath = `/graphql`;
export async function httpQuery({
path = "",
url = "",
method = "GET",
json,
headers = {},
}: {
path?: string;
method: string;
json: unknown;
headers: Recordable;
headers?: Recordable;
url: string;
}) {
const timeoutId = setTimeout(() => {
abortRequestsAndUpdate();
}, Timeout);
const url = `${BasePath}${path}`;
const response: Response = await fetch(url, {
method,
headers: {