feat(tasks): unify saved tasks on ssh_tasks services
- Add shared task_runner.run_saved_task helper used by routers/tasks.py and widgets/sources.py SshTaskWidgetSource. - Saved tasks now target ssh_tasks service instances via default_service_id; the legacy default_machine_id and saved_task_runs are removed. - Actions page lists ssh_tasks services for default and run-time selection. - Update types, API client, hooks, tests, docs, and changelog. Backend tests: 222 passed. Frontend lint/build/test: clean (71 passed).
This commit is contained in:
@@ -245,19 +245,19 @@ export const saveTask = (task: SavedTaskInput) =>
|
||||
});
|
||||
export const deleteTask = (taskId: string) =>
|
||||
del<{ status: string }>(`/api/tasks/${encodeURIComponent(taskId)}`);
|
||||
export const runTask = (taskId: string, machineId?: string) =>
|
||||
export const runTask = (taskId: string, serviceId?: string) =>
|
||||
post<{
|
||||
task_id: string;
|
||||
task_name: string;
|
||||
machine_id: string;
|
||||
machine_name: string;
|
||||
service_id: string;
|
||||
service_name: string;
|
||||
task_type: string;
|
||||
exit_status: number;
|
||||
stdout: string;
|
||||
stderr: string;
|
||||
}>(
|
||||
machineId
|
||||
? `/api/tasks/run?machine_id=${encodeURIComponent(machineId)}`
|
||||
serviceId
|
||||
? `/api/tasks/run?service_id=${encodeURIComponent(serviceId)}`
|
||||
: "/api/tasks/run",
|
||||
{ task_id: taskId },
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user