mirror of
https://github.com/hibiken/asynqmon.git
synced 2025-10-23 06:46:11 +08:00
Add cancel action to ActiveTasksTable
This commit is contained in:
@@ -3,6 +3,7 @@ import {
|
||||
SnackbarActionTypes,
|
||||
} from "../actions/snackbarActions";
|
||||
import {
|
||||
BATCH_CANCEL_ACTIVE_TASKS_SUCCESS,
|
||||
BATCH_DELETE_DEAD_TASKS_SUCCESS,
|
||||
BATCH_DELETE_RETRY_TASKS_SUCCESS,
|
||||
BATCH_DELETE_SCHEDULED_TASKS_SUCCESS,
|
||||
@@ -11,6 +12,7 @@ import {
|
||||
BATCH_RUN_DEAD_TASKS_SUCCESS,
|
||||
BATCH_RUN_RETRY_TASKS_SUCCESS,
|
||||
BATCH_RUN_SCHEDULED_TASKS_SUCCESS,
|
||||
CANCEL_ALL_ACTIVE_TASKS_SUCCESS,
|
||||
DELETE_ALL_DEAD_TASKS_SUCCESS,
|
||||
DELETE_ALL_RETRY_TASKS_SUCCESS,
|
||||
DELETE_ALL_SCHEDULED_TASKS_SUCCESS,
|
||||
@@ -53,6 +55,22 @@ function snackbarReducer(
|
||||
isOpen: false,
|
||||
};
|
||||
|
||||
case BATCH_CANCEL_ACTIVE_TASKS_SUCCESS: {
|
||||
const n = action.payload.canceled_ids.length;
|
||||
return {
|
||||
isOpen: true,
|
||||
message: `Cancelation signal sent to ${n} ${
|
||||
n === 1 ? "task" : "tasks"
|
||||
}`,
|
||||
};
|
||||
}
|
||||
|
||||
case CANCEL_ALL_ACTIVE_TASKS_SUCCESS:
|
||||
return {
|
||||
isOpen: true,
|
||||
message: `Cancelation signal sent to all tasks in ${action.queue} queue`,
|
||||
};
|
||||
|
||||
case RUN_SCHEDULED_TASK_SUCCESS:
|
||||
return {
|
||||
isOpen: true,
|
||||
|
Reference in New Issue
Block a user