feat(web): schedule control, next-run, broken badge, run-log modal
This commit is contained in:
@@ -18,6 +18,9 @@ export interface Task {
|
||||
dst_endpoint_id: number
|
||||
status: string
|
||||
folder_mapping?: Record<string, string>
|
||||
schedule_interval_seconds?: number
|
||||
broken?: boolean
|
||||
next_run_at?: string | null
|
||||
}
|
||||
|
||||
export type TestStatus = 'pending' | 'ok' | 'fail' | string
|
||||
@@ -137,6 +140,23 @@ export const testAccounts = (id: number) => api(`/api/tasks/${id}/test`, { metho
|
||||
|
||||
export const runTask = (id: number) => api(`/api/tasks/${id}/run`, { method: 'POST' })
|
||||
|
||||
export interface Run {
|
||||
id: number
|
||||
task_id: number
|
||||
status: string
|
||||
started_at: string
|
||||
finished_at: string | null
|
||||
total_copied: number
|
||||
total_skipped: number
|
||||
total_errors: number
|
||||
trigger: string
|
||||
}
|
||||
|
||||
export const setTaskSchedule = (taskId: number, intervalSeconds: number) =>
|
||||
api(`/api/tasks/${taskId}/schedule`, { ...jsonBody({ interval_seconds: intervalSeconds }), method: 'PUT' })
|
||||
|
||||
export const listRuns = (taskId: number) => api<Run[]>(`/api/tasks/${taskId}/runs`)
|
||||
|
||||
export const importCSV = (id: number, file: File) => {
|
||||
const fd = new FormData()
|
||||
fd.append('file', file)
|
||||
|
||||
Reference in New Issue
Block a user