- This will remove{' '}
- {truncate(jobTitle(pendingDelete), 60)} permanently.
- It will stop firing immediately.
- >
- ) : null
- }
- destructive
- doneLabel="Deleted"
- onClose={() => setPendingDelete(null)}
- onConfirm={async () => {
- if (!pendingDelete) {
- return
- }
-
- await deleteCronJob(pendingDelete.id)
- setJobs(current => (current ? current.filter(row => row.id !== pendingDelete.id) : current))
- notify({ kind: 'success', message: truncate(jobTitle(pendingDelete), 60), title: 'Cron deleted' })
- }}
- open={pendingDelete !== null}
- title="Delete cron job?"
- />
+
+
)
}
function CronJobRow({
busy,
+ c,
job,
onDelete,
onEdit,
@@ -501,6 +491,7 @@ function CronJobRow({
onTrigger
}: {
busy: boolean
+ c: Translations['cron']
job: CronJob
onDelete: () => void
onEdit: () => void
@@ -516,19 +507,15 @@ function CronJobRow({
return (
{job.last_error && (
@@ -569,6 +560,16 @@ function CronJobRow({
)
}
+function StatePill({ children, tone }: { children: string; tone: keyof typeof PILL_TONE }) {
+ return (
+
+ {children}
+
+ )
+}
+
function EmptyState({
actionLabel,
description,
@@ -605,6 +606,8 @@ function CronEditorDialog({
onClose: () => void
onSave: (values: EditorValues) => Promise
}) {
+ const { t } = useI18n()
+ const c = t.cron
const open = editor.mode !== 'closed'
const isEdit = editor.mode === 'edit'
const initial = isEdit ? editor.job : null
@@ -647,7 +650,7 @@ function CronEditorDialog({
}
}
- const scheduleHint = scheduleSummary(selectedScheduleOption, schedule)
+ const scheduleHint = scheduleSummary(selectedScheduleOption, schedule, c)
async function handleSubmit(event: React.FormEvent) {
event.preventDefault()
@@ -655,7 +658,7 @@ function CronEditorDialog({
const trimmedSchedule = schedule.trim()
if (!trimmedPrompt || !trimmedSchedule) {
- setError('Prompt and schedule are required.')
+ setError(c.promptScheduleRequired)
return
}
@@ -671,7 +674,7 @@ function CronEditorDialog({
schedule: trimmedSchedule
})
} catch (err) {
- setError(err instanceof Error ? err.message : 'Failed to save cron job')
+ setError(err instanceof Error ? err.message : c.failedSave)
} finally {
setSaving(false)
}
@@ -681,60 +684,56 @@ function CronEditorDialog({