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 type {
|
||||
BackupAlert,
|
||||
BackupDashboardSummary,
|
||||
BackupJob,
|
||||
BackupRun,
|
||||
BackupAlert,
|
||||
BackupDashboardSummary,
|
||||
BackupJob,
|
||||
BackupRun,
|
||||
} from "../types/backups";
|
||||
|
||||
export async function fetchBackupJobs(): Promise<BackupJob[]> {
|
||||
return get<BackupJob[]>("/api/backups/jobs");
|
||||
return get<BackupJob[]>("/api/backups/jobs");
|
||||
}
|
||||
|
||||
export async function fetchBackupJob(
|
||||
jobId: string,
|
||||
jobId: string,
|
||||
): 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(
|
||||
jobId?: string,
|
||||
status?: string,
|
||||
jobId?: string,
|
||||
status?: string,
|
||||
): Promise<BackupRun[]> {
|
||||
return get<BackupRun[]>("/api/backups/runs", {
|
||||
...(jobId ? { job_id: jobId } : {}),
|
||||
...(status ? { status } : {}),
|
||||
});
|
||||
return get<BackupRun[]>("/api/backups/runs", {
|
||||
...(jobId ? { job_id: jobId } : {}),
|
||||
...(status ? { status } : {}),
|
||||
});
|
||||
}
|
||||
|
||||
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(
|
||||
jobId?: string,
|
||||
acknowledged?: boolean,
|
||||
severity?: string,
|
||||
jobId?: string,
|
||||
acknowledged?: boolean,
|
||||
severity?: string,
|
||||
): Promise<BackupAlert[]> {
|
||||
return get<BackupAlert[]>("/api/backups/alerts", {
|
||||
...(jobId ? { job_id: jobId } : {}),
|
||||
...(acknowledged !== undefined ? { acknowledged: String(acknowledged) } : {}),
|
||||
...(severity ? { severity } : {}),
|
||||
});
|
||||
return get<BackupAlert[]>("/api/backups/alerts", {
|
||||
...(jobId ? { job_id: jobId } : {}),
|
||||
...(acknowledged !== undefined
|
||||
? { acknowledged: String(acknowledged) }
|
||||
: {}),
|
||||
...(severity ? { severity } : {}),
|
||||
});
|
||||
}
|
||||
|
||||
export async function acknowledgeBackupAlert(
|
||||
alertId: string,
|
||||
alertId: string,
|
||||
): Promise<BackupAlert> {
|
||||
return post<BackupAlert>(`/api/backups/alerts/${alertId}/acknowledge`);
|
||||
return post<BackupAlert>(`/api/backups/alerts/${alertId}/acknowledge`);
|
||||
}
|
||||
|
||||
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,
|
||||
PrometheusTarget,
|
||||
} 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)
|
||||
export const fetchCounts = (jellyfinServiceId?: string) =>
|
||||
|
||||
Reference in New Issue
Block a user