style(frontend/api): apply formatter to backups.ts and client.ts
Convert indentation to tabs and reflow long import lines. No behavior change. Co-authored-by: el Gentleman <gentleman@pi.local>
This commit is contained in:
+29
-25
@@ -1,53 +1,57 @@
|
|||||||
import { get, post } from "./shared";
|
import { get, post } from "./shared";
|
||||||
import type {
|
import type {
|
||||||
BackupAlert,
|
BackupAlert,
|
||||||
BackupDashboardSummary,
|
BackupDashboardSummary,
|
||||||
BackupJob,
|
BackupJob,
|
||||||
BackupRun,
|
BackupRun,
|
||||||
} from "../types/backups";
|
} from "../types/backups";
|
||||||
|
|
||||||
export async function fetchBackupJobs(): Promise<BackupJob[]> {
|
export async function fetchBackupJobs(): Promise<BackupJob[]> {
|
||||||
return get<BackupJob[]>("/api/backups/jobs");
|
return get<BackupJob[]>("/api/backups/jobs");
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function fetchBackupJob(
|
export async function fetchBackupJob(
|
||||||
jobId: string,
|
jobId: string,
|
||||||
): Promise<{ job: BackupJob; runs: BackupRun[] }> {
|
): Promise<{ job: BackupJob; runs: BackupRun[] }> {
|
||||||
return get<{ job: BackupJob; runs: BackupRun[] }>(`/api/backups/jobs/${jobId}`);
|
return get<{ job: BackupJob; runs: BackupRun[] }>(
|
||||||
|
`/api/backups/jobs/${jobId}`,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function fetchBackupRuns(
|
export async function fetchBackupRuns(
|
||||||
jobId?: string,
|
jobId?: string,
|
||||||
status?: string,
|
status?: string,
|
||||||
): Promise<BackupRun[]> {
|
): Promise<BackupRun[]> {
|
||||||
return get<BackupRun[]>("/api/backups/runs", {
|
return get<BackupRun[]>("/api/backups/runs", {
|
||||||
...(jobId ? { job_id: jobId } : {}),
|
...(jobId ? { job_id: jobId } : {}),
|
||||||
...(status ? { status } : {}),
|
...(status ? { status } : {}),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function fetchBackupRun(runId: string): Promise<BackupRun> {
|
export async function fetchBackupRun(runId: string): Promise<BackupRun> {
|
||||||
return get<BackupRun>(`/api/backups/runs/${runId}`);
|
return get<BackupRun>(`/api/backups/runs/${runId}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function fetchBackupAlerts(
|
export async function fetchBackupAlerts(
|
||||||
jobId?: string,
|
jobId?: string,
|
||||||
acknowledged?: boolean,
|
acknowledged?: boolean,
|
||||||
severity?: string,
|
severity?: string,
|
||||||
): Promise<BackupAlert[]> {
|
): Promise<BackupAlert[]> {
|
||||||
return get<BackupAlert[]>("/api/backups/alerts", {
|
return get<BackupAlert[]>("/api/backups/alerts", {
|
||||||
...(jobId ? { job_id: jobId } : {}),
|
...(jobId ? { job_id: jobId } : {}),
|
||||||
...(acknowledged !== undefined ? { acknowledged: String(acknowledged) } : {}),
|
...(acknowledged !== undefined
|
||||||
...(severity ? { severity } : {}),
|
? { acknowledged: String(acknowledged) }
|
||||||
});
|
: {}),
|
||||||
|
...(severity ? { severity } : {}),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function acknowledgeBackupAlert(
|
export async function acknowledgeBackupAlert(
|
||||||
alertId: string,
|
alertId: string,
|
||||||
): Promise<BackupAlert> {
|
): Promise<BackupAlert> {
|
||||||
return post<BackupAlert>(`/api/backups/alerts/${alertId}/acknowledge`);
|
return post<BackupAlert>(`/api/backups/alerts/${alertId}/acknowledge`);
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function fetchBackupDashboard(): Promise<BackupDashboardSummary> {
|
export async function fetchBackupDashboard(): Promise<BackupDashboardSummary> {
|
||||||
return get<BackupDashboardSummary>("/api/dashboard/backups");
|
return get<BackupDashboardSummary>("/api/dashboard/backups");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,15 @@ import type {
|
|||||||
PrometheusStatus,
|
PrometheusStatus,
|
||||||
PrometheusTarget,
|
PrometheusTarget,
|
||||||
} from "../types";
|
} from "../types";
|
||||||
import { buildHeaders, buildUrl, del, get, post, postForm, readErrorDetail } from "./shared";
|
import {
|
||||||
|
buildHeaders,
|
||||||
|
buildUrl,
|
||||||
|
del,
|
||||||
|
get,
|
||||||
|
post,
|
||||||
|
postForm,
|
||||||
|
readErrorDetail,
|
||||||
|
} from "./shared";
|
||||||
|
|
||||||
// Dashboard (Jellyfin-backed; selected via jellyfin_service_id)
|
// Dashboard (Jellyfin-backed; selected via jellyfin_service_id)
|
||||||
export const fetchCounts = (jellyfinServiceId?: string) =>
|
export const fetchCounts = (jellyfinServiceId?: string) =>
|
||||||
|
|||||||
Reference in New Issue
Block a user