Add manual scheduled task entry

Lets users log tasks the Linux agent can't discover on its own (e.g.
Docker-based backup jobs) directly in the UI. Tasks now carry an
origin ('agent' | 'manual') so the agent's report-sync logic only
ever creates/updates/stale-marks agent-sourced rows, leaving manual
entries untouched; the API rejects edits/deletes of agent-sourced
tasks to keep that boundary enforced server-side too.
This commit is contained in:
bobban committed 2026-07-10 00:12:34 +02:00
1 parent fac491134d
commit 5269499520
14 files changed
+671 -43

No files matched your search

+21 -1
View File
@@ -13,7 +13,13 @@ function describeSchedule(task: TaskRecord): string {
return task.scheduleExpression;
}
export default function TaskTable({ tasks }: { tasks: TaskRecord[] }) {
interface Props {
tasks: TaskRecord[];
onEdit?: (task: TaskRecord) => void;
onDelete?: (task: TaskRecord) => void;
}
export default function TaskTable({ tasks, onEdit, onDelete }: Props) {
return (
<table className="task-table">
<thead>
@@ -23,6 +29,7 @@ export default function TaskTable({ tasks }: { tasks: TaskRecord[] }) {
<th>Schedule</th>
<th>Next run</th>
<th>Status</th>
<th></th>
</tr>
</thead>
<tbody>
@@ -43,6 +50,19 @@ export default function TaskTable({ tasks }: { tasks: TaskRecord[] }) {
) : (
<span className="badge badge-disabled">Disabled</span>
)}
{task.origin === "manual" && <span className="badge badge-manual">Manual</span>}
</td>
<td className="actions">
{task.origin === "manual" && (
<>
<button className="btn btn-small" onClick={() => onEdit?.(task)}>
Edit
</button>
<button className="btn btn-small btn-danger" onClick={() => onDelete?.(task)}>
Delete
</button>
</>
)}
</td>
</tr>
))}