Add Cloud Console cancel action and cancelled status
- Widen TaskStatus to include "cancelled"; add it to TasksView's STATUSES filter dropdown. - Add TaskCancellationResponse type and cancelTask(taskId) to api.ts. - Add a Cancel button to TasksView's task detail panel, gated on tasks:submit and a non-terminal task status; updates the displayed status on success and surfaces errors via the existing error path. - Extract the cancellability rule into a pure taskCancellation.ts module (mirroring taskProgress.ts/plannerHistory.ts) with unit tests, since the project has no Vue component-mounting test setup. Task 6/9 of task-cancellation change.
This commit is contained in:
@@ -3,7 +3,8 @@ export type TaskStatus =
|
||||
| "assigned"
|
||||
| "dispatched"
|
||||
| "done"
|
||||
| "failed";
|
||||
| "failed"
|
||||
| "cancelled";
|
||||
|
||||
export interface TaskListItem {
|
||||
id: string;
|
||||
@@ -41,6 +42,11 @@ export interface TaskListResponse {
|
||||
offset: number;
|
||||
}
|
||||
|
||||
export interface TaskCancellationResponse {
|
||||
task_id: string;
|
||||
status: TaskStatus;
|
||||
}
|
||||
|
||||
export interface TaskAttempt {
|
||||
task_id: string;
|
||||
attempt: number;
|
||||
|
||||
Reference in New Issue
Block a user