Skip to content

ServerKit is a lightweight, modern server control panel for managing web applications, databases, and services on your VPS or dedicated server. Built with Python/Flask backend and React frontend.

feat(cron): rebuild /cron on the Domains list pattern

Juan Denisb83cb5ca8285
diff --git a/backend/app/services/cron_service.py b/backend/app/services/cron_service.py
index fe5b78f8..b4a31c04 100644
--- a/backend/app/services/cron_service.py
+++ b/backend/app/services/cron_service.py
@@ -162,6 +162,18 @@ class CronService:
'source': 'serverkit'
})
+ # Enrich exactly like jobs_for_application(): a human schedule, the next
+ # fire time, and the last-run join (plan 34). The admin list page renders
+ # Last run / Next run / Status columns off these, so both surfaces have
+ # to agree — leaving it out here is what left /cron showing enabled-only.
+ for job in jobs:
+ job_id = str(job.get('id', ''))
+ job['tracked'] = bool(job.get('tracked', False))
+ job['schedule_human'] = (job.get('description')
+ or cls._describe_schedule(job.get('schedule', '')))
+ job['next_run'] = cls._next_run(job.get('schedule', ''))
+ cls._attach_run_tracking(job, job_id)
+
return {
'success': True,
'jobs': jobs,
diff --git a/backend/tests/test_cron_runs.py b/backend/tests/test_cron_runs.py
index 58ad91f2..777fc493 100644
--- a/backend/tests/test_cron_runs.py
+++ b/backend/tests/test_cron_runs.py
@@ -211,3 +211,48 @@ def test_run_now_records_history(app, cron_store, monkeypatch):
runs = CronRunService.recent_runs(jid)
assert len(runs) == 1
assert runs[0]['status'] == 'success'
+
+
+# --------------------------------------------------------------------------- #
+# list_jobs() enrichment — the admin /cron table renders Last run / Next run /
+# Status straight off these keys, so the list has to carry the same joins
+# jobs_for_application() does. Before this, only the for-app surface had them.
+# --------------------------------------------------------------------------- #
+
+def test_list_jobs_carries_schedule_and_next_run(app, cron_store):
+ CronService.add_job('0 0 * * *', '/usr/bin/task.sh', name='Nightly')
+
+ job = CronService.list_jobs()['jobs'][0]
+
+ assert job['schedule_human']
+ assert job['next_run'] # croniter resolves a concrete next fire
+ assert job['tracked'] is False
+
+
+def test_list_jobs_carries_last_run_join(app, cron_store, monkeypatch):
+ import subprocess
+
+ jid = CronService.add_job('0 0 * * *', '/bin/false', name='Flaky')['job_id']
+
+ class _Result:
+ returncode = 1
+ stdout = ''
+ stderr = 'boom'
+
+ monkeypatch.setattr(subprocess, 'run', lambda *a, **k: _Result())
+ CronService.run_job_now(jid)
+
+ job = next(j for j in CronService.list_jobs()['jobs'] if str(j['id']) == str(jid))
+
+ assert job['last_status'] == 'failure'
+ assert job['last_run']
+ assert job['success_rate'] == 0.0
+
+
+def test_list_jobs_without_history_has_null_run_fields(app, cron_store):
+ CronService.add_job('*/5 * * * *', '/usr/bin/task.sh', name='Fresh')
+
+ job = CronService.list_jobs()['jobs'][0]
+
+ assert job['last_run'] is None
+ assert job['last_status'] is None
diff --git a/frontend/src/pages/CronJobs.jsx b/frontend/src/pages/CronJobs.jsx
index 355dcb48..a9b5f177 100644
--- a/frontend/src/pages/CronJobs.jsx
+++ b/frontend/src/pages/CronJobs.jsx
@@ -1,22 +1,83 @@
-import { useState, useEffect } from 'react';
+import { useState, useEffect, useCallback } from 'react';
import api from '../services/api';
import { useToast } from '../contexts/ToastContext';
+import { useAuth } from '../contexts/AuthContext';
import { useConfirm } from '../hooks/useConfirm';
import EmptyState from '../components/EmptyState';
import Modal from '@/components/Modal';
import {
- Clock, CheckCircle, Monitor, Activity, Plus, RefreshCw,
- Play, Pause, Pencil, Trash2, Search,
+ Clock, Plus, RefreshCw, Play, Pause, Trash2, Pencil,
} from 'lucide-react';
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
import { Textarea } from '@/components/ui/textarea';
import { Checkbox } from '@/components/ui/checkbox';
-import { MetricCard, Pill, SegControl, PageTopbar } from '@/components/ds';
+import { Switch } from '@/components/ui/switch';
+import { Pill, SegControl, SearchField, PageTopbar, DataTable, Drawer } from '@/components/ds';
+
+// Fallback humanizer for the handful of schedules the backend can't describe.
+const SCHEDULE_LABELS = {
+ '* * * * *': 'Every minute',
+ '0 * * * *': 'Every hour',
+ '0 0 * * *': 'Daily at midnight',
+ '0 0 * * 0': 'Weekly on Sunday',
+ '0 0 1 * *': 'Monthly on the 1st',
+ '0 0 * * 1-5': 'Weekdays at midnight',
+ '0 */6 * * *': 'Every 6 hours',
+ '0 */12 * * *': 'Every 12 hours',
+ '*/5 * * * *': 'Every 5 minutes',
+ '*/15 * * * *': 'Every 15 minutes',
+ '*/30 * * * *': 'Every 30 minutes',
+};
+
+const describeSchedule = (job) => (
+ job.schedule_human || SCHEDULE_LABELS[job.schedule] || job.schedule
+);
+
+// The browser's zone, not the host's — times are ISO strings rendered client
+// side, so this is what the reader is actually seeing. Say so rather than
+// implying the schedule's own timezone.
+const VIEWER_TZ = Intl.DateTimeFormat().resolvedOptions().timeZone || 'local time';
+
+function formatWhen(iso) {
+ if (!iso) return '—';
+ const d = new Date(iso);
+ if (Number.isNaN(d.getTime())) return '—';
+ const diffMs = Date.now() - d.getTime();
+ const mins = Math.round(Math.abs(diffMs) / 60000);
+ const ago = diffMs >= 0;
+ let rel;
+ if (mins < 1) rel = 'just now';
+ else if (mins < 60) rel = `${mins}m`;
+ else if (mins < 1440) rel = `${Math.round(mins / 60)}h`;
+ else rel = `${Math.round(mins / 1440)}d`;
+ if (rel === 'just now') return rel;
+ return ago ? `${rel} ago` : `in ${rel}`;
+}
+
+function formatDuration(seconds) {
+ if (seconds == null) return '—';
+ if (seconds < 10) return `${Number(seconds).toFixed(1)}s`;
+ if (seconds < 60) return `${Math.round(seconds)}s`;
+ const m = Math.floor(seconds / 60);
+ const s = Math.round(seconds % 60);
+ return `${m}m ${String(s).padStart(2, '0')}s`;
+}
+
+// One status per job, folding "is it on?" and "did it last succeed?" together —
+// the two questions the list exists to answer.
+function jobState(job) {
+ if (!job.enabled) return { key: 'paused', kind: 'gray', label: 'Paused' };
+ if (job.last_status === 'failure') return { key: 'failed', kind: 'red', label: 'Failed' };
+ if (job.last_status === 'success') return { key: 'active', kind: 'green', label: 'Healthy' };
+ // Enabled but nothing recorded: either never fired yet, or not tracked.
+ return { key: 'active', kind: 'cyan', label: job.tracked ? 'No runs yet' : 'Untracked' };
+}
const CronJobs = () => {
const toast = useToast();
+ const { isAdmin } = useAuth();
const { confirm } = useConfirm();
const [status, setStatus] = useState(null);
const [jobs, setJobs] = useState([]);
@@ -26,9 +87,10 @@ const CronJobs = () => {
// List filters (client-side, over already-loaded jobs)
const [filter, setFilter] = useState('all');
- const [query, setQuery] = useState('');
+ const [search, setSearch] = useState('');
- // Modal states
+ // Drawer + modal states
+ const [drawerJob, setDrawerJob] = useState(null);
const [showJobModal, setShowJobModal] = useState(false);
const [editingJob, setEditingJob] = useState(null);
const [runningJobId, setRunningJobId] = useState(null);
@@ -41,22 +103,17 @@ const CronJobs = () => {
schedule: '',
description: '',
usePreset: true,
- preset: 'daily'
+ preset: 'daily',
});
- useEffect(() => {
- loadData();
- }, []);
-
- const loadData = async () => {
+ const loadData = useCallback(async () => {
try {
setLoading(true);
const [statusRes, jobsRes, presetsRes] = await Promise.all([
api.getCronStatus(),
api.getCronJobs(),
- api.getCronPresets()
+ api.getCronPresets(),
]);
-
setStatus(statusRes);
setJobs(jobsRes.jobs || []);
setPresets(presetsRes.presets || {});
@@ -65,6 +122,21 @@ const CronJobs = () => {
} finally {
setLoading(false);
}
+ }, []);
+
+ useEffect(() => {
+ loadData();
+ }, [loadData]);
+
+ const resetForm = () => {
+ setJobForm({
+ name: '',
+ command: '',
+ schedule: '',
+ description: '',
+ usePreset: true,
+ preset: 'daily',
+ });
};
const openCreateModal = () => {
@@ -82,7 +154,7 @@ const CronJobs = () => {
schedule: job.schedule || '',
description: job.description || '',
usePreset: !!presetKey,
- preset: presetKey || 'daily'
+ preset: presetKey || 'daily',
});
setShowJobModal(true);
};
@@ -96,15 +168,12 @@ const CronJobs = () => {
const handleSubmitJob = async (e) => {
e.preventDefault();
try {
- const schedule = jobForm.usePreset
- ? presets[jobForm.preset]
- : jobForm.schedule;
-
+ const schedule = jobForm.usePreset ? presets[jobForm.preset] : jobForm.schedule;
const payload = {
name: jobForm.name,
command: jobForm.command,
- schedule: schedule,
- description: jobForm.description
+ schedule,
+ description: jobForm.description,
};
if (editingJob) {
@@ -116,6 +185,7 @@ const CronJobs = () => {
}
closeJobModal();
+ setDrawerJob(null);
loadData();
} catch (err) {
toast.error(err.message);
@@ -123,11 +193,15 @@ const CronJobs = () => {
};
const handleDeleteJob = async (jobId) => {
- const confirmed = await confirm({ title: 'Delete Cron Job', message: 'Are you sure you want to delete this cron job?' });
+ const confirmed = await confirm({
+ title: 'Delete Cron Job',
+ message: 'Are you sure you want to delete this cron job?',
+ });
if (!confirmed) return;
try {
await api.deleteCronJob(jobId);
toast.success('Cron job deleted');
+ setDrawerJob(null);
loadData();
} catch (err) {
toast.error(err.message);
@@ -154,8 +228,9 @@ const CronJobs = () => {
jobName: jobs.find(j => j.id === jobId)?.name || jobId,
exitCode: result.exit_code,
stdout: result.stdout,
- stderr: result.stderr
+ stderr: result.stderr,
});
+ loadData();
} else {
toast.error(result.error || 'Job execution failed');
}
@@ -166,56 +241,35 @@ const CronJobs = () => {
}
};
- const resetForm = () => {
- setJobForm({
- name: '',
- command: '',
- schedule: '',
- description: '',
- usePreset: true,
- preset: 'daily'
- });
- };
-
- const getScheduleDescription = (schedule) => {
- const descriptions = {
- '* * * * *': 'Every minute',
- '0 * * * *': 'Every hour',
- '0 0 * * *': 'Daily at midnight',
- '0 0 * * 0': 'Weekly on Sunday',
- '0 0 1 * *': 'Monthly on the 1st',
- '0 0 * * 1-5': 'Weekdays at midnight',
- '0 */6 * * *': 'Every 6 hours',
- '0 */12 * * *': 'Every 12 hours',
- '*/5 * * * *': 'Every 5 minutes',
- '*/15 * * * *': 'Every 15 minutes',
- '*/30 * * * *': 'Every 30 minutes'
- };
- return descriptions[schedule] || schedule;
- };
-
const enabledCount = jobs.filter(j => j.enabled).length;
- const disabledCount = jobs.length - enabledCount;
-
- const serviceSub = status?.type === 'cron'
- ? (status?.running ? 'daemon running' : 'daemon stopped')
- : (status?.type === 'serverkit_scheduler' ? 'internal scheduler' : null);
-
- const q = query.trim().toLowerCase();
- const shownJobs = jobs.filter(job => (
- (filter === 'all' || (filter === 'enabled' ? job.enabled : !job.enabled))
- && (!q
+ const failedCount = jobs.filter(j => j.enabled && j.last_status === 'failure').length;
+ const pausedCount = jobs.length - enabledCount;
+
+ const q = search.trim().toLowerCase();
+ const shown = jobs.filter((job) => {
+ const state = jobState(job);
+ const matchesFilter = filter === 'all'
+ || (filter === 'failed' ? state.key === 'failed'
+ : filter === 'paused' ? state.key === 'paused'
+ : state.key === 'active');
+ const matchesQuery = !q
|| (job.name || '').toLowerCase().includes(q)
- || (job.command || '').toLowerCase().includes(q))
- ));
+ || (job.command || '').toLowerCase().includes(q);
+ return matchesFilter && matchesQuery;
+ });
- if (loading) {
- return (
- <div className="page-container cron-page">
- <EmptyState loading loadingVariant="table" size="lg" title="Loading cron jobs..." />
- </div>
- );
- }
+ const filterOptions = [
+ { value: 'all', label: 'All', count: jobs.length },
+ { value: 'active', label: 'Active', count: enabledCount - failedCount },
+ { value: 'failed', label: 'Failed', count: failedCount },
+ { value: 'paused', label: 'Paused', count: pausedCount },
+ ];
+
+ const serviceNote = status?.available === false
+ ? 'Cron service unavailable'
+ : status?.type === 'cron'
+ ? (status?.running ? null : 'cron daemon stopped')
+ : (status?.type === 'serverkit_scheduler' ? 'internal scheduler' : null);
return (
<div className="page-container cron-page">
@@ -224,302 +278,530 @@ const CronJobs = () => {
title="Cron Jobs"
actions={(
<>
- <Button variant="outline" onClick={loadData}>
- <RefreshCw size={15} />
- Refresh
+ <Button variant="outline" size="sm" onClick={loadData}>
+ <RefreshCw size={15} /> Refresh
</Button>
- <Button onClick={openCreateModal}>
- <Plus size={15} />
- Create Job
+ <Button size="sm" onClick={openCreateModal}>
+ <Plus size={15} /> Create job
</Button>
+ <SearchField
+ value={search}
+ onSearch={setSearch}
+ placeholder="Search jobs or commands…"
+ />
</>
)}
/>
{error && (
- <div className="alert alert-danger">
+ <div className="error-banner">
{error}
- <button type="button" onClick={() => setError(null)} className="alert-close">&times;</button>
+ <button
+ type="button"
+ className="error-banner__close"
+ onClick={() => setError(null)}
+ aria-label="Dismiss error"
+ >
+ ×
+ </button>
</div>
)}
- {/* KPI strip */}
- <div className="cron-kpis">
- <MetricCard tone="accent" icon={<Clock size={16} />} value={jobs.length} label="Cron jobs">
- <div className="sk-kpi__sub"><span>{enabledCount} enabled</span></div>
- </MetricCard>
- <MetricCard tone="green" icon={<CheckCircle size={16} />} value={enabledCount} label="Active jobs">
- {disabledCount > 0 && (
- <div className="sk-kpi__sub"><span>{disabledCount} disabled</span></div>
- )}
- </MetricCard>
- <MetricCard
- tone={status?.available ? 'green' : 'amber'}
- icon={<Activity size={16} />}
- value={status?.available ? 'Available' : 'Not Available'}
- label="Cron service"
- >
- {serviceSub && (
- <div className="sk-kpi__sub"><span>{serviceSub}</span></div>
- )}
- </MetricCard>
- <MetricCard tone="cyan" icon={<Monitor size={16} />} value={status?.platform || 'Unknown'} label="Platform" />
- </div>
-
- {/* Jobs list */}
- {jobs.length === 0 ? (
+ {loading ? (
+ <EmptyState loading loadingVariant="table" title="Loading cron jobs..." />
+ ) : jobs.length === 0 ? (
<EmptyState
icon={Clock}
- title="No Cron Jobs"
+ title="No cron jobs"
description="No scheduled jobs found. Create your first cron job to automate tasks."
- action={<Button onClick={openCreateModal}>Create Job</Button>}
+ action={<Button onClick={openCreateModal}><Plus size={16} /> Create job</Button>}
/>
) : (
- <>
+ <div className="cron-body">
+ {/* No KPI strip: every number it carried is already on the
+ segment you'd click to act on it (mirrors /domains). */}
<div className="cron-listhead">
- <h2>Scheduled jobs</h2>
- <div className="cron-search">
- <Search size={15} />
- <input
- type="text"
- placeholder="Search jobs or commands…"
- value={query}
- onChange={(e) => setQuery(e.target.value)}
- />
- </div>
- <SegControl
- value={filter}
- onChange={setFilter}
- options={[
- { value: 'all', label: 'All' },
- { value: 'enabled', label: 'Enabled' },
- { value: 'disabled', label: 'Disabled' },
- ]}
- />
+ <SegControl value={filter} onChange={setFilter} options={filterOptions} />
+ {serviceNote && <span className="cron-servicenote">{serviceNote}</span>}
</div>
- {shownJobs.length === 0 ? (
- <div className="cron-empty">No jobs match the current filter.</div>
+ {shown.length === 0 ? (
+ <div className="cron-empty">
+ {q ? `No jobs match “${search.trim()}”.` : 'No jobs match this filter.'}
+ </div>
) : (
<div className="cron-card">
- <table className="sk-dtable cron-table">
- <thead>
- <tr>
- <th>Job</th>
- <th>Schedule</th>
- <th>Status</th>
- <th aria-label="Actions" />
- </tr>
- </thead>
- <tbody>
- {shownJobs.map((job) => {
- const readable = getScheduleDescription(job.schedule);
- return (
- <tr
- key={job.id}
- className={`is-clickable${job.enabled ? '' : ' is-disabled'}`}
- onClick={() => openEditModal(job)}
- >
- <td>
- <div className="sk-cell-name">
- <span className="cron-ico"><Clock size={15} /></span>
- <div className="cron-jobcell">
- <div className="cron-jobcell__name">{job.name || 'Unnamed Job'}</div>
- {job.description && (
- <div className="cron-jobcell__desc">{job.description}</div>
- )}
- <div className="sk-cell-sub cron-jobcell__cmd" title={job.command}>
- {job.command}
- </div>
- </div>
+ <DataTable
+ tableClassName="sk-dtable cron-table"
+ sortable={false}
+ data={shown}
+ keyField="id"
+ onRowClick={setDrawerJob}
+ rowClassName={(job) => (job.enabled ? undefined : 'is-disabled')}
+ columns={[
+ {
+ key: 'name',
+ header: 'Job',
+ render: (job) => (
+ <div className="sk-cell-name">
+ <span className="cron-ico"><Clock size={15} /></span>
+ <div className="cron-jobcell">
+ <div className="cron-jobcell__name">
+ {job.name || 'Unnamed job'}
</div>
- </td>
- <td>
- <span className="cron-sched"><Clock size={11} />{job.schedule}</span>
- {readable !== job.schedule && (
- <div className="cron-sched-readable">{readable}</div>
- )}
- </td>
- <td>
- <Pill kind={job.enabled ? 'green' : 'gray'}>
- {job.enabled ? 'Enabled' : 'Disabled'}
- </Pill>
- </td>
- <td onClick={e => e.stopPropagation()}>
- <div className="cron-actions">
- <Button
- variant="outline"
- size="sm"
- onClick={() => handleRunJob(job.id)}
- disabled={runningJobId === job.id}
- title="Run now"
- >
- {runningJobId === job.id ? (
- <span className="spinner-inline"></span>
- ) : (
- <Play size={14} />
- )}
- </Button>
- <Button
- variant="outline"
- size="sm"
- onClick={() => openEditModal(job)}
- title="Edit"
- >
- <Pencil size={14} />
- </Button>
- <Button
- variant="outline"
- size="sm"
- onClick={() => handleToggleJob(job.id, job.enabled)}
- title={job.enabled ? 'Disable' : 'Enable'}
- >
- {job.enabled ? <Pause size={14} /> : <Play size={14} />}
- </Button>
- <Button
- variant="destructive"
- size="sm"
- onClick={() => handleDeleteJob(job.id)}
- title="Delete"
- >
- <Trash2 size={14} />
- </Button>
+ <div className="sk-cell-sub cron-jobcell__cmd" title={job.command}>
+ {job.command}
</div>
- </td>
- </tr>
- );
- })}
- </tbody>
- </table>
+ </div>
+ </div>
+ ),
+ },
+ {
+ key: 'schedule',
+ header: 'Schedule',
+ render: (job) => (
+ <>
+ <span className="cron-sched">
+ <Clock size={11} />{job.schedule}
+ </span>
+ <div className="cron-sched-readable">
+ {describeSchedule(job)}
+ </div>
+ </>
+ ),
+ },
+ {
+ key: 'last_run',
+ header: 'Last run',
+ cellClassName: 'cron-cell-mono',
+ render: (job) => formatWhen(job.last_run),
+ },
+ {
+ key: 'next_run',
+ header: 'Next run',
+ cellClassName: 'cron-cell-mono',
+ render: (job) => (
+ job.enabled ? formatWhen(job.next_run) : 'paused'
+ ),
+ },
+ {
+ key: 'status',
+ header: 'Status',
+ render: (job) => {
+ const state = jobState(job);
+ return <Pill kind={state.kind}>{state.label}</Pill>;
+ },
+ },
+ {
+ key: 'enabled',
+ header: 'On',
+ render: (job) => (
+ <span
+ className="cron-switch"
+ onClick={(e) => e.stopPropagation()}
+ role="presentation"
+ >
+ <Switch
+ checked={!!job.enabled}
+ onCheckedChange={() => handleToggleJob(job.id, job.enabled)}
+ aria-label={job.enabled ? 'Disable job' : 'Enable job'}
+ />
+ </span>
+ ),
+ },
+ {
+ key: 'run',
+ header: '',
+ cellClassName: 'cron-cell-actions',
+ render: (job) => (
+ <span onClick={(e) => e.stopPropagation()} role="presentation">
+ <Button
+ variant="outline"
+ size="sm"
+ onClick={() => handleRunJob(job.id)}
+ disabled={runningJobId === job.id}
+ title="Run now"
+ >
+ {runningJobId === job.id
+ ? <span className="spinner-inline" />
+ : <Play size={14} />}
+ </Button>
+ </span>
+ ),
+ },
+ ]}
+ />
</div>
)}
- </>
+
+ <div className="cron-tznote">
+ <Clock size={13} /> Times shown in your local timezone · {VIEWER_TZ}
+ </div>
+ </div>
)}
+ <CronDrawer
+ job={drawerJob}
+ isAdmin={isAdmin}
+ running={drawerJob ? runningJobId === drawerJob.id : false}
+ onClose={() => setDrawerJob(null)}
+ onRefresh={loadData}
+ onRun={handleRunJob}
+ onEdit={(j) => { setDrawerJob(null); openEditModal(j); }}
+ onDelete={handleDeleteJob}
+ onToggle={handleToggleJob}
+ />
+
{/* Create/Edit Job Modal */}
<Modal open={showJobModal} onClose={closeJobModal} title={editingJob ? 'Edit Cron Job' : 'Create Cron Job'}>
- <form onSubmit={handleSubmitJob}>
- <div className="form-group">
- <Label htmlFor="job-name">Job Name</Label>
- <Input
- id="job-name"
- type="text"
- value={jobForm.name}
- onChange={(e) => setJobForm({...jobForm, name: e.target.value})}
- placeholder="My Backup Job"
- required
- />
- </div>
+ <form onSubmit={handleSubmitJob}>
+ <div className="form-group">
+ <Label htmlFor="job-name">Job Name</Label>
+ <Input
+ id="job-name"
+ type="text"
+ value={jobForm.name}
+ onChange={(e) => setJobForm({ ...jobForm, name: e.target.value })}
+ placeholder="My Backup Job"
+ required
+ />
+ </div>
- <div className="form-group">
- <Label htmlFor="job-command">Command</Label>
- <Input
- id="job-command"
- type="text"
- value={jobForm.command}
- onChange={(e) => setJobForm({...jobForm, command: e.target.value})}
- placeholder="/usr/bin/backup.sh"
- required
- />
- <span className="form-help">The command or script to execute</span>
- </div>
+ <div className="form-group">
+ <Label htmlFor="job-command">Command</Label>
+ <Input
+ id="job-command"
+ type="text"
+ value={jobForm.command}
+ onChange={(e) => setJobForm({ ...jobForm, command: e.target.value })}
+ placeholder="/usr/bin/backup.sh"
+ required
+ />
+ <span className="form-help">The command or script to execute</span>
+ </div>
- <div className="form-group">
- <label className="checkbox-label">
- <Checkbox
- checked={jobForm.usePreset}
- onCheckedChange={(checked) => setJobForm({...jobForm, usePreset: !!checked})}
- />
- <span>Use preset schedule</span>
- </label>
- </div>
+ <div className="form-group">
+ <label className="checkbox-label">
+ <Checkbox
+ checked={jobForm.usePreset}
+ onCheckedChange={(checked) => setJobForm({ ...jobForm, usePreset: !!checked })}
+ />
+ <span>Use preset schedule</span>
+ </label>
+ </div>
- {jobForm.usePreset ? (
- <div className="form-group">
- <Label htmlFor="job-preset">Schedule Preset</Label>
- <select
- id="job-preset"
- value={jobForm.preset}
- onChange={(e) => setJobForm({...jobForm, preset: e.target.value})}
- >
- {Object.entries(presets).map(([key, value]) => (
- <option key={key} value={key}>
- {key.replace(/_/g, ' ')} ({value})
- </option>
- ))}
- </select>
- </div>
- ) : (
- <div className="form-group">
- <Label htmlFor="job-schedule">Cron Schedule</Label>
- <Input
- id="job-schedule"
- type="text"
- value={jobForm.schedule}
- onChange={(e) => setJobForm({...jobForm, schedule: e.target.value})}
- placeholder="0 0 * * *"
- required={!jobForm.usePreset}
- />
- <span className="form-help">
- Format: minute hour day month weekday (e.g., &quot;0 0 * * *&quot; for daily at midnight)
- </span>
- </div>
- )}
-
- <div className="form-group">
- <Label htmlFor="job-description">Description (optional)</Label>
- <Textarea
- id="job-description"
- value={jobForm.description}
- onChange={(e) => setJobForm({...jobForm, description: e.target.value})}
- placeholder="What does this job do?"
- rows={2}
- />
- </div>
- <div className="modal-actions">
- <Button type="button" variant="outline" onClick={closeJobModal}>
- Cancel
- </Button>
- <Button type="submit">
- {editingJob ? 'Save Changes' : 'Create Job'}
- </Button>
- </div>
- </form>
+ {jobForm.usePreset ? (
+ <div className="form-group">
+ <Label htmlFor="job-preset">Schedule Preset</Label>
+ <select
+ id="job-preset"
+ value={jobForm.preset}
+ onChange={(e) => setJobForm({ ...jobForm, preset: e.target.value })}
+ >
+ {Object.entries(presets).map(([key, value]) => (
+ <option key={key} value={key}>
+ {key.replace(/_/g, ' ')} ({value})
+ </option>
+ ))}
+ </select>
+ </div>
+ ) : (
+ <div className="form-group">
+ <Label htmlFor="job-schedule">Cron Schedule</Label>
+ <Input
+ id="job-schedule"
+ type="text"
+ value={jobForm.schedule}
+ onChange={(e) => setJobForm({ ...jobForm, schedule: e.target.value })}
+ placeholder="0 0 * * *"
+ required={!jobForm.usePreset}
+ />
+ <span className="form-help">
+ Format: minute hour day month weekday (e.g., &quot;0 0 * * *&quot; for daily at midnight)
+ </span>
+ </div>
+ )}
+
+ <div className="form-group">
+ <Label htmlFor="job-description">Description (optional)</Label>
+ <Textarea
+ id="job-description"
+ value={jobForm.description}
+ onChange={(e) => setJobForm({ ...jobForm, description: e.target.value })}
+ placeholder="What does this job do?"
+ rows={2}
+ />
+ </div>
+ <div className="modal-actions">
+ <Button type="button" variant="outline" onClick={closeJobModal}>
+ Cancel
+ </Button>
+ <Button type="submit">
+ {editingJob ? 'Save Changes' : 'Create Job'}
+ </Button>
+ </div>
+ </form>
</Modal>
{/* Run Output Modal */}
<Modal open={!!runOutput} onClose={() => setRunOutput(null)} title={runOutput ? `Run Output: ${runOutput.jobName}` : ''}>
- {runOutput && (
- <div className="run-output">
- <div className="run-output-exit">
- <span className="run-output-label">Exit Code</span>
- <Pill kind={runOutput.exitCode === 0 ? 'green' : 'red'}>
- {runOutput.exitCode}
- </Pill>
- </div>
- {runOutput.stdout && (
- <div className="run-output-section">
- <span className="run-output-label">stdout</span>
- <pre className="run-output-pre">{runOutput.stdout}</pre>
- </div>
- )}
- {runOutput.stderr && (
- <div className="run-output-section">
- <span className="run-output-label">stderr</span>
- <pre className="run-output-pre run-output-pre--error">{runOutput.stderr}</pre>
- </div>
- )}
- {!runOutput.stdout && !runOutput.stderr && (
- <p className="text-muted">No output produced.</p>
- )}
+ {runOutput && (
+ <div className="run-output">
+ <div className="run-output-exit">
+ <span className="run-output-label">Exit Code</span>
+ <Pill kind={runOutput.exitCode === 0 ? 'green' : 'red'}>
+ {runOutput.exitCode}
+ </Pill>
+ </div>
+ {runOutput.stdout && (
+ <div className="run-output-section">
+ <span className="run-output-label">stdout</span>
+ <pre className="run-output-pre">{runOutput.stdout}</pre>
</div>
)}
- <div className="modal-actions">
- <Button variant="outline" onClick={() => setRunOutput(null)}>Close</Button>
- </div>
+ {runOutput.stderr && (
+ <div className="run-output-section">
+ <span className="run-output-label">stderr</span>
+ <pre className="run-output-pre run-output-pre--error">{runOutput.stderr}</pre>
+ </div>
+ )}
+ {!runOutput.stdout && !runOutput.stderr && (
+ <p className="text-muted">No output produced.</p>
+ )}
+ </div>
+ )}
+ <div className="modal-actions">
+ <Button variant="outline" onClick={() => setRunOutput(null)}>Close</Button>
+ </div>
</Modal>
</div>
);
};
+// Row-click drawer: the job's configuration plus its recorded run history.
+// History comes from GET /cron/jobs/<id>/runs, which is admin-only and only
+// returns anything for jobs whose crontab line carries the tracking shim — both
+// of which are surfaced rather than silently rendering an empty table.
+function CronDrawer({ job, isAdmin, running, onClose, onRefresh, onRun, onEdit, onDelete, onToggle }) {
+ const toast = useToast();
+ const [history, setHistory] = useState(null);
+ const [historyLoading, setHistoryLoading] = useState(false);
+ const [trackingBusy, setTrackingBusy] = useState(false);
+
+ const loadHistory = useCallback(async (jobId) => {
+ setHistoryLoading(true);
+ try {
+ const res = await api.getCronJobRuns(jobId);
+ setHistory({ runs: res.runs || [], stats: res.stats || {} });
+ } catch {
+ // Non-admin (403) or a transient failure: fall back to the
+ // config-only drawer rather than blocking it behind an error.
+ setHistory(null);
+ } finally {
+ setHistoryLoading(false);
+ }
+ }, []);
+
+ useEffect(() => {
+ if (!job || !isAdmin) {
+ setHistory(null);
+ return;
+ }
+ loadHistory(job.id);
+ }, [job, isAdmin, loadHistory]);
+
+ // The Drawer stays mounted with open={!!job} (same as /domains) so closing
+ // it plays the slide-out instead of vanishing; the body is what unmounts.
+ const state = job ? jobState(job) : { kind: 'gray', label: '' };
+ const stats = history?.stats || {};
+ const runs = history?.runs || [];
+ const lastOutput = runs.find(r => r.output_tail)?.output_tail;
+ const successRate = stats.success_rate == null ? null : Math.round(stats.success_rate * 1000) / 10;
+ const rateTone = successRate == null ? 'none'
+ : successRate > 99 ? 'good'
+ : successRate > 95 ? 'warn' : 'bad';
+
+ const handleTracking = async () => {
+ setTrackingBusy(true);
+ try {
+ await api.setCronTracking(job.id, { enabled: !job.tracked });
+ toast.success(job.tracked ? 'Run tracking disabled' : 'Run tracking enabled');
+ onClose();
+ onRefresh?.();
+ } catch (err) {
+ toast.error(err.message);
+ } finally {
+ setTrackingBusy(false);
+ }
+ };
+
+ return (
+ <Drawer
+ open={!!job}
+ onOpenChange={(open) => { if (!open) onClose(); }}
+ title={job?.name || 'Unnamed job'}
+ subtitle={job ? `${job.schedule} · ${describeSchedule(job)}` : ''}
+ icon={<Clock size={18} />}
+ width={640}
+ headerExtra={job && (
+ <div className="cron-drawer__headeractions">
+ <Button
+ size="sm"
+ onClick={() => onRun(job.id)}
+ disabled={running}
+ >
+ {running ? <span className="spinner-inline" /> : <Play size={14} />} Run now
+ </Button>
+ </div>
+ )}
+ >
+ {job && (
+ <div className="cron-drawer">
+ <section className="cron-drawer__section">
+ <h3 className="cron-drawer__sectiontitle">Configuration</h3>
+ <div className="cron-drawer__info">
+ <div className="cron-inforow">
+ <span className="k">Schedule</span>
+ <span className="v">{job.schedule}</span>
+ </div>
+ <div className="cron-inforow">
+ <span className="k">Command</span>
+ <span className="v cron-inforow__cmd">{job.command}</span>
+ </div>
+ {job.description && (
+ <div className="cron-inforow">
+ <span className="k">Description</span>
+ <span className="v">{job.description}</span>
+ </div>
+ )}
+ <div className="cron-inforow">
+ <span className="k">Next run</span>
+ <span className="v">{job.enabled ? formatWhen(job.next_run) : 'paused'}</span>
+ </div>
+ <div className="cron-inforow">
+ <span className="k">Status</span>
+ <span className="v"><Pill kind={state.kind}>{state.label}</Pill></span>
+ </div>
+ </div>
+ </section>
+
+ <section className="cron-drawer__section">
+ <h3 className="cron-drawer__sectiontitle">Run history</h3>
+
+ {!isAdmin ? (
+ <p className="cron-drawer__hint">
+ Run history is an admin-only surface.
+ </p>
+ ) : !job.tracked ? (
+ <div className="cron-drawer__tracking">
+ <p className="cron-drawer__hint">
+ Run tracking is off for this job, so nothing is recorded. Turning it
+ on rewrites the crontab line to report each run&apos;s exit code,
+ duration, and output tail.
+ </p>
+ <Button variant="outline" size="sm" onClick={handleTracking} disabled={trackingBusy}>
+ {trackingBusy ? 'Enabling…' : 'Enable run tracking'}
+ </Button>
+ </div>
+ ) : historyLoading ? (
+ <EmptyState loading loadingVariant="table" title="Loading run history..." />
+ ) : runs.length === 0 ? (
+ <p className="cron-drawer__hint">No runs recorded yet.</p>
+ ) : (
+ <>
+ <div className="cron-specs">
+ <div className="cron-spec">
+ <div className="l">Success rate</div>
+ <div className={`v v--${rateTone}`}>
+ {successRate == null ? '—' : `${successRate}%`}
+ </div>
+ <div className="s">
+ {stats.failure || 0} failed of last {stats.total || 0}
+ </div>
+ </div>
+ <div className="cron-spec">
+ <div className="l">Last run</div>
+ <div className="v">{formatWhen(stats.last_run)}</div>
+ <div className="s">{stats.last_status || 'unknown'}</div>
+ </div>
+ <div className="cron-spec">
+ <div className="l">Cadence</div>
+ <div className="v">{describeSchedule(job)}</div>
+ <div className="s">next {job.enabled ? formatWhen(job.next_run) : 'paused'}</div>
+ </div>
+ </div>
+
+ <div className="cron-drawer__table">
+ <DataTable
+ tableClassName="sk-dtable"
+ sortable={false}
+ data={runs}
+ keyField="id"
+ columns={[
+ {
+ key: 'when',
+ header: 'When',
+ render: (r) => formatWhen(r.finished_at || r.started_at),
+ },
+ {
+ key: 'duration',
+ header: 'Duration',
+ render: (r) => formatDuration(r.duration_seconds),
+ },
+ {
+ key: 'exit',
+ header: 'Exit',
+ render: (r) => (
+ <span className={r.exit_code ? 'cron-exit--bad' : undefined}>
+ {r.exit_code ?? '—'}
+ </span>
+ ),
+ },
+ {
+ key: 'status',
+ header: 'Status',
+ render: (r) => (
+ <Pill kind={r.status === 'success' ? 'green' : 'red'}>
+ {r.status}
+ </Pill>
+ ),
+ },
+ ]}
+ />
+ </div>
+ </>
+ )}
+ </section>
+
+ {lastOutput && (
+ <section className="cron-drawer__section">
+ <h3 className="cron-drawer__sectiontitle">Last output</h3>
+ <pre className="run-output-pre">{lastOutput}</pre>
+ </section>
+ )}
+
+ <section className="cron-drawer__section cron-drawer__danger">
+ <div className="cron-drawer__actions">
+ <Button variant="outline" size="sm" onClick={() => onEdit(job)}>
+ <Pencil size={14} /> Edit
+ </Button>
+ <Button variant="outline" size="sm" onClick={() => onToggle(job.id, job.enabled)}>
+ {job.enabled ? <><Pause size={14} /> Disable</> : <><Play size={14} /> Enable</>}
+ </Button>
+ {job.tracked && (
+ <Button variant="outline" size="sm" onClick={handleTracking} disabled={trackingBusy}>
+ {trackingBusy ? 'Disabling…' : 'Disable run tracking'}
+ </Button>
+ )}
+ <Button variant="destructive" size="sm" onClick={() => onDelete(job.id)}>
+ <Trash2 size={14} /> Delete
+ </Button>
+ </div>
+ </section>
+ </div>
+ )}
+ </Drawer>
+ );
+}
+
export default CronJobs;
diff --git a/frontend/src/styles/pages/_cron.scss b/frontend/src/styles/pages/_cron.scss
index 6789948d..27813598 100644
--- a/frontend/src/styles/pages/_cron.scss
+++ b/frontend/src/styles/pages/_cron.scss
@@ -4,74 +4,32 @@
.cron-page {
- // ── KPI strip ───────────────────────────────────────────
- .cron-kpis {
- display: grid;
- grid-template-columns: repeat(4, 1fr);
- gap: $space-4;
- margin-bottom: $space-5;
-
- @media (max-width: $breakpoint-lg) { grid-template-columns: repeat(2, 1fr); }
- @media (max-width: $breakpoint-sm) { grid-template-columns: 1fr; }
- }
-
- // ── list head: eyebrow + search + segmented filter ──────
+ // ── list head ───────────────────────────────────────────
+ // No KPI strip and no in-body search box: the segmented filter carries the
+ // counts and search lives in the top bar, matching /domains.
.cron-listhead {
display: flex;
align-items: center;
- gap: $space-3;
+ gap: $space-4;
margin-bottom: $space-3;
+ }
- h2 {
- flex: 1;
- min-width: 0;
- margin: 0;
- font-family: var(--mono);
- font-size: 10.5px;
- font-weight: $font-weight-semibold;
- letter-spacing: 0.08em;
- text-transform: uppercase;
- color: var(--text-faint);
- }
-
- @media (max-width: $breakpoint-md) {
- flex-wrap: wrap;
-
- h2 { flex-basis: 100%; }
- .cron-search { flex: 1; width: auto; }
- }
+ .cron-servicenote {
+ font-family: var(--mono);
+ font-size: 11px;
+ color: var(--amber);
}
- .cron-search {
+ .cron-tznote {
display: flex;
align-items: center;
gap: $space-2;
- width: 240px;
- height: 34px;
- padding: 0 $space-3;
- background: var(--surface);
- border: 1px solid var(--border);
- border-radius: $radius-lg;
- @include transition(border-color);
-
- &:focus-within { border-color: var(--accent); }
-
- svg {
- color: var(--text-faint);
- flex-shrink: 0;
- }
-
- input {
- flex: 1;
- min-width: 0;
- background: none;
- border: none;
- outline: none;
- color: var(--text);
- font-size: 13px;
+ margin-top: $space-3;
+ font-family: var(--mono);
+ font-size: 11px;
+ color: var(--text-faint);
- &::placeholder { color: var(--text-faint); }
- }
+ svg { flex-shrink: 0; }
}
// ── jobs table ──────────────────────────────────────────
@@ -93,9 +51,12 @@
}
.cron-table {
- // Schedule / Status fixed; actions column shrinks to fit
- th:nth-child(2) { width: 200px; }
- th:nth-child(3) { width: 110px; }
+ // Job grows; everything after it is sized to its content.
+ th:nth-child(2) { width: 200px; } // Schedule
+ th:nth-child(3) { width: 120px; } // Last run
+ th:nth-child(4) { width: 120px; } // Next run
+ th:nth-child(5) { width: 120px; } // Status
+ th:nth-child(6) { width: 56px; } // On
th:last-child { width: 1%; }
td:last-child { white-space: nowrap; }
@@ -109,6 +70,17 @@
}
}
+ .cron-cell-mono {
+ font-family: var(--mono);
+ font-size: 11.5px;
+ color: var(--text-dim);
+ white-space: nowrap;
+ }
+
+ .cron-cell-actions { text-align: right; }
+
+ .cron-switch { display: inline-flex; }
+
// job cell: accent icon tile + name / description / mono command
.cron-ico {
width: 30px;
@@ -171,51 +143,183 @@
color: var(--text-faint);
}
- .cron-actions {
- display: flex;
- justify-content: flex-end;
- gap: $space-1;
- }
-
@media (max-width: $breakpoint-md) {
.cron-card { overflow-x: auto; }
- .cron-table { min-width: 640px; }
+ .cron-table { min-width: 860px; }
}
+}
- // ── create/edit modal (field labels → mono eyebrows) ────
- .modal {
- .form-group > label:not(.checkbox-label) {
- font-family: var(--mono);
- font-size: 10.5px;
- font-weight: $font-weight-semibold;
- letter-spacing: 0.08em;
- text-transform: uppercase;
- color: var(--text-faint);
- }
+// ── Portalled surfaces ──────────────────────────────────────
+// The modals (Radix Dialog) and the job drawer (Radix Sheet) both render into
+// <body>, NOT inside .cron-page — so every rule below has to stay top-level or
+// it silently matches nothing.
- .form-help {
- display: block;
- margin-top: $space-2;
- font-family: var(--mono);
- font-size: 11px;
- color: var(--text-faint);
- }
+// create/edit modal (field labels → mono eyebrows)
+.sk-modal {
+ .form-group > label:not(.checkbox-label) {
+ font-family: var(--mono);
+ font-size: 10.5px;
+ font-weight: $font-weight-semibold;
+ letter-spacing: 0.08em;
+ text-transform: uppercase;
+ color: var(--text-faint);
}
- // ── run-output modal ────────────────────────────────────
- .run-output {
+ .form-help {
+ display: block;
+ margin-top: $space-2;
+ font-family: var(--mono);
+ font-size: 11px;
+ color: var(--text-faint);
+ }
+}
+
+.run-output {
+ display: flex;
+ flex-direction: column;
+ gap: $space-4;
+}
+
+.run-output-exit {
+ display: flex;
+ align-items: center;
+ gap: $space-3;
+}
+
+.run-output-label {
+ font-family: var(--mono);
+ font-size: 10.5px;
+ font-weight: $font-weight-semibold;
+ letter-spacing: 0.08em;
+ text-transform: uppercase;
+ color: var(--text-faint);
+}
+
+.run-output-section {
+ display: flex;
+ flex-direction: column;
+ gap: $space-2;
+}
+
+.run-output-pre {
+ margin: 0;
+ padding: $space-3 $space-4;
+ font-family: var(--mono);
+ font-size: 12px;
+ line-height: 1.62;
+ background: var(--bg-code);
+ color: var(--text-code);
+ border: 1px solid var(--border);
+ border-radius: var(--radius-sm);
+ max-height: 300px;
+ overflow: auto;
+ white-space: pre-wrap;
+ word-break: break-all;
+ @include custom-scrollbar();
+
+ &--error {
+ color: var(--red);
+ border-color: rgba(251, 111, 111, 0.28);
+ }
+}
+
+// spinner inside the run-now button (list row + drawer header)
+.spinner-inline {
+ display: inline-block;
+ width: 14px;
+ height: 14px;
+ border: 2px solid var(--border-strong);
+ border-top-color: var(--accent);
+ border-radius: 50%;
+ animation: spin 0.8s linear infinite;
+}
+
+@keyframes spin {
+ to {
+ transform: rotate(360deg);
+ }
+}
+
+// ── Job drawer (row click) ──────────────────────────────────
+.cron-drawer__headeractions {
+ display: flex;
+ align-items: center;
+ flex-wrap: wrap;
+ justify-content: flex-end;
+ gap: $space-2;
+ padding-right: 32px; // clear the sheet's close button
+}
+
+.cron-drawer {
+ padding: $space-5 $space-5 $space-8;
+ display: flex;
+ flex-direction: column;
+ gap: $space-5;
+
+ &__section {
display: flex;
flex-direction: column;
- gap: $space-4;
+ align-items: stretch;
+ gap: $space-3;
}
- .run-output-exit {
+ &__sectiontitle {
+ margin: 0;
+ font-size: 14px;
+ font-weight: $font-weight-semibold;
+ color: var(--text);
+ }
+
+ &__hint {
+ margin: 0;
+ font-size: $font-size-sm;
+ color: var(--text-faint);
+ }
+
+ &__info {
+ background: var(--surface);
+ border: 1px solid var(--border-soft);
+ border-radius: var(--radius);
+ padding: $space-2 $space-4;
+ }
+
+ &__tracking {
display: flex;
- align-items: center;
+ flex-direction: column;
+ align-items: flex-start;
gap: $space-3;
}
- .run-output-label {
+ &__table {
+ background: var(--surface);
+ border: 1px solid var(--border-soft);
+ border-radius: var(--radius);
+ overflow: hidden;
+ }
+
+ &__actions {
+ display: flex;
+ flex-wrap: wrap;
+ gap: $space-2;
+ }
+
+ &__danger {
+ padding-top: $space-4;
+ border-top: 1px solid var(--border-soft);
+ }
+}
+
+.cron-inforow {
+ display: flex;
+ align-items: baseline;
+ gap: $space-4;
+ padding: $space-2 0;
+ border-top: 1px solid var(--border-soft);
+
+ &:first-child { border-top: 0; }
+
+ .k {
+ flex: 0 0 118px;
font-family: var(--mono);
font-size: 10.5px;
font-weight: $font-weight-semibold;
@@ -224,52 +328,65 @@
color: var(--text-faint);
}
- .run-output-section {
- display: flex;
- flex-direction: column;
- gap: $space-2;
+ .v {
+ flex: 1;
+ min-width: 0;
+ font-size: 12.5px;
+ color: var(--text);
+ word-break: break-word;
}
- .run-output-pre {
- margin: 0;
- padding: $space-3 $space-4;
+ &__cmd {
font-family: var(--mono);
- font-size: 12px;
- line-height: 1.62;
- background: var(--bg-code);
- color: var(--text-code);
- border: 1px solid var(--border);
- border-radius: var(--radius-sm);
- max-height: 300px;
- overflow: auto;
- white-space: pre-wrap;
- word-break: break-all;
- @include custom-scrollbar();
-
- &--error {
- color: var(--red);
- border-color: rgba(251, 111, 111, 0.28);
- }
+ font-size: 11.5px;
}
+}
- // spinner inside the run-now button
- .spinner-inline {
- display: inline-block;
- width: 14px;
- height: 14px;
- border: 2px solid var(--border-strong);
- border-top-color: var(--accent);
- border-radius: 50%;
- animation: spin 0.8s linear infinite;
- }
+.cron-specs {
+ display: grid;
+ grid-template-columns: repeat(3, 1fr);
+ gap: $space-3;
+
+ @media (max-width: $breakpoint-sm) { grid-template-columns: 1fr; }
}
-@keyframes spin {
- to {
- transform: rotate(360deg);
+.cron-spec {
+ background: var(--surface);
+ border: 1px solid var(--border-soft);
+ border-radius: var(--radius);
+ padding: $space-3 $space-4;
+
+ .l {
+ font-family: var(--mono);
+ font-size: 10px;
+ font-weight: $font-weight-semibold;
+ letter-spacing: 0.08em;
+ text-transform: uppercase;
+ color: var(--text-faint);
+ }
+
+ .v {
+ margin-top: $space-1;
+ font-size: 15px;
+ font-weight: $font-weight-semibold;
+ color: var(--text);
+
+ // Success-rate tone (mirrors .dom-expiry--<tone> on /domains).
+ &--good { color: var(--green); }
+ &--warn { color: var(--amber); }
+ &--bad { color: var(--red); }
+ }
+
+ .s {
+ margin-top: $space-2;
+ font-family: var(--mono);
+ font-size: 11px;
+ color: var(--text-faint);
}
}
+.cron-exit--bad { color: var(--red); }
+
// ============================================
// SCHEDULED TASKS CARD (read-only cron summary
// on the service + WordPress detail Overview tabs)