2e87cb910c
- Jobs page: cron run history panel with job selection and filtering - Jobs page: model shown as read-only on job cards - Job form modal: properly typed payloads - i18n: added runHistory, model keys to all 8 locales
28 lines
737 B
TypeScript
28 lines
737 B
TypeScript
import { request } from '../client'
|
|
|
|
export interface RunEntry {
|
|
jobId: string
|
|
fileName: string
|
|
runTime: string
|
|
size: number
|
|
}
|
|
|
|
export interface RunDetail {
|
|
jobId: string
|
|
fileName: string
|
|
runTime: string
|
|
content: string
|
|
}
|
|
|
|
export async function listCronRuns(jobId?: string): Promise<RunEntry[]> {
|
|
const params = new URLSearchParams()
|
|
if (jobId) params.set('jobId', jobId)
|
|
const qs = params.toString()
|
|
const res = await request<{ runs: RunEntry[] }>(`/api/cron-history${qs ? `?${qs}` : ''}`)
|
|
return res.runs
|
|
}
|
|
|
|
export async function readCronRun(jobId: string, fileName: string): Promise<RunDetail> {
|
|
return request<RunDetail>(`/api/cron-history/${encodeURIComponent(jobId)}/${encodeURIComponent(fileName)}`)
|
|
}
|