feat: cron job run history panel and job model display (#319)
- 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
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
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)}`)
|
||||
}
|
||||
@@ -52,6 +52,8 @@ export interface UpdateJobRequest {
|
||||
skill?: string
|
||||
repeat?: number
|
||||
enabled?: boolean
|
||||
model?: string
|
||||
provider?: string
|
||||
}
|
||||
|
||||
function unwrap(res: { job: Job }): Job {
|
||||
|
||||
Reference in New Issue
Block a user