diff --git a/web/src/Cron.tsx b/web/src/Cron.tsx index 17dfb4d..23ffb99 100644 --- a/web/src/Cron.tsx +++ b/web/src/Cron.tsx @@ -1,6 +1,7 @@ import { useCallback, useEffect, useRef, useState } from 'react' import { api, CronJob, CronOverview, CronRun, CronTimer, LogEntry } from './api' import { Logs } from './Services' +import { Btn, Loading, Spinner, toast } from './ui' const fmtTime = (ms: number) => { const d = new Date(ms); return d.toLocaleDateString(undefined, { weekday: 'short', month: 'short', day: '2-digit' }) + ' ' + d.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }) } function rel(ms: number): string { @@ -39,7 +40,7 @@ function SourceEditor({ name, onClose, onSaved }: { name: string; onClose: () => async function save() { if (text === null) return setBusy(true); setErr('') - try { await api.cronWriteSource(name, text); onSaved(); onClose() } + try { await api.cronWriteSource(name, text); toast(`${srcLabel(name)} saved`); onSaved(); onClose() } catch (e) { setErr(e instanceof Error ? e.message : 'save failed') } finally { setBusy(false) } } @@ -48,10 +49,10 @@ function SourceEditor({ name, onClose, onSaved }: { name: string; onClose: () =>

{srcLabel(name)}

{!editable &&
Read-only: writing this file needs passwordless sudo on the host.
} - {text === null ?
…
: