mirror of
https://github.com/hibiken/asynqmon.git
synced 2025-01-19 03:05:53 +08:00
Update UI code with new API
This commit is contained in:
parent
fa313ce180
commit
565dfb4ccf
@ -351,26 +351,26 @@ interface BatchCancelActiveTasksErrorAction {
|
|||||||
interface DeletePendingTaskBeginAction {
|
interface DeletePendingTaskBeginAction {
|
||||||
type: typeof DELETE_PENDING_TASK_BEGIN;
|
type: typeof DELETE_PENDING_TASK_BEGIN;
|
||||||
queue: string;
|
queue: string;
|
||||||
taskKey: string;
|
taskId: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface DeletePendingTaskSuccessAction {
|
interface DeletePendingTaskSuccessAction {
|
||||||
type: typeof DELETE_PENDING_TASK_SUCCESS;
|
type: typeof DELETE_PENDING_TASK_SUCCESS;
|
||||||
queue: string;
|
queue: string;
|
||||||
taskKey: string;
|
taskId: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface DeletePendingTaskErrorAction {
|
interface DeletePendingTaskErrorAction {
|
||||||
type: typeof DELETE_PENDING_TASK_ERROR;
|
type: typeof DELETE_PENDING_TASK_ERROR;
|
||||||
queue: string;
|
queue: string;
|
||||||
taskKey: string;
|
taskId: string;
|
||||||
error: string;
|
error: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface BatchDeletePendingTasksBeginAction {
|
interface BatchDeletePendingTasksBeginAction {
|
||||||
type: typeof BATCH_DELETE_PENDING_TASKS_BEGIN;
|
type: typeof BATCH_DELETE_PENDING_TASKS_BEGIN;
|
||||||
queue: string;
|
queue: string;
|
||||||
taskKeys: string[];
|
taskIds: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
interface BatchDeletePendingTasksSuccessAction {
|
interface BatchDeletePendingTasksSuccessAction {
|
||||||
@ -382,7 +382,7 @@ interface BatchDeletePendingTasksSuccessAction {
|
|||||||
interface BatchDeletePendingTasksErrorAction {
|
interface BatchDeletePendingTasksErrorAction {
|
||||||
type: typeof BATCH_DELETE_PENDING_TASKS_ERROR;
|
type: typeof BATCH_DELETE_PENDING_TASKS_ERROR;
|
||||||
queue: string;
|
queue: string;
|
||||||
taskKeys: string[];
|
taskIds: string[];
|
||||||
error: string;
|
error: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -406,26 +406,26 @@ interface DeleteAllPendingTasksErrorAction {
|
|||||||
interface ArchivePendingTaskBeginAction {
|
interface ArchivePendingTaskBeginAction {
|
||||||
type: typeof ARCHIVE_PENDING_TASK_BEGIN;
|
type: typeof ARCHIVE_PENDING_TASK_BEGIN;
|
||||||
queue: string;
|
queue: string;
|
||||||
taskKey: string;
|
taskId: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ArchivePendingTaskSuccessAction {
|
interface ArchivePendingTaskSuccessAction {
|
||||||
type: typeof ARCHIVE_PENDING_TASK_SUCCESS;
|
type: typeof ARCHIVE_PENDING_TASK_SUCCESS;
|
||||||
queue: string;
|
queue: string;
|
||||||
taskKey: string;
|
taskId: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ArchivePendingTaskErrorAction {
|
interface ArchivePendingTaskErrorAction {
|
||||||
type: typeof ARCHIVE_PENDING_TASK_ERROR;
|
type: typeof ARCHIVE_PENDING_TASK_ERROR;
|
||||||
queue: string;
|
queue: string;
|
||||||
taskKey: string;
|
taskId: string;
|
||||||
error: string;
|
error: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface BatchArchivePendingTasksBeginAction {
|
interface BatchArchivePendingTasksBeginAction {
|
||||||
type: typeof BATCH_ARCHIVE_PENDING_TASKS_BEGIN;
|
type: typeof BATCH_ARCHIVE_PENDING_TASKS_BEGIN;
|
||||||
queue: string;
|
queue: string;
|
||||||
taskKeys: string[];
|
taskIds: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
interface BatchArchivePendingTasksSuccessAction {
|
interface BatchArchivePendingTasksSuccessAction {
|
||||||
@ -437,7 +437,7 @@ interface BatchArchivePendingTasksSuccessAction {
|
|||||||
interface BatchArchivePendingTasksErrorAction {
|
interface BatchArchivePendingTasksErrorAction {
|
||||||
type: typeof BATCH_ARCHIVE_PENDING_TASKS_ERROR;
|
type: typeof BATCH_ARCHIVE_PENDING_TASKS_ERROR;
|
||||||
queue: string;
|
queue: string;
|
||||||
taskKeys: string[];
|
taskIds: string[];
|
||||||
error: string;
|
error: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -460,121 +460,121 @@ interface ArchiveAllPendingTasksErrorAction {
|
|||||||
interface RunScheduledTaskBeginAction {
|
interface RunScheduledTaskBeginAction {
|
||||||
type: typeof RUN_SCHEDULED_TASK_BEGIN;
|
type: typeof RUN_SCHEDULED_TASK_BEGIN;
|
||||||
queue: string;
|
queue: string;
|
||||||
taskKey: string;
|
taskId: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface RunScheduledTaskSuccessAction {
|
interface RunScheduledTaskSuccessAction {
|
||||||
type: typeof RUN_SCHEDULED_TASK_SUCCESS;
|
type: typeof RUN_SCHEDULED_TASK_SUCCESS;
|
||||||
queue: string;
|
queue: string;
|
||||||
taskKey: string;
|
taskId: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface RunScheduledTaskErrorAction {
|
interface RunScheduledTaskErrorAction {
|
||||||
type: typeof RUN_SCHEDULED_TASK_ERROR;
|
type: typeof RUN_SCHEDULED_TASK_ERROR;
|
||||||
queue: string;
|
queue: string;
|
||||||
taskKey: string;
|
taskId: string;
|
||||||
error: string;
|
error: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ArchiveScheduledTaskBeginAction {
|
interface ArchiveScheduledTaskBeginAction {
|
||||||
type: typeof ARCHIVE_SCHEDULED_TASK_BEGIN;
|
type: typeof ARCHIVE_SCHEDULED_TASK_BEGIN;
|
||||||
queue: string;
|
queue: string;
|
||||||
taskKey: string;
|
taskId: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ArchiveScheduledTaskSuccessAction {
|
interface ArchiveScheduledTaskSuccessAction {
|
||||||
type: typeof ARCHIVE_SCHEDULED_TASK_SUCCESS;
|
type: typeof ARCHIVE_SCHEDULED_TASK_SUCCESS;
|
||||||
queue: string;
|
queue: string;
|
||||||
taskKey: string;
|
taskId: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ArchiveScheduledTaskErrorAction {
|
interface ArchiveScheduledTaskErrorAction {
|
||||||
type: typeof ARCHIVE_SCHEDULED_TASK_ERROR;
|
type: typeof ARCHIVE_SCHEDULED_TASK_ERROR;
|
||||||
queue: string;
|
queue: string;
|
||||||
taskKey: string;
|
taskId: string;
|
||||||
error: string;
|
error: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface RunRetryTaskBeginAction {
|
interface RunRetryTaskBeginAction {
|
||||||
type: typeof RUN_RETRY_TASK_BEGIN;
|
type: typeof RUN_RETRY_TASK_BEGIN;
|
||||||
queue: string;
|
queue: string;
|
||||||
taskKey: string;
|
taskId: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface RunRetryTaskSuccessAction {
|
interface RunRetryTaskSuccessAction {
|
||||||
type: typeof RUN_RETRY_TASK_SUCCESS;
|
type: typeof RUN_RETRY_TASK_SUCCESS;
|
||||||
queue: string;
|
queue: string;
|
||||||
taskKey: string;
|
taskId: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface RunRetryTaskErrorAction {
|
interface RunRetryTaskErrorAction {
|
||||||
type: typeof RUN_RETRY_TASK_ERROR;
|
type: typeof RUN_RETRY_TASK_ERROR;
|
||||||
queue: string;
|
queue: string;
|
||||||
taskKey: string;
|
taskId: string;
|
||||||
error: string;
|
error: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ArchiveRetryTaskBeginAction {
|
interface ArchiveRetryTaskBeginAction {
|
||||||
type: typeof ARCHIVE_RETRY_TASK_BEGIN;
|
type: typeof ARCHIVE_RETRY_TASK_BEGIN;
|
||||||
queue: string;
|
queue: string;
|
||||||
taskKey: string;
|
taskId: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ArchiveRetryTaskSuccessAction {
|
interface ArchiveRetryTaskSuccessAction {
|
||||||
type: typeof ARCHIVE_RETRY_TASK_SUCCESS;
|
type: typeof ARCHIVE_RETRY_TASK_SUCCESS;
|
||||||
queue: string;
|
queue: string;
|
||||||
taskKey: string;
|
taskId: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ArchiveRetryTaskErrorAction {
|
interface ArchiveRetryTaskErrorAction {
|
||||||
type: typeof ARCHIVE_RETRY_TASK_ERROR;
|
type: typeof ARCHIVE_RETRY_TASK_ERROR;
|
||||||
queue: string;
|
queue: string;
|
||||||
taskKey: string;
|
taskId: string;
|
||||||
error: string;
|
error: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface RunArchivedTaskBeginAction {
|
interface RunArchivedTaskBeginAction {
|
||||||
type: typeof RUN_ARCHIVED_TASK_BEGIN;
|
type: typeof RUN_ARCHIVED_TASK_BEGIN;
|
||||||
queue: string;
|
queue: string;
|
||||||
taskKey: string;
|
taskId: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface RunArchivedTaskSuccessAction {
|
interface RunArchivedTaskSuccessAction {
|
||||||
type: typeof RUN_ARCHIVED_TASK_SUCCESS;
|
type: typeof RUN_ARCHIVED_TASK_SUCCESS;
|
||||||
queue: string;
|
queue: string;
|
||||||
taskKey: string;
|
taskId: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface RunArchivedTaskErrorAction {
|
interface RunArchivedTaskErrorAction {
|
||||||
type: typeof RUN_ARCHIVED_TASK_ERROR;
|
type: typeof RUN_ARCHIVED_TASK_ERROR;
|
||||||
queue: string;
|
queue: string;
|
||||||
taskKey: string;
|
taskId: string;
|
||||||
error: string;
|
error: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface DeleteScheduledTaskBeginAction {
|
interface DeleteScheduledTaskBeginAction {
|
||||||
type: typeof DELETE_SCHEDULED_TASK_BEGIN;
|
type: typeof DELETE_SCHEDULED_TASK_BEGIN;
|
||||||
queue: string;
|
queue: string;
|
||||||
taskKey: string;
|
taskId: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface DeleteScheduledTaskSuccessAction {
|
interface DeleteScheduledTaskSuccessAction {
|
||||||
type: typeof DELETE_SCHEDULED_TASK_SUCCESS;
|
type: typeof DELETE_SCHEDULED_TASK_SUCCESS;
|
||||||
queue: string;
|
queue: string;
|
||||||
taskKey: string;
|
taskId: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface DeleteScheduledTaskErrorAction {
|
interface DeleteScheduledTaskErrorAction {
|
||||||
type: typeof DELETE_SCHEDULED_TASK_ERROR;
|
type: typeof DELETE_SCHEDULED_TASK_ERROR;
|
||||||
queue: string;
|
queue: string;
|
||||||
taskKey: string;
|
taskId: string;
|
||||||
error: string;
|
error: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface BatchDeleteScheduledTasksBeginAction {
|
interface BatchDeleteScheduledTasksBeginAction {
|
||||||
type: typeof BATCH_DELETE_SCHEDULED_TASKS_BEGIN;
|
type: typeof BATCH_DELETE_SCHEDULED_TASKS_BEGIN;
|
||||||
queue: string;
|
queue: string;
|
||||||
taskKeys: string[];
|
taskIds: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
interface BatchDeleteScheduledTasksSuccessAction {
|
interface BatchDeleteScheduledTasksSuccessAction {
|
||||||
@ -586,14 +586,14 @@ interface BatchDeleteScheduledTasksSuccessAction {
|
|||||||
interface BatchDeleteScheduledTasksErrorAction {
|
interface BatchDeleteScheduledTasksErrorAction {
|
||||||
type: typeof BATCH_DELETE_SCHEDULED_TASKS_ERROR;
|
type: typeof BATCH_DELETE_SCHEDULED_TASKS_ERROR;
|
||||||
queue: string;
|
queue: string;
|
||||||
taskKeys: string[];
|
taskIds: string[];
|
||||||
error: string;
|
error: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface BatchRunScheduledTasksBeginAction {
|
interface BatchRunScheduledTasksBeginAction {
|
||||||
type: typeof BATCH_RUN_SCHEDULED_TASKS_BEGIN;
|
type: typeof BATCH_RUN_SCHEDULED_TASKS_BEGIN;
|
||||||
queue: string;
|
queue: string;
|
||||||
taskKeys: string[];
|
taskIds: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
interface BatchRunScheduledTasksSuccessAction {
|
interface BatchRunScheduledTasksSuccessAction {
|
||||||
@ -605,7 +605,7 @@ interface BatchRunScheduledTasksSuccessAction {
|
|||||||
interface BatchRunScheduledTasksErrorAction {
|
interface BatchRunScheduledTasksErrorAction {
|
||||||
type: typeof BATCH_RUN_SCHEDULED_TASKS_ERROR;
|
type: typeof BATCH_RUN_SCHEDULED_TASKS_ERROR;
|
||||||
queue: string;
|
queue: string;
|
||||||
taskKeys: string[];
|
taskIds: string[];
|
||||||
error: string;
|
error: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -628,7 +628,7 @@ interface RunAllScheduledTasksErrorAction {
|
|||||||
interface BatchArchiveScheduledTasksBeginAction {
|
interface BatchArchiveScheduledTasksBeginAction {
|
||||||
type: typeof BATCH_ARCHIVE_SCHEDULED_TASKS_BEGIN;
|
type: typeof BATCH_ARCHIVE_SCHEDULED_TASKS_BEGIN;
|
||||||
queue: string;
|
queue: string;
|
||||||
taskKeys: string[];
|
taskIds: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
interface BatchArchiveScheduledTasksSuccessAction {
|
interface BatchArchiveScheduledTasksSuccessAction {
|
||||||
@ -640,7 +640,7 @@ interface BatchArchiveScheduledTasksSuccessAction {
|
|||||||
interface BatchArchiveScheduledTasksErrorAction {
|
interface BatchArchiveScheduledTasksErrorAction {
|
||||||
type: typeof BATCH_ARCHIVE_SCHEDULED_TASKS_ERROR;
|
type: typeof BATCH_ARCHIVE_SCHEDULED_TASKS_ERROR;
|
||||||
queue: string;
|
queue: string;
|
||||||
taskKeys: string[];
|
taskIds: string[];
|
||||||
error: string;
|
error: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -680,26 +680,26 @@ interface DeleteAllScheduledTasksErrorAction {
|
|||||||
interface DeleteRetryTaskBeginAction {
|
interface DeleteRetryTaskBeginAction {
|
||||||
type: typeof DELETE_RETRY_TASK_BEGIN;
|
type: typeof DELETE_RETRY_TASK_BEGIN;
|
||||||
queue: string;
|
queue: string;
|
||||||
taskKey: string;
|
taskId: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface DeleteRetryTaskSuccessAction {
|
interface DeleteRetryTaskSuccessAction {
|
||||||
type: typeof DELETE_RETRY_TASK_SUCCESS;
|
type: typeof DELETE_RETRY_TASK_SUCCESS;
|
||||||
queue: string;
|
queue: string;
|
||||||
taskKey: string;
|
taskId: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface DeleteRetryTaskErrorAction {
|
interface DeleteRetryTaskErrorAction {
|
||||||
type: typeof DELETE_RETRY_TASK_ERROR;
|
type: typeof DELETE_RETRY_TASK_ERROR;
|
||||||
queue: string;
|
queue: string;
|
||||||
taskKey: string;
|
taskId: string;
|
||||||
error: string;
|
error: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface BatchDeleteRetryTasksBeginAction {
|
interface BatchDeleteRetryTasksBeginAction {
|
||||||
type: typeof BATCH_DELETE_RETRY_TASKS_BEGIN;
|
type: typeof BATCH_DELETE_RETRY_TASKS_BEGIN;
|
||||||
queue: string;
|
queue: string;
|
||||||
taskKeys: string[];
|
taskIds: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
interface BatchDeleteRetryTasksSuccessAction {
|
interface BatchDeleteRetryTasksSuccessAction {
|
||||||
@ -711,14 +711,14 @@ interface BatchDeleteRetryTasksSuccessAction {
|
|||||||
interface BatchDeleteRetryTasksErrorAction {
|
interface BatchDeleteRetryTasksErrorAction {
|
||||||
type: typeof BATCH_DELETE_RETRY_TASKS_ERROR;
|
type: typeof BATCH_DELETE_RETRY_TASKS_ERROR;
|
||||||
queue: string;
|
queue: string;
|
||||||
taskKeys: string[];
|
taskIds: string[];
|
||||||
error: string;
|
error: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface BatchRunRetryTasksBeginAction {
|
interface BatchRunRetryTasksBeginAction {
|
||||||
type: typeof BATCH_RUN_RETRY_TASKS_BEGIN;
|
type: typeof BATCH_RUN_RETRY_TASKS_BEGIN;
|
||||||
queue: string;
|
queue: string;
|
||||||
taskKeys: string[];
|
taskIds: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
interface BatchRunRetryTasksSuccessAction {
|
interface BatchRunRetryTasksSuccessAction {
|
||||||
@ -730,7 +730,7 @@ interface BatchRunRetryTasksSuccessAction {
|
|||||||
interface BatchRunRetryTasksErrorAction {
|
interface BatchRunRetryTasksErrorAction {
|
||||||
type: typeof BATCH_RUN_RETRY_TASKS_ERROR;
|
type: typeof BATCH_RUN_RETRY_TASKS_ERROR;
|
||||||
queue: string;
|
queue: string;
|
||||||
taskKeys: string[];
|
taskIds: string[];
|
||||||
error: string;
|
error: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -753,7 +753,7 @@ interface RunAllRetryTasksErrorAction {
|
|||||||
interface BatchArchiveRetryTasksBeginAction {
|
interface BatchArchiveRetryTasksBeginAction {
|
||||||
type: typeof BATCH_ARCHIVE_RETRY_TASKS_BEGIN;
|
type: typeof BATCH_ARCHIVE_RETRY_TASKS_BEGIN;
|
||||||
queue: string;
|
queue: string;
|
||||||
taskKeys: string[];
|
taskIds: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
interface BatchArchiveRetryTasksSuccessAction {
|
interface BatchArchiveRetryTasksSuccessAction {
|
||||||
@ -765,7 +765,7 @@ interface BatchArchiveRetryTasksSuccessAction {
|
|||||||
interface BatchArchiveRetryTasksErrorAction {
|
interface BatchArchiveRetryTasksErrorAction {
|
||||||
type: typeof BATCH_ARCHIVE_RETRY_TASKS_ERROR;
|
type: typeof BATCH_ARCHIVE_RETRY_TASKS_ERROR;
|
||||||
queue: string;
|
queue: string;
|
||||||
taskKeys: string[];
|
taskIds: string[];
|
||||||
error: string;
|
error: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -805,26 +805,26 @@ interface DeleteAllRetryTasksErrorAction {
|
|||||||
interface DeleteArchivedTaskBeginAction {
|
interface DeleteArchivedTaskBeginAction {
|
||||||
type: typeof DELETE_ARCHIVED_TASK_BEGIN;
|
type: typeof DELETE_ARCHIVED_TASK_BEGIN;
|
||||||
queue: string;
|
queue: string;
|
||||||
taskKey: string;
|
taskId: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface DeleteArchivedTaskSuccessAction {
|
interface DeleteArchivedTaskSuccessAction {
|
||||||
type: typeof DELETE_ARCHIVED_TASK_SUCCESS;
|
type: typeof DELETE_ARCHIVED_TASK_SUCCESS;
|
||||||
queue: string;
|
queue: string;
|
||||||
taskKey: string;
|
taskId: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface DeleteArchivedTaskErrorAction {
|
interface DeleteArchivedTaskErrorAction {
|
||||||
type: typeof DELETE_ARCHIVED_TASK_ERROR;
|
type: typeof DELETE_ARCHIVED_TASK_ERROR;
|
||||||
queue: string;
|
queue: string;
|
||||||
taskKey: string;
|
taskId: string;
|
||||||
error: string;
|
error: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface BatchDeleteArchivedTasksBeginAction {
|
interface BatchDeleteArchivedTasksBeginAction {
|
||||||
type: typeof BATCH_DELETE_ARCHIVED_TASKS_BEGIN;
|
type: typeof BATCH_DELETE_ARCHIVED_TASKS_BEGIN;
|
||||||
queue: string;
|
queue: string;
|
||||||
taskKeys: string[];
|
taskIds: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
interface BatchDeleteArchivedTasksSuccessAction {
|
interface BatchDeleteArchivedTasksSuccessAction {
|
||||||
@ -836,14 +836,14 @@ interface BatchDeleteArchivedTasksSuccessAction {
|
|||||||
interface BatchDeleteArchivedTasksErrorAction {
|
interface BatchDeleteArchivedTasksErrorAction {
|
||||||
type: typeof BATCH_DELETE_ARCHIVED_TASKS_ERROR;
|
type: typeof BATCH_DELETE_ARCHIVED_TASKS_ERROR;
|
||||||
queue: string;
|
queue: string;
|
||||||
taskKeys: string[];
|
taskIds: string[];
|
||||||
error: string;
|
error: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface BatchRunArchivedTasksBeginAction {
|
interface BatchRunArchivedTasksBeginAction {
|
||||||
type: typeof BATCH_RUN_ARCHIVED_TASKS_BEGIN;
|
type: typeof BATCH_RUN_ARCHIVED_TASKS_BEGIN;
|
||||||
queue: string;
|
queue: string;
|
||||||
taskKeys: string[];
|
taskIds: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
interface BatchRunArchivedTasksSuccessAction {
|
interface BatchRunArchivedTasksSuccessAction {
|
||||||
@ -855,7 +855,7 @@ interface BatchRunArchivedTasksSuccessAction {
|
|||||||
interface BatchRunArchivedTasksErrorAction {
|
interface BatchRunArchivedTasksErrorAction {
|
||||||
type: typeof BATCH_RUN_ARCHIVED_TASKS_ERROR;
|
type: typeof BATCH_RUN_ARCHIVED_TASKS_ERROR;
|
||||||
queue: string;
|
queue: string;
|
||||||
taskKeys: string[];
|
taskIds: string[];
|
||||||
error: string;
|
error: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1210,12 +1210,12 @@ export function batchCancelActiveTasksAsync(queue: string, taskIds: string[]) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function runScheduledTaskAsync(queue: string, taskKey: string) {
|
export function runScheduledTaskAsync(queue: string, taskId: string) {
|
||||||
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
||||||
dispatch({ type: RUN_SCHEDULED_TASK_BEGIN, queue, taskKey });
|
dispatch({ type: RUN_SCHEDULED_TASK_BEGIN, queue, taskId });
|
||||||
try {
|
try {
|
||||||
await runScheduledTask(queue, taskKey);
|
await runScheduledTask(queue, taskId);
|
||||||
dispatch({ type: RUN_SCHEDULED_TASK_SUCCESS, queue, taskKey });
|
dispatch({ type: RUN_SCHEDULED_TASK_SUCCESS, queue, taskId });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(
|
console.error(
|
||||||
"runScheduledTaskAsync: ",
|
"runScheduledTaskAsync: ",
|
||||||
@ -1225,36 +1225,36 @@ export function runScheduledTaskAsync(queue: string, taskKey: string) {
|
|||||||
type: RUN_SCHEDULED_TASK_ERROR,
|
type: RUN_SCHEDULED_TASK_ERROR,
|
||||||
error: toErrorString(error),
|
error: toErrorString(error),
|
||||||
queue,
|
queue,
|
||||||
taskKey,
|
taskId,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function runRetryTaskAsync(queue: string, taskKey: string) {
|
export function runRetryTaskAsync(queue: string, taskId: string) {
|
||||||
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
||||||
dispatch({ type: RUN_RETRY_TASK_BEGIN, queue, taskKey });
|
dispatch({ type: RUN_RETRY_TASK_BEGIN, queue, taskId });
|
||||||
try {
|
try {
|
||||||
await runRetryTask(queue, taskKey);
|
await runRetryTask(queue, taskId);
|
||||||
dispatch({ type: RUN_RETRY_TASK_SUCCESS, queue, taskKey });
|
dispatch({ type: RUN_RETRY_TASK_SUCCESS, queue, taskId });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("runRetryTaskAsync: ", toErrorStringWithHttpStatus(error));
|
console.error("runRetryTaskAsync: ", toErrorStringWithHttpStatus(error));
|
||||||
dispatch({
|
dispatch({
|
||||||
type: RUN_RETRY_TASK_ERROR,
|
type: RUN_RETRY_TASK_ERROR,
|
||||||
error: toErrorString(error),
|
error: toErrorString(error),
|
||||||
queue,
|
queue,
|
||||||
taskKey,
|
taskId,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function archivePendingTaskAsync(queue: string, taskKey: string) {
|
export function archivePendingTaskAsync(queue: string, taskId: string) {
|
||||||
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
||||||
dispatch({ type: ARCHIVE_PENDING_TASK_BEGIN, queue, taskKey });
|
dispatch({ type: ARCHIVE_PENDING_TASK_BEGIN, queue, taskId });
|
||||||
try {
|
try {
|
||||||
await archivePendingTask(queue, taskKey);
|
await archivePendingTask(queue, taskId);
|
||||||
dispatch({ type: ARCHIVE_PENDING_TASK_SUCCESS, queue, taskKey });
|
dispatch({ type: ARCHIVE_PENDING_TASK_SUCCESS, queue, taskId });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(
|
console.error(
|
||||||
"archivePendingTaskAsync: ",
|
"archivePendingTaskAsync: ",
|
||||||
@ -1264,18 +1264,18 @@ export function archivePendingTaskAsync(queue: string, taskKey: string) {
|
|||||||
type: ARCHIVE_PENDING_TASK_ERROR,
|
type: ARCHIVE_PENDING_TASK_ERROR,
|
||||||
error: toErrorString(error),
|
error: toErrorString(error),
|
||||||
queue,
|
queue,
|
||||||
taskKey,
|
taskId,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function archiveScheduledTaskAsync(queue: string, taskKey: string) {
|
export function archiveScheduledTaskAsync(queue: string, taskId: string) {
|
||||||
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
||||||
dispatch({ type: ARCHIVE_SCHEDULED_TASK_BEGIN, queue, taskKey });
|
dispatch({ type: ARCHIVE_SCHEDULED_TASK_BEGIN, queue, taskId });
|
||||||
try {
|
try {
|
||||||
await archiveScheduledTask(queue, taskKey);
|
await archiveScheduledTask(queue, taskId);
|
||||||
dispatch({ type: ARCHIVE_SCHEDULED_TASK_SUCCESS, queue, taskKey });
|
dispatch({ type: ARCHIVE_SCHEDULED_TASK_SUCCESS, queue, taskId });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(
|
console.error(
|
||||||
"archiveScheduledTaskAsync: ",
|
"archiveScheduledTaskAsync: ",
|
||||||
@ -1285,18 +1285,18 @@ export function archiveScheduledTaskAsync(queue: string, taskKey: string) {
|
|||||||
type: ARCHIVE_SCHEDULED_TASK_ERROR,
|
type: ARCHIVE_SCHEDULED_TASK_ERROR,
|
||||||
error: toErrorString(error),
|
error: toErrorString(error),
|
||||||
queue,
|
queue,
|
||||||
taskKey,
|
taskId,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function archiveRetryTaskAsync(queue: string, taskKey: string) {
|
export function archiveRetryTaskAsync(queue: string, taskId: string) {
|
||||||
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
||||||
dispatch({ type: ARCHIVE_RETRY_TASK_BEGIN, queue, taskKey });
|
dispatch({ type: ARCHIVE_RETRY_TASK_BEGIN, queue, taskId });
|
||||||
try {
|
try {
|
||||||
await archiveRetryTask(queue, taskKey);
|
await archiveRetryTask(queue, taskId);
|
||||||
dispatch({ type: ARCHIVE_RETRY_TASK_SUCCESS, queue, taskKey });
|
dispatch({ type: ARCHIVE_RETRY_TASK_SUCCESS, queue, taskId });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(
|
console.error(
|
||||||
"archiveRetryTaskAsync: ",
|
"archiveRetryTaskAsync: ",
|
||||||
@ -1306,18 +1306,18 @@ export function archiveRetryTaskAsync(queue: string, taskKey: string) {
|
|||||||
type: ARCHIVE_RETRY_TASK_ERROR,
|
type: ARCHIVE_RETRY_TASK_ERROR,
|
||||||
error: toErrorString(error),
|
error: toErrorString(error),
|
||||||
queue,
|
queue,
|
||||||
taskKey,
|
taskId,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function runArchivedTaskAsync(queue: string, taskKey: string) {
|
export function runArchivedTaskAsync(queue: string, taskId: string) {
|
||||||
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
||||||
dispatch({ type: RUN_ARCHIVED_TASK_BEGIN, queue, taskKey });
|
dispatch({ type: RUN_ARCHIVED_TASK_BEGIN, queue, taskId });
|
||||||
try {
|
try {
|
||||||
await runArchivedTask(queue, taskKey);
|
await runArchivedTask(queue, taskId);
|
||||||
dispatch({ type: RUN_ARCHIVED_TASK_SUCCESS, queue, taskKey });
|
dispatch({ type: RUN_ARCHIVED_TASK_SUCCESS, queue, taskId });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(
|
console.error(
|
||||||
"runArchivedTaskAsync: ",
|
"runArchivedTaskAsync: ",
|
||||||
@ -1327,18 +1327,18 @@ export function runArchivedTaskAsync(queue: string, taskKey: string) {
|
|||||||
type: RUN_ARCHIVED_TASK_ERROR,
|
type: RUN_ARCHIVED_TASK_ERROR,
|
||||||
error: toErrorString(error),
|
error: toErrorString(error),
|
||||||
queue,
|
queue,
|
||||||
taskKey,
|
taskId,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function deletePendingTaskAsync(queue: string, taskKey: string) {
|
export function deletePendingTaskAsync(queue: string, taskId: string) {
|
||||||
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
||||||
dispatch({ type: DELETE_PENDING_TASK_BEGIN, queue, taskKey });
|
dispatch({ type: DELETE_PENDING_TASK_BEGIN, queue, taskId });
|
||||||
try {
|
try {
|
||||||
await deletePendingTask(queue, taskKey);
|
await deletePendingTask(queue, taskId);
|
||||||
dispatch({ type: DELETE_PENDING_TASK_SUCCESS, queue, taskKey });
|
dispatch({ type: DELETE_PENDING_TASK_SUCCESS, queue, taskId });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(
|
console.error(
|
||||||
"deletePendingTaskAsync: ",
|
"deletePendingTaskAsync: ",
|
||||||
@ -1348,7 +1348,7 @@ export function deletePendingTaskAsync(queue: string, taskKey: string) {
|
|||||||
type: DELETE_PENDING_TASK_ERROR,
|
type: DELETE_PENDING_TASK_ERROR,
|
||||||
error: toErrorString(error),
|
error: toErrorString(error),
|
||||||
queue,
|
queue,
|
||||||
taskKey,
|
taskId,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -1356,12 +1356,12 @@ export function deletePendingTaskAsync(queue: string, taskKey: string) {
|
|||||||
|
|
||||||
export function batchDeletePendingTasksAsync(
|
export function batchDeletePendingTasksAsync(
|
||||||
queue: string,
|
queue: string,
|
||||||
taskKeys: string[]
|
taskIds: string[]
|
||||||
) {
|
) {
|
||||||
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
||||||
dispatch({ type: BATCH_DELETE_PENDING_TASKS_BEGIN, queue, taskKeys });
|
dispatch({ type: BATCH_DELETE_PENDING_TASKS_BEGIN, queue, taskIds });
|
||||||
try {
|
try {
|
||||||
const response = await batchDeletePendingTasks(queue, taskKeys);
|
const response = await batchDeletePendingTasks(queue, taskIds);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: BATCH_DELETE_PENDING_TASKS_SUCCESS,
|
type: BATCH_DELETE_PENDING_TASKS_SUCCESS,
|
||||||
queue: queue,
|
queue: queue,
|
||||||
@ -1376,18 +1376,18 @@ export function batchDeletePendingTasksAsync(
|
|||||||
type: BATCH_DELETE_PENDING_TASKS_ERROR,
|
type: BATCH_DELETE_PENDING_TASKS_ERROR,
|
||||||
error: toErrorString(error),
|
error: toErrorString(error),
|
||||||
queue,
|
queue,
|
||||||
taskKeys,
|
taskIds,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function deleteScheduledTaskAsync(queue: string, taskKey: string) {
|
export function deleteScheduledTaskAsync(queue: string, taskId: string) {
|
||||||
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
||||||
dispatch({ type: DELETE_SCHEDULED_TASK_BEGIN, queue, taskKey });
|
dispatch({ type: DELETE_SCHEDULED_TASK_BEGIN, queue, taskId });
|
||||||
try {
|
try {
|
||||||
await deleteScheduledTask(queue, taskKey);
|
await deleteScheduledTask(queue, taskId);
|
||||||
dispatch({ type: DELETE_SCHEDULED_TASK_SUCCESS, queue, taskKey });
|
dispatch({ type: DELETE_SCHEDULED_TASK_SUCCESS, queue, taskId });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(
|
console.error(
|
||||||
"deleteScheduledTaskAsync: ",
|
"deleteScheduledTaskAsync: ",
|
||||||
@ -1397,7 +1397,7 @@ export function deleteScheduledTaskAsync(queue: string, taskKey: string) {
|
|||||||
type: DELETE_SCHEDULED_TASK_ERROR,
|
type: DELETE_SCHEDULED_TASK_ERROR,
|
||||||
error: toErrorString(error),
|
error: toErrorString(error),
|
||||||
queue,
|
queue,
|
||||||
taskKey,
|
taskId,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -1405,12 +1405,12 @@ export function deleteScheduledTaskAsync(queue: string, taskKey: string) {
|
|||||||
|
|
||||||
export function batchDeleteScheduledTasksAsync(
|
export function batchDeleteScheduledTasksAsync(
|
||||||
queue: string,
|
queue: string,
|
||||||
taskKeys: string[]
|
taskIds: string[]
|
||||||
) {
|
) {
|
||||||
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
||||||
dispatch({ type: BATCH_DELETE_SCHEDULED_TASKS_BEGIN, queue, taskKeys });
|
dispatch({ type: BATCH_DELETE_SCHEDULED_TASKS_BEGIN, queue, taskIds });
|
||||||
try {
|
try {
|
||||||
const response = await batchDeleteScheduledTasks(queue, taskKeys);
|
const response = await batchDeleteScheduledTasks(queue, taskIds);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: BATCH_DELETE_SCHEDULED_TASKS_SUCCESS,
|
type: BATCH_DELETE_SCHEDULED_TASKS_SUCCESS,
|
||||||
queue: queue,
|
queue: queue,
|
||||||
@ -1425,17 +1425,17 @@ export function batchDeleteScheduledTasksAsync(
|
|||||||
type: BATCH_DELETE_SCHEDULED_TASKS_ERROR,
|
type: BATCH_DELETE_SCHEDULED_TASKS_ERROR,
|
||||||
error: toErrorString(error),
|
error: toErrorString(error),
|
||||||
queue,
|
queue,
|
||||||
taskKeys,
|
taskIds,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function batchRunScheduledTasksAsync(queue: string, taskKeys: string[]) {
|
export function batchRunScheduledTasksAsync(queue: string, taskIds: string[]) {
|
||||||
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
||||||
dispatch({ type: BATCH_RUN_SCHEDULED_TASKS_BEGIN, queue, taskKeys });
|
dispatch({ type: BATCH_RUN_SCHEDULED_TASKS_BEGIN, queue, taskIds });
|
||||||
try {
|
try {
|
||||||
const response = await batchRunScheduledTasks(queue, taskKeys);
|
const response = await batchRunScheduledTasks(queue, taskIds);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: BATCH_RUN_SCHEDULED_TASKS_SUCCESS,
|
type: BATCH_RUN_SCHEDULED_TASKS_SUCCESS,
|
||||||
queue: queue,
|
queue: queue,
|
||||||
@ -1450,7 +1450,7 @@ export function batchRunScheduledTasksAsync(queue: string, taskKeys: string[]) {
|
|||||||
type: BATCH_RUN_SCHEDULED_TASKS_ERROR,
|
type: BATCH_RUN_SCHEDULED_TASKS_ERROR,
|
||||||
error: toErrorString(error),
|
error: toErrorString(error),
|
||||||
queue,
|
queue,
|
||||||
taskKeys,
|
taskIds,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -1458,12 +1458,12 @@ export function batchRunScheduledTasksAsync(queue: string, taskKeys: string[]) {
|
|||||||
|
|
||||||
export function batchArchiveScheduledTasksAsync(
|
export function batchArchiveScheduledTasksAsync(
|
||||||
queue: string,
|
queue: string,
|
||||||
taskKeys: string[]
|
taskIds: string[]
|
||||||
) {
|
) {
|
||||||
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
||||||
dispatch({ type: BATCH_ARCHIVE_SCHEDULED_TASKS_BEGIN, queue, taskKeys });
|
dispatch({ type: BATCH_ARCHIVE_SCHEDULED_TASKS_BEGIN, queue, taskIds });
|
||||||
try {
|
try {
|
||||||
const response = await batchArchiveScheduledTasks(queue, taskKeys);
|
const response = await batchArchiveScheduledTasks(queue, taskIds);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: BATCH_ARCHIVE_SCHEDULED_TASKS_SUCCESS,
|
type: BATCH_ARCHIVE_SCHEDULED_TASKS_SUCCESS,
|
||||||
queue: queue,
|
queue: queue,
|
||||||
@ -1478,7 +1478,7 @@ export function batchArchiveScheduledTasksAsync(
|
|||||||
type: BATCH_ARCHIVE_SCHEDULED_TASKS_ERROR,
|
type: BATCH_ARCHIVE_SCHEDULED_TASKS_ERROR,
|
||||||
error: toErrorString(error),
|
error: toErrorString(error),
|
||||||
queue,
|
queue,
|
||||||
taskKeys,
|
taskIds,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -1486,12 +1486,12 @@ export function batchArchiveScheduledTasksAsync(
|
|||||||
|
|
||||||
export function batchArchivePendingTasksAsync(
|
export function batchArchivePendingTasksAsync(
|
||||||
queue: string,
|
queue: string,
|
||||||
taskKeys: string[]
|
taskIds: string[]
|
||||||
) {
|
) {
|
||||||
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
||||||
dispatch({ type: BATCH_ARCHIVE_PENDING_TASKS_BEGIN, queue, taskKeys });
|
dispatch({ type: BATCH_ARCHIVE_PENDING_TASKS_BEGIN, queue, taskIds });
|
||||||
try {
|
try {
|
||||||
const response = await batchArchivePendingTasks(queue, taskKeys);
|
const response = await batchArchivePendingTasks(queue, taskIds);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: BATCH_ARCHIVE_PENDING_TASKS_SUCCESS,
|
type: BATCH_ARCHIVE_PENDING_TASKS_SUCCESS,
|
||||||
queue: queue,
|
queue: queue,
|
||||||
@ -1506,7 +1506,7 @@ export function batchArchivePendingTasksAsync(
|
|||||||
type: BATCH_ARCHIVE_PENDING_TASKS_ERROR,
|
type: BATCH_ARCHIVE_PENDING_TASKS_ERROR,
|
||||||
error: toErrorString(error),
|
error: toErrorString(error),
|
||||||
queue,
|
queue,
|
||||||
taskKeys,
|
taskIds,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -1620,12 +1620,12 @@ export function archiveAllScheduledTasksAsync(queue: string) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function deleteRetryTaskAsync(queue: string, taskKey: string) {
|
export function deleteRetryTaskAsync(queue: string, taskId: string) {
|
||||||
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
||||||
dispatch({ type: DELETE_RETRY_TASK_BEGIN, queue, taskKey });
|
dispatch({ type: DELETE_RETRY_TASK_BEGIN, queue, taskId });
|
||||||
try {
|
try {
|
||||||
await deleteRetryTask(queue, taskKey);
|
await deleteRetryTask(queue, taskId);
|
||||||
dispatch({ type: DELETE_RETRY_TASK_SUCCESS, queue, taskKey });
|
dispatch({ type: DELETE_RETRY_TASK_SUCCESS, queue, taskId });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(
|
console.error(
|
||||||
"deleteRetryTaskAsync: ",
|
"deleteRetryTaskAsync: ",
|
||||||
@ -1635,17 +1635,17 @@ export function deleteRetryTaskAsync(queue: string, taskKey: string) {
|
|||||||
type: DELETE_RETRY_TASK_ERROR,
|
type: DELETE_RETRY_TASK_ERROR,
|
||||||
error: toErrorString(error),
|
error: toErrorString(error),
|
||||||
queue,
|
queue,
|
||||||
taskKey,
|
taskId,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function batchDeleteRetryTasksAsync(queue: string, taskKeys: string[]) {
|
export function batchDeleteRetryTasksAsync(queue: string, taskIds: string[]) {
|
||||||
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
||||||
dispatch({ type: BATCH_DELETE_RETRY_TASKS_BEGIN, queue, taskKeys });
|
dispatch({ type: BATCH_DELETE_RETRY_TASKS_BEGIN, queue, taskIds });
|
||||||
try {
|
try {
|
||||||
const response = await batchDeleteRetryTasks(queue, taskKeys);
|
const response = await batchDeleteRetryTasks(queue, taskIds);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: BATCH_DELETE_RETRY_TASKS_SUCCESS,
|
type: BATCH_DELETE_RETRY_TASKS_SUCCESS,
|
||||||
queue: queue,
|
queue: queue,
|
||||||
@ -1660,17 +1660,17 @@ export function batchDeleteRetryTasksAsync(queue: string, taskKeys: string[]) {
|
|||||||
type: BATCH_DELETE_RETRY_TASKS_ERROR,
|
type: BATCH_DELETE_RETRY_TASKS_ERROR,
|
||||||
error: toErrorString(error),
|
error: toErrorString(error),
|
||||||
queue,
|
queue,
|
||||||
taskKeys,
|
taskIds,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function batchRunRetryTasksAsync(queue: string, taskKeys: string[]) {
|
export function batchRunRetryTasksAsync(queue: string, taskIds: string[]) {
|
||||||
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
||||||
dispatch({ type: BATCH_RUN_RETRY_TASKS_BEGIN, queue, taskKeys });
|
dispatch({ type: BATCH_RUN_RETRY_TASKS_BEGIN, queue, taskIds });
|
||||||
try {
|
try {
|
||||||
const response = await batchRunRetryTasks(queue, taskKeys);
|
const response = await batchRunRetryTasks(queue, taskIds);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: BATCH_RUN_RETRY_TASKS_SUCCESS,
|
type: BATCH_RUN_RETRY_TASKS_SUCCESS,
|
||||||
queue: queue,
|
queue: queue,
|
||||||
@ -1685,17 +1685,17 @@ export function batchRunRetryTasksAsync(queue: string, taskKeys: string[]) {
|
|||||||
type: BATCH_RUN_RETRY_TASKS_ERROR,
|
type: BATCH_RUN_RETRY_TASKS_ERROR,
|
||||||
error: toErrorString(error),
|
error: toErrorString(error),
|
||||||
queue,
|
queue,
|
||||||
taskKeys,
|
taskIds,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function batchArchiveRetryTasksAsync(queue: string, taskKeys: string[]) {
|
export function batchArchiveRetryTasksAsync(queue: string, taskIds: string[]) {
|
||||||
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
||||||
dispatch({ type: BATCH_ARCHIVE_RETRY_TASKS_BEGIN, queue, taskKeys });
|
dispatch({ type: BATCH_ARCHIVE_RETRY_TASKS_BEGIN, queue, taskIds });
|
||||||
try {
|
try {
|
||||||
const response = await batchArchiveRetryTasks(queue, taskKeys);
|
const response = await batchArchiveRetryTasks(queue, taskIds);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: BATCH_ARCHIVE_RETRY_TASKS_SUCCESS,
|
type: BATCH_ARCHIVE_RETRY_TASKS_SUCCESS,
|
||||||
queue: queue,
|
queue: queue,
|
||||||
@ -1710,7 +1710,7 @@ export function batchArchiveRetryTasksAsync(queue: string, taskKeys: string[]) {
|
|||||||
type: BATCH_ARCHIVE_RETRY_TASKS_ERROR,
|
type: BATCH_ARCHIVE_RETRY_TASKS_ERROR,
|
||||||
error: toErrorString(error),
|
error: toErrorString(error),
|
||||||
queue,
|
queue,
|
||||||
taskKeys,
|
taskIds,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -1780,12 +1780,12 @@ export function archiveAllRetryTasksAsync(queue: string) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function deleteArchivedTaskAsync(queue: string, taskKey: string) {
|
export function deleteArchivedTaskAsync(queue: string, taskId: string) {
|
||||||
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
||||||
dispatch({ type: DELETE_ARCHIVED_TASK_BEGIN, queue, taskKey });
|
dispatch({ type: DELETE_ARCHIVED_TASK_BEGIN, queue, taskId });
|
||||||
try {
|
try {
|
||||||
await deleteArchivedTask(queue, taskKey);
|
await deleteArchivedTask(queue, taskId);
|
||||||
dispatch({ type: DELETE_ARCHIVED_TASK_SUCCESS, queue, taskKey });
|
dispatch({ type: DELETE_ARCHIVED_TASK_SUCCESS, queue, taskId });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(
|
console.error(
|
||||||
"deleteArchivedTaskAsync: ",
|
"deleteArchivedTaskAsync: ",
|
||||||
@ -1795,7 +1795,7 @@ export function deleteArchivedTaskAsync(queue: string, taskKey: string) {
|
|||||||
type: DELETE_ARCHIVED_TASK_ERROR,
|
type: DELETE_ARCHIVED_TASK_ERROR,
|
||||||
error: toErrorString(error),
|
error: toErrorString(error),
|
||||||
queue,
|
queue,
|
||||||
taskKey,
|
taskId,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -1803,12 +1803,12 @@ export function deleteArchivedTaskAsync(queue: string, taskKey: string) {
|
|||||||
|
|
||||||
export function batchDeleteArchivedTasksAsync(
|
export function batchDeleteArchivedTasksAsync(
|
||||||
queue: string,
|
queue: string,
|
||||||
taskKeys: string[]
|
taskIds: string[]
|
||||||
) {
|
) {
|
||||||
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
||||||
dispatch({ type: BATCH_DELETE_ARCHIVED_TASKS_BEGIN, queue, taskKeys });
|
dispatch({ type: BATCH_DELETE_ARCHIVED_TASKS_BEGIN, queue, taskIds });
|
||||||
try {
|
try {
|
||||||
const response = await batchDeleteArchivedTasks(queue, taskKeys);
|
const response = await batchDeleteArchivedTasks(queue, taskIds);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: BATCH_DELETE_ARCHIVED_TASKS_SUCCESS,
|
type: BATCH_DELETE_ARCHIVED_TASKS_SUCCESS,
|
||||||
queue: queue,
|
queue: queue,
|
||||||
@ -1823,17 +1823,17 @@ export function batchDeleteArchivedTasksAsync(
|
|||||||
type: BATCH_DELETE_ARCHIVED_TASKS_ERROR,
|
type: BATCH_DELETE_ARCHIVED_TASKS_ERROR,
|
||||||
error: toErrorString(error),
|
error: toErrorString(error),
|
||||||
queue,
|
queue,
|
||||||
taskKeys,
|
taskIds,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function batchRunArchivedTasksAsync(queue: string, taskKeys: string[]) {
|
export function batchRunArchivedTasksAsync(queue: string, taskIds: string[]) {
|
||||||
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
||||||
dispatch({ type: BATCH_RUN_ARCHIVED_TASKS_BEGIN, queue, taskKeys });
|
dispatch({ type: BATCH_RUN_ARCHIVED_TASKS_BEGIN, queue, taskIds });
|
||||||
try {
|
try {
|
||||||
const response = await batchRunArchivedTasks(queue, taskKeys);
|
const response = await batchRunArchivedTasks(queue, taskIds);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: BATCH_RUN_ARCHIVED_TASKS_SUCCESS,
|
type: BATCH_RUN_ARCHIVED_TASKS_SUCCESS,
|
||||||
queue: queue,
|
queue: queue,
|
||||||
@ -1848,7 +1848,7 @@ export function batchRunArchivedTasksAsync(queue: string, taskKeys: string[]) {
|
|||||||
type: BATCH_RUN_ARCHIVED_TASKS_ERROR,
|
type: BATCH_RUN_ARCHIVED_TASKS_ERROR,
|
||||||
error: toErrorString(error),
|
error: toErrorString(error),
|
||||||
queue,
|
queue,
|
||||||
taskKeys,
|
taskIds,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
101
ui/src/api.ts
101
ui/src/api.ts
@ -54,18 +54,18 @@ export interface BatchCancelTasksResponse {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface BatchDeleteTasksResponse {
|
export interface BatchDeleteTasksResponse {
|
||||||
deleted_keys: string[];
|
deleted_ids: string[];
|
||||||
failed_keys: string[];
|
failed_ids: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface BatchRunTasksResponse {
|
export interface BatchRunTasksResponse {
|
||||||
pending_keys: string[];
|
pending_ids: string[];
|
||||||
error_keys: string[];
|
error_ids: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface BatchArchiveTasksResponse {
|
export interface BatchArchiveTasksResponse {
|
||||||
archived_keys: string[];
|
archived_ids: string[];
|
||||||
error_keys: string[];
|
error_ids: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DeleteAllTasksResponse {
|
export interface DeleteAllTasksResponse {
|
||||||
@ -257,7 +257,6 @@ export interface ActiveTask extends BaseTask {
|
|||||||
|
|
||||||
export interface PendingTask extends BaseTask {
|
export interface PendingTask extends BaseTask {
|
||||||
id: string;
|
id: string;
|
||||||
key: string;
|
|
||||||
queue: string;
|
queue: string;
|
||||||
max_retry: number;
|
max_retry: number;
|
||||||
retried: number;
|
retried: number;
|
||||||
@ -266,7 +265,6 @@ export interface PendingTask extends BaseTask {
|
|||||||
|
|
||||||
export interface ScheduledTask extends BaseTask {
|
export interface ScheduledTask extends BaseTask {
|
||||||
id: string;
|
id: string;
|
||||||
key: string;
|
|
||||||
queue: string;
|
queue: string;
|
||||||
max_retry: number;
|
max_retry: number;
|
||||||
retried: number;
|
retried: number;
|
||||||
@ -276,7 +274,6 @@ export interface ScheduledTask extends BaseTask {
|
|||||||
|
|
||||||
export interface RetryTask extends BaseTask {
|
export interface RetryTask extends BaseTask {
|
||||||
id: string;
|
id: string;
|
||||||
key: string;
|
|
||||||
queue: string;
|
queue: string;
|
||||||
next_process_at: string;
|
next_process_at: string;
|
||||||
max_retry: number;
|
max_retry: number;
|
||||||
@ -286,7 +283,6 @@ export interface RetryTask extends BaseTask {
|
|||||||
|
|
||||||
export interface ArchivedTask extends BaseTask {
|
export interface ArchivedTask extends BaseTask {
|
||||||
id: string;
|
id: string;
|
||||||
key: string;
|
|
||||||
queue: string;
|
queue: string;
|
||||||
max_retry: number;
|
max_retry: number;
|
||||||
retried: number;
|
retried: number;
|
||||||
@ -307,7 +303,10 @@ export interface ServerInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface WorkerInfo {
|
export interface WorkerInfo {
|
||||||
task: ActiveTask;
|
task_id: string;
|
||||||
|
queue: string;
|
||||||
|
task_type: string;
|
||||||
|
task_payload: string;
|
||||||
start_time: string;
|
start_time: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -478,23 +477,23 @@ export async function listArchivedTasks(
|
|||||||
|
|
||||||
export async function archivePendingTask(
|
export async function archivePendingTask(
|
||||||
qname: string,
|
qname: string,
|
||||||
taskKey: string
|
taskId: string
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
await axios({
|
await axios({
|
||||||
method: "post",
|
method: "post",
|
||||||
url: `${BASE_URL}/queues/${qname}/pending_tasks/${taskKey}:archive`,
|
url: `${BASE_URL}/queues/${qname}/pending_tasks/${taskId}:archive`,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function batchArchivePendingTasks(
|
export async function batchArchivePendingTasks(
|
||||||
qname: string,
|
qname: string,
|
||||||
taskKeys: string[]
|
taskIds: string[]
|
||||||
): Promise<BatchArchiveTasksResponse> {
|
): Promise<BatchArchiveTasksResponse> {
|
||||||
const resp = await axios({
|
const resp = await axios({
|
||||||
method: "post",
|
method: "post",
|
||||||
url: `${BASE_URL}/queues/${qname}/pending_tasks:batch_archive`,
|
url: `${BASE_URL}/queues/${qname}/pending_tasks:batch_archive`,
|
||||||
data: {
|
data: {
|
||||||
task_keys: taskKeys,
|
task_ids: taskIds,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
return resp.data;
|
return resp.data;
|
||||||
@ -509,23 +508,23 @@ export async function archiveAllPendingTasks(qname: string): Promise<void> {
|
|||||||
|
|
||||||
export async function deletePendingTask(
|
export async function deletePendingTask(
|
||||||
qname: string,
|
qname: string,
|
||||||
taskKey: string
|
taskId: string
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
await axios({
|
await axios({
|
||||||
method: "delete",
|
method: "delete",
|
||||||
url: `${BASE_URL}/queues/${qname}/pending_tasks/${taskKey}`,
|
url: `${BASE_URL}/queues/${qname}/pending_tasks/${taskId}`,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function batchDeletePendingTasks(
|
export async function batchDeletePendingTasks(
|
||||||
qname: string,
|
qname: string,
|
||||||
taskKeys: string[]
|
taskIds: string[]
|
||||||
): Promise<BatchDeleteTasksResponse> {
|
): Promise<BatchDeleteTasksResponse> {
|
||||||
const resp = await axios({
|
const resp = await axios({
|
||||||
method: "post",
|
method: "post",
|
||||||
url: `${BASE_URL}/queues/${qname}/pending_tasks:batch_delete`,
|
url: `${BASE_URL}/queues/${qname}/pending_tasks:batch_delete`,
|
||||||
data: {
|
data: {
|
||||||
task_keys: taskKeys,
|
task_ids: taskIds,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
return resp.data;
|
return resp.data;
|
||||||
@ -543,43 +542,43 @@ export async function deleteAllPendingTasks(
|
|||||||
|
|
||||||
export async function runScheduledTask(
|
export async function runScheduledTask(
|
||||||
qname: string,
|
qname: string,
|
||||||
taskKey: string
|
taskId: string
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
await axios({
|
await axios({
|
||||||
method: "post",
|
method: "post",
|
||||||
url: `${BASE_URL}/queues/${qname}/scheduled_tasks/${taskKey}:run`,
|
url: `${BASE_URL}/queues/${qname}/scheduled_tasks/${taskId}:run`,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function archiveScheduledTask(
|
export async function archiveScheduledTask(
|
||||||
qname: string,
|
qname: string,
|
||||||
taskKey: string
|
taskId: string
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
await axios({
|
await axios({
|
||||||
method: "post",
|
method: "post",
|
||||||
url: `${BASE_URL}/queues/${qname}/scheduled_tasks/${taskKey}:archive`,
|
url: `${BASE_URL}/queues/${qname}/scheduled_tasks/${taskId}:archive`,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function deleteScheduledTask(
|
export async function deleteScheduledTask(
|
||||||
qname: string,
|
qname: string,
|
||||||
taskKey: string
|
taskId: string
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
await axios({
|
await axios({
|
||||||
method: "delete",
|
method: "delete",
|
||||||
url: `${BASE_URL}/queues/${qname}/scheduled_tasks/${taskKey}`,
|
url: `${BASE_URL}/queues/${qname}/scheduled_tasks/${taskId}`,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function batchDeleteScheduledTasks(
|
export async function batchDeleteScheduledTasks(
|
||||||
qname: string,
|
qname: string,
|
||||||
taskKeys: string[]
|
taskIds: string[]
|
||||||
): Promise<BatchDeleteTasksResponse> {
|
): Promise<BatchDeleteTasksResponse> {
|
||||||
const resp = await axios({
|
const resp = await axios({
|
||||||
method: "post",
|
method: "post",
|
||||||
url: `${BASE_URL}/queues/${qname}/scheduled_tasks:batch_delete`,
|
url: `${BASE_URL}/queues/${qname}/scheduled_tasks:batch_delete`,
|
||||||
data: {
|
data: {
|
||||||
task_keys: taskKeys,
|
task_ids: taskIds,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
return resp.data;
|
return resp.data;
|
||||||
@ -597,13 +596,13 @@ export async function deleteAllScheduledTasks(
|
|||||||
|
|
||||||
export async function batchRunScheduledTasks(
|
export async function batchRunScheduledTasks(
|
||||||
qname: string,
|
qname: string,
|
||||||
taskKeys: string[]
|
taskIds: string[]
|
||||||
): Promise<BatchRunTasksResponse> {
|
): Promise<BatchRunTasksResponse> {
|
||||||
const resp = await axios({
|
const resp = await axios({
|
||||||
method: "post",
|
method: "post",
|
||||||
url: `${BASE_URL}/queues/${qname}/scheduled_tasks:batch_run`,
|
url: `${BASE_URL}/queues/${qname}/scheduled_tasks:batch_run`,
|
||||||
data: {
|
data: {
|
||||||
task_keys: taskKeys,
|
task_ids: taskIds,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
return resp.data;
|
return resp.data;
|
||||||
@ -618,13 +617,13 @@ export async function runAllScheduledTasks(qname: string): Promise<void> {
|
|||||||
|
|
||||||
export async function batchArchiveScheduledTasks(
|
export async function batchArchiveScheduledTasks(
|
||||||
qname: string,
|
qname: string,
|
||||||
taskKeys: string[]
|
taskIds: string[]
|
||||||
): Promise<BatchArchiveTasksResponse> {
|
): Promise<BatchArchiveTasksResponse> {
|
||||||
const resp = await axios({
|
const resp = await axios({
|
||||||
method: "post",
|
method: "post",
|
||||||
url: `${BASE_URL}/queues/${qname}/scheduled_tasks:batch_archive`,
|
url: `${BASE_URL}/queues/${qname}/scheduled_tasks:batch_archive`,
|
||||||
data: {
|
data: {
|
||||||
task_keys: taskKeys,
|
task_ids: taskIds,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
return resp.data;
|
return resp.data;
|
||||||
@ -639,43 +638,43 @@ export async function archiveAllScheduledTasks(qname: string): Promise<void> {
|
|||||||
|
|
||||||
export async function runRetryTask(
|
export async function runRetryTask(
|
||||||
qname: string,
|
qname: string,
|
||||||
taskKey: string
|
taskId: string
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
await axios({
|
await axios({
|
||||||
method: "post",
|
method: "post",
|
||||||
url: `${BASE_URL}/queues/${qname}/retry_tasks/${taskKey}:run`,
|
url: `${BASE_URL}/queues/${qname}/retry_tasks/${taskId}:run`,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function archiveRetryTask(
|
export async function archiveRetryTask(
|
||||||
qname: string,
|
qname: string,
|
||||||
taskKey: string
|
taskId: string
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
await axios({
|
await axios({
|
||||||
method: "post",
|
method: "post",
|
||||||
url: `${BASE_URL}/queues/${qname}/retry_tasks/${taskKey}:archive`,
|
url: `${BASE_URL}/queues/${qname}/retry_tasks/${taskId}:archive`,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function deleteRetryTask(
|
export async function deleteRetryTask(
|
||||||
qname: string,
|
qname: string,
|
||||||
taskKey: string
|
taskId: string
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
await axios({
|
await axios({
|
||||||
method: "delete",
|
method: "delete",
|
||||||
url: `${BASE_URL}/queues/${qname}/retry_tasks/${taskKey}`,
|
url: `${BASE_URL}/queues/${qname}/retry_tasks/${taskId}`,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function batchDeleteRetryTasks(
|
export async function batchDeleteRetryTasks(
|
||||||
qname: string,
|
qname: string,
|
||||||
taskKeys: string[]
|
taskIds: string[]
|
||||||
): Promise<BatchDeleteTasksResponse> {
|
): Promise<BatchDeleteTasksResponse> {
|
||||||
const resp = await axios({
|
const resp = await axios({
|
||||||
method: "post",
|
method: "post",
|
||||||
url: `${BASE_URL}/queues/${qname}/retry_tasks:batch_delete`,
|
url: `${BASE_URL}/queues/${qname}/retry_tasks:batch_delete`,
|
||||||
data: {
|
data: {
|
||||||
task_keys: taskKeys,
|
task_ids: taskIds,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
return resp.data;
|
return resp.data;
|
||||||
@ -693,13 +692,13 @@ export async function deleteAllRetryTasks(
|
|||||||
|
|
||||||
export async function batchRunRetryTasks(
|
export async function batchRunRetryTasks(
|
||||||
qname: string,
|
qname: string,
|
||||||
taskKeys: string[]
|
taskIds: string[]
|
||||||
): Promise<BatchRunTasksResponse> {
|
): Promise<BatchRunTasksResponse> {
|
||||||
const resp = await axios({
|
const resp = await axios({
|
||||||
method: "post",
|
method: "post",
|
||||||
url: `${BASE_URL}/queues/${qname}/retry_tasks:batch_run`,
|
url: `${BASE_URL}/queues/${qname}/retry_tasks:batch_run`,
|
||||||
data: {
|
data: {
|
||||||
task_keys: taskKeys,
|
task_ids: taskIds,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
return resp.data;
|
return resp.data;
|
||||||
@ -714,13 +713,13 @@ export async function runAllRetryTasks(qname: string): Promise<void> {
|
|||||||
|
|
||||||
export async function batchArchiveRetryTasks(
|
export async function batchArchiveRetryTasks(
|
||||||
qname: string,
|
qname: string,
|
||||||
taskKeys: string[]
|
taskIds: string[]
|
||||||
): Promise<BatchArchiveTasksResponse> {
|
): Promise<BatchArchiveTasksResponse> {
|
||||||
const resp = await axios({
|
const resp = await axios({
|
||||||
method: "post",
|
method: "post",
|
||||||
url: `${BASE_URL}/queues/${qname}/retry_tasks:batch_archive`,
|
url: `${BASE_URL}/queues/${qname}/retry_tasks:batch_archive`,
|
||||||
data: {
|
data: {
|
||||||
task_keys: taskKeys,
|
task_ids: taskIds,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
return resp.data;
|
return resp.data;
|
||||||
@ -735,33 +734,33 @@ export async function archiveAllRetryTasks(qname: string): Promise<void> {
|
|||||||
|
|
||||||
export async function runArchivedTask(
|
export async function runArchivedTask(
|
||||||
qname: string,
|
qname: string,
|
||||||
taskKey: string
|
taskId: string
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
await axios({
|
await axios({
|
||||||
method: "post",
|
method: "post",
|
||||||
url: `${BASE_URL}/queues/${qname}/archived_tasks/${taskKey}:run`,
|
url: `${BASE_URL}/queues/${qname}/archived_tasks/${taskId}:run`,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function deleteArchivedTask(
|
export async function deleteArchivedTask(
|
||||||
qname: string,
|
qname: string,
|
||||||
taskKey: string
|
taskId: string
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
await axios({
|
await axios({
|
||||||
method: "delete",
|
method: "delete",
|
||||||
url: `${BASE_URL}/queues/${qname}/archived_tasks/${taskKey}`,
|
url: `${BASE_URL}/queues/${qname}/archived_tasks/${taskId}`,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function batchDeleteArchivedTasks(
|
export async function batchDeleteArchivedTasks(
|
||||||
qname: string,
|
qname: string,
|
||||||
taskKeys: string[]
|
taskIds: string[]
|
||||||
): Promise<BatchDeleteTasksResponse> {
|
): Promise<BatchDeleteTasksResponse> {
|
||||||
const resp = await axios({
|
const resp = await axios({
|
||||||
method: "post",
|
method: "post",
|
||||||
url: `${BASE_URL}/queues/${qname}/archived_tasks:batch_delete`,
|
url: `${BASE_URL}/queues/${qname}/archived_tasks:batch_delete`,
|
||||||
data: {
|
data: {
|
||||||
task_keys: taskKeys,
|
task_ids: taskIds,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
return resp.data;
|
return resp.data;
|
||||||
@ -779,13 +778,13 @@ export async function deleteAllArchivedTasks(
|
|||||||
|
|
||||||
export async function batchRunArchivedTasks(
|
export async function batchRunArchivedTasks(
|
||||||
qname: string,
|
qname: string,
|
||||||
taskKeys: string[]
|
taskIds: string[]
|
||||||
): Promise<BatchRunTasksResponse> {
|
): Promise<BatchRunTasksResponse> {
|
||||||
const resp = await axios({
|
const resp = await axios({
|
||||||
method: "post",
|
method: "post",
|
||||||
url: `${BASE_URL}/queues/${qname}/archived_tasks:batch_run`,
|
url: `${BASE_URL}/queues/${qname}/archived_tasks:batch_run`,
|
||||||
data: {
|
data: {
|
||||||
task_keys: taskKeys,
|
task_ids: taskIds,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
return resp.data;
|
return resp.data;
|
||||||
|
@ -91,7 +91,7 @@ function ArchivedTasksTable(props: Props & ReduxProps) {
|
|||||||
const { pollInterval, listArchivedTasksAsync, queue, pageSize } = props;
|
const { pollInterval, listArchivedTasksAsync, queue, pageSize } = props;
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
const [page, setPage] = useState(0);
|
const [page, setPage] = useState(0);
|
||||||
const [selectedKeys, setSelectedKeys] = useState<string[]>([]);
|
const [selectedIds, setSelectedIds] = useState<string[]>([]);
|
||||||
const [activeTaskId, setActiveTaskId] = useState<string>("");
|
const [activeTaskId, setActiveTaskId] = useState<string>("");
|
||||||
|
|
||||||
const handleChangePage = (
|
const handleChangePage = (
|
||||||
@ -110,10 +110,10 @@ function ArchivedTasksTable(props: Props & ReduxProps) {
|
|||||||
|
|
||||||
const handleSelectAllClick = (event: React.ChangeEvent<HTMLInputElement>) => {
|
const handleSelectAllClick = (event: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
if (event.target.checked) {
|
if (event.target.checked) {
|
||||||
const newSelected = props.tasks.map((t) => t.key);
|
const newSelected = props.tasks.map((t) => t.id);
|
||||||
setSelectedKeys(newSelected);
|
setSelectedIds(newSelected);
|
||||||
} else {
|
} else {
|
||||||
setSelectedKeys([]);
|
setSelectedIds([]);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -127,14 +127,14 @@ function ArchivedTasksTable(props: Props & ReduxProps) {
|
|||||||
|
|
||||||
const handleBatchRunClick = () => {
|
const handleBatchRunClick = () => {
|
||||||
props
|
props
|
||||||
.batchRunArchivedTasksAsync(queue, selectedKeys)
|
.batchRunArchivedTasksAsync(queue, selectedIds)
|
||||||
.then(() => setSelectedKeys([]));
|
.then(() => setSelectedIds([]));
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleBatchDeleteClick = () => {
|
const handleBatchDeleteClick = () => {
|
||||||
props
|
props
|
||||||
.batchDeleteArchivedTasksAsync(queue, selectedKeys)
|
.batchDeleteArchivedTasksAsync(queue, selectedIds)
|
||||||
.then(() => setSelectedKeys([]));
|
.then(() => setSelectedIds([]));
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchData = useCallback(() => {
|
const fetchData = useCallback(() => {
|
||||||
@ -171,7 +171,7 @@ function ArchivedTasksTable(props: Props & ReduxProps) {
|
|||||||
];
|
];
|
||||||
|
|
||||||
const rowCount = props.tasks.length;
|
const rowCount = props.tasks.length;
|
||||||
const numSelected = selectedKeys.length;
|
const numSelected = selectedIds.length;
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<TableActions
|
<TableActions
|
||||||
@ -239,23 +239,21 @@ function ArchivedTasksTable(props: Props & ReduxProps) {
|
|||||||
<TableBody>
|
<TableBody>
|
||||||
{props.tasks.map((task) => (
|
{props.tasks.map((task) => (
|
||||||
<Row
|
<Row
|
||||||
key={task.key}
|
key={task.id}
|
||||||
task={task}
|
task={task}
|
||||||
isSelected={selectedKeys.includes(task.key)}
|
isSelected={selectedIds.includes(task.id)}
|
||||||
onSelectChange={(checked: boolean) => {
|
onSelectChange={(checked: boolean) => {
|
||||||
if (checked) {
|
if (checked) {
|
||||||
setSelectedKeys(selectedKeys.concat(task.key));
|
setSelectedIds(selectedIds.concat(task.id));
|
||||||
} else {
|
} else {
|
||||||
setSelectedKeys(
|
setSelectedIds(selectedIds.filter((id) => id !== task.id));
|
||||||
selectedKeys.filter((key) => key !== task.key)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
onRunClick={() => {
|
onRunClick={() => {
|
||||||
props.runArchivedTaskAsync(queue, task.key);
|
props.runArchivedTaskAsync(queue, task.id);
|
||||||
}}
|
}}
|
||||||
onDeleteClick={() => {
|
onDeleteClick={() => {
|
||||||
props.deleteArchivedTaskAsync(queue, task.key);
|
props.deleteArchivedTaskAsync(queue, task.id);
|
||||||
}}
|
}}
|
||||||
allActionPending={props.allActionPending}
|
allActionPending={props.allActionPending}
|
||||||
onActionCellEnter={() => setActiveTaskId(task.id)}
|
onActionCellEnter={() => setActiveTaskId(task.id)}
|
||||||
|
@ -1,388 +0,0 @@
|
|||||||
import React, { useCallback, useState } from "react";
|
|
||||||
import clsx from "clsx";
|
|
||||||
import { connect, ConnectedProps } from "react-redux";
|
|
||||||
import { makeStyles } from "@material-ui/core/styles";
|
|
||||||
import Table from "@material-ui/core/Table";
|
|
||||||
import TableBody from "@material-ui/core/TableBody";
|
|
||||||
import TableCell from "@material-ui/core/TableCell";
|
|
||||||
import Checkbox from "@material-ui/core/Checkbox";
|
|
||||||
import TableContainer from "@material-ui/core/TableContainer";
|
|
||||||
import TableHead from "@material-ui/core/TableHead";
|
|
||||||
import TableRow from "@material-ui/core/TableRow";
|
|
||||||
import Tooltip from "@material-ui/core/Tooltip";
|
|
||||||
import Paper from "@material-ui/core/Paper";
|
|
||||||
import Box from "@material-ui/core/Box";
|
|
||||||
import Collapse from "@material-ui/core/Collapse";
|
|
||||||
import IconButton from "@material-ui/core/IconButton";
|
|
||||||
import PlayArrowIcon from "@material-ui/icons/PlayArrow";
|
|
||||||
import DeleteIcon from "@material-ui/icons/Delete";
|
|
||||||
import MoreHorizIcon from "@material-ui/icons/MoreHoriz";
|
|
||||||
import KeyboardArrowUpIcon from "@material-ui/icons/KeyboardArrowUp";
|
|
||||||
import KeyboardArrowDownIcon from "@material-ui/icons/KeyboardArrowDown";
|
|
||||||
import Typography from "@material-ui/core/Typography";
|
|
||||||
import TableFooter from "@material-ui/core/TableFooter";
|
|
||||||
import TablePagination from "@material-ui/core/TablePagination";
|
|
||||||
import Alert from "@material-ui/lab/Alert";
|
|
||||||
import AlertTitle from "@material-ui/lab/AlertTitle";
|
|
||||||
import SyntaxHighlighter from "./SyntaxHighlighter";
|
|
||||||
import { AppState } from "../store";
|
|
||||||
import {
|
|
||||||
batchDeleteArchivedTasksAsync,
|
|
||||||
batchRunArchivedTasksAsync,
|
|
||||||
deleteArchivedTaskAsync,
|
|
||||||
deleteAllArchivedTasksAsync,
|
|
||||||
listArchivedTasksAsync,
|
|
||||||
runArchivedTaskAsync,
|
|
||||||
runAllArchivedTasksAsync,
|
|
||||||
} from "../actions/tasksActions";
|
|
||||||
import TablePaginationActions, {
|
|
||||||
defaultPageSize,
|
|
||||||
rowsPerPageOptions,
|
|
||||||
} from "./TablePaginationActions";
|
|
||||||
import TableActions from "./TableActions";
|
|
||||||
import { timeAgo, uuidPrefix } from "../utils";
|
|
||||||
import { usePolling } from "../hooks";
|
|
||||||
import { ArchivedTaskExtended } from "../reducers/tasksReducer";
|
|
||||||
import { TableColumn } from "../types/table";
|
|
||||||
|
|
||||||
const useStyles = makeStyles({
|
|
||||||
table: {
|
|
||||||
minWidth: 650,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
const useRowStyles = makeStyles({
|
|
||||||
root: {
|
|
||||||
"& > *": {
|
|
||||||
borderBottom: "unset",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
actionCell: {
|
|
||||||
width: "96px",
|
|
||||||
},
|
|
||||||
activeActionCell: {
|
|
||||||
display: "flex",
|
|
||||||
justifyContent: "space-between",
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
function mapStateToProps(state: AppState) {
|
|
||||||
return {
|
|
||||||
loading: state.tasks.archivedTasks.loading,
|
|
||||||
tasks: state.tasks.archivedTasks.data,
|
|
||||||
batchActionPending: state.tasks.archivedTasks.batchActionPending,
|
|
||||||
allActionPending: state.tasks.archivedTasks.allActionPending,
|
|
||||||
pollInterval: state.settings.pollInterval,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
const mapDispatchToProps = {
|
|
||||||
listArchivedTasksAsync,
|
|
||||||
runArchivedTaskAsync,
|
|
||||||
runAllArchivedTasksAsync,
|
|
||||||
deleteArchivedTaskAsync,
|
|
||||||
deleteAllArchivedTasksAsync,
|
|
||||||
batchRunArchivedTasksAsync,
|
|
||||||
batchDeleteArchivedTasksAsync,
|
|
||||||
};
|
|
||||||
|
|
||||||
const connector = connect(mapStateToProps, mapDispatchToProps);
|
|
||||||
|
|
||||||
type ReduxProps = ConnectedProps<typeof connector>;
|
|
||||||
|
|
||||||
interface Props {
|
|
||||||
queue: string; // name of the queue.
|
|
||||||
totalTaskCount: number; // totoal number of archived tasks.
|
|
||||||
}
|
|
||||||
|
|
||||||
function ArchivedTasksTable(props: Props & ReduxProps) {
|
|
||||||
const { pollInterval, listArchivedTasksAsync, queue } = props;
|
|
||||||
const classes = useStyles();
|
|
||||||
const [page, setPage] = useState(0);
|
|
||||||
const [pageSize, setPageSize] = useState(defaultPageSize);
|
|
||||||
const [selectedKeys, setSelectedKeys] = useState<string[]>([]);
|
|
||||||
const [activeTaskId, setActiveTaskId] = useState<string>("");
|
|
||||||
|
|
||||||
const handleChangePage = (
|
|
||||||
event: React.MouseEvent<HTMLButtonElement> | null,
|
|
||||||
newPage: number
|
|
||||||
) => {
|
|
||||||
setPage(newPage);
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleChangeRowsPerPage = (
|
|
||||||
event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>
|
|
||||||
) => {
|
|
||||||
setPageSize(parseInt(event.target.value, 10));
|
|
||||||
setPage(0);
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleSelectAllClick = (event: React.ChangeEvent<HTMLInputElement>) => {
|
|
||||||
if (event.target.checked) {
|
|
||||||
const newSelected = props.tasks.map((t) => t.key);
|
|
||||||
setSelectedKeys(newSelected);
|
|
||||||
} else {
|
|
||||||
setSelectedKeys([]);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleRunAllClick = () => {
|
|
||||||
props.runAllArchivedTasksAsync(queue);
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleDeleteAllClick = () => {
|
|
||||||
props.deleteAllArchivedTasksAsync(queue);
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleBatchRunClick = () => {
|
|
||||||
props
|
|
||||||
.batchRunArchivedTasksAsync(queue, selectedKeys)
|
|
||||||
.then(() => setSelectedKeys([]));
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleBatchDeleteClick = () => {
|
|
||||||
props
|
|
||||||
.batchDeleteArchivedTasksAsync(queue, selectedKeys)
|
|
||||||
.then(() => setSelectedKeys([]));
|
|
||||||
};
|
|
||||||
|
|
||||||
const fetchData = useCallback(() => {
|
|
||||||
const pageOpts = { page: page + 1, size: pageSize };
|
|
||||||
listArchivedTasksAsync(queue, pageOpts);
|
|
||||||
}, [page, pageSize, queue, listArchivedTasksAsync]);
|
|
||||||
|
|
||||||
usePolling(fetchData, pollInterval);
|
|
||||||
|
|
||||||
if (props.tasks.length === 0) {
|
|
||||||
return (
|
|
||||||
<Alert severity="info">
|
|
||||||
<AlertTitle>Info</AlertTitle>
|
|
||||||
No archived tasks at this time.
|
|
||||||
</Alert>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const columns: TableColumn[] = [
|
|
||||||
{ key: "icon", label: "", align: "left" },
|
|
||||||
{ key: "id", label: "ID", align: "left" },
|
|
||||||
{ key: "type", label: "Type", align: "left" },
|
|
||||||
{ key: "last_failed", label: "Last Failed", align: "left" },
|
|
||||||
{ key: "last_error", label: "Last Error", align: "left" },
|
|
||||||
{ key: "actions", label: "Actions", align: "center" },
|
|
||||||
];
|
|
||||||
|
|
||||||
const rowCount = props.tasks.length;
|
|
||||||
const numSelected = selectedKeys.length;
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
<TableActions
|
|
||||||
showIconButtons={numSelected > 0}
|
|
||||||
iconButtonActions={[
|
|
||||||
{
|
|
||||||
tooltip: "Delete",
|
|
||||||
icon: <DeleteIcon />,
|
|
||||||
onClick: handleBatchDeleteClick,
|
|
||||||
disabled: props.batchActionPending,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
tooltip: "Run",
|
|
||||||
icon: <PlayArrowIcon />,
|
|
||||||
onClick: handleBatchRunClick,
|
|
||||||
disabled: props.batchActionPending,
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
menuItemActions={[
|
|
||||||
{
|
|
||||||
label: "Delete All",
|
|
||||||
onClick: handleDeleteAllClick,
|
|
||||||
disabled: props.allActionPending,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "Run All",
|
|
||||||
onClick: handleRunAllClick,
|
|
||||||
disabled: props.allActionPending,
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
<TableContainer component={Paper}>
|
|
||||||
<Table
|
|
||||||
stickyHeader={true}
|
|
||||||
className={classes.table}
|
|
||||||
aria-label="archived tasks table"
|
|
||||||
size="small"
|
|
||||||
>
|
|
||||||
<TableHead>
|
|
||||||
<TableRow>
|
|
||||||
<TableCell padding="checkbox">
|
|
||||||
<Checkbox
|
|
||||||
indeterminate={numSelected > 0 && numSelected < rowCount}
|
|
||||||
checked={rowCount > 0 && numSelected === rowCount}
|
|
||||||
onChange={handleSelectAllClick}
|
|
||||||
inputProps={{
|
|
||||||
"aria-label": "select all tasks shown in the table",
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</TableCell>
|
|
||||||
{columns.map((col) => (
|
|
||||||
<TableCell key={col.key} align={col.align}>
|
|
||||||
{col.label}
|
|
||||||
</TableCell>
|
|
||||||
))}
|
|
||||||
</TableRow>
|
|
||||||
</TableHead>
|
|
||||||
<TableBody>
|
|
||||||
{props.tasks.map((task) => (
|
|
||||||
<Row
|
|
||||||
key={task.key}
|
|
||||||
task={task}
|
|
||||||
isSelected={selectedKeys.includes(task.key)}
|
|
||||||
onSelectChange={(checked: boolean) => {
|
|
||||||
if (checked) {
|
|
||||||
setSelectedKeys(selectedKeys.concat(task.key));
|
|
||||||
} else {
|
|
||||||
setSelectedKeys(
|
|
||||||
selectedKeys.filter((key) => key !== task.key)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
onRunClick={() => {
|
|
||||||
props.runArchivedTaskAsync(queue, task.key);
|
|
||||||
}}
|
|
||||||
onDeleteClick={() => {
|
|
||||||
props.deleteArchivedTaskAsync(queue, task.key);
|
|
||||||
}}
|
|
||||||
allActionPending={props.allActionPending}
|
|
||||||
onActionCellEnter={() => setActiveTaskId(task.id)}
|
|
||||||
onActionCellLeave={() => setActiveTaskId("")}
|
|
||||||
showActions={activeTaskId === task.id}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</TableBody>
|
|
||||||
<TableFooter>
|
|
||||||
<TableRow>
|
|
||||||
<TablePagination
|
|
||||||
rowsPerPageOptions={rowsPerPageOptions}
|
|
||||||
colSpan={columns.length + 1 /* checkbox col */}
|
|
||||||
count={props.totalTaskCount}
|
|
||||||
rowsPerPage={pageSize}
|
|
||||||
page={page}
|
|
||||||
SelectProps={{
|
|
||||||
inputProps: { "aria-label": "rows per page" },
|
|
||||||
native: true,
|
|
||||||
}}
|
|
||||||
onChangePage={handleChangePage}
|
|
||||||
onChangeRowsPerPage={handleChangeRowsPerPage}
|
|
||||||
ActionsComponent={TablePaginationActions}
|
|
||||||
/>
|
|
||||||
</TableRow>
|
|
||||||
</TableFooter>
|
|
||||||
</Table>
|
|
||||||
</TableContainer>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
interface RowProps {
|
|
||||||
task: ArchivedTaskExtended;
|
|
||||||
isSelected: boolean;
|
|
||||||
onSelectChange: (checked: boolean) => void;
|
|
||||||
onRunClick: () => void;
|
|
||||||
onDeleteClick: () => void;
|
|
||||||
allActionPending: boolean;
|
|
||||||
showActions: boolean;
|
|
||||||
onActionCellEnter: () => void;
|
|
||||||
onActionCellLeave: () => void;
|
|
||||||
}
|
|
||||||
|
|
||||||
function Row(props: RowProps) {
|
|
||||||
const { task } = props;
|
|
||||||
const [open, setOpen] = useState(false);
|
|
||||||
const classes = useRowStyles();
|
|
||||||
return (
|
|
||||||
<React.Fragment>
|
|
||||||
<TableRow
|
|
||||||
key={task.id}
|
|
||||||
className={classes.root}
|
|
||||||
selected={props.isSelected}
|
|
||||||
>
|
|
||||||
<TableCell padding="checkbox">
|
|
||||||
<Checkbox
|
|
||||||
onChange={(event: React.ChangeEvent<HTMLInputElement>) =>
|
|
||||||
props.onSelectChange(event.target.checked)
|
|
||||||
}
|
|
||||||
checked={props.isSelected}
|
|
||||||
/>
|
|
||||||
</TableCell>
|
|
||||||
<TableCell>
|
|
||||||
<Tooltip title={open ? "Hide Details" : "Show Details"}>
|
|
||||||
<IconButton
|
|
||||||
aria-label="expand row"
|
|
||||||
size="small"
|
|
||||||
onClick={() => setOpen(!open)}
|
|
||||||
>
|
|
||||||
{open ? <KeyboardArrowUpIcon /> : <KeyboardArrowDownIcon />}
|
|
||||||
</IconButton>
|
|
||||||
</Tooltip>
|
|
||||||
</TableCell>
|
|
||||||
<TableCell component="th" scope="row">
|
|
||||||
{uuidPrefix(task.id)}
|
|
||||||
</TableCell>
|
|
||||||
<TableCell>{task.type}</TableCell>
|
|
||||||
<TableCell>{timeAgo(task.last_failed_at)}</TableCell>
|
|
||||||
<TableCell>{task.error_message}</TableCell>
|
|
||||||
<TableCell
|
|
||||||
align="center"
|
|
||||||
className={clsx(
|
|
||||||
classes.actionCell,
|
|
||||||
props.showActions && classes.activeActionCell
|
|
||||||
)}
|
|
||||||
onMouseEnter={props.onActionCellEnter}
|
|
||||||
onMouseLeave={props.onActionCellLeave}
|
|
||||||
>
|
|
||||||
{props.showActions ? (
|
|
||||||
<React.Fragment>
|
|
||||||
<Tooltip title="Delete">
|
|
||||||
<IconButton
|
|
||||||
onClick={props.onDeleteClick}
|
|
||||||
disabled={task.requestPending || props.allActionPending}
|
|
||||||
size="small"
|
|
||||||
>
|
|
||||||
<DeleteIcon fontSize="small" />
|
|
||||||
</IconButton>
|
|
||||||
</Tooltip>
|
|
||||||
<Tooltip title="Run">
|
|
||||||
<IconButton
|
|
||||||
onClick={props.onRunClick}
|
|
||||||
disabled={task.requestPending || props.allActionPending}
|
|
||||||
size="small"
|
|
||||||
>
|
|
||||||
<PlayArrowIcon fontSize="small" />
|
|
||||||
</IconButton>
|
|
||||||
</Tooltip>
|
|
||||||
</React.Fragment>
|
|
||||||
) : (
|
|
||||||
<IconButton size="small" onClick={props.onActionCellEnter}>
|
|
||||||
<MoreHorizIcon fontSize="small" />
|
|
||||||
</IconButton>
|
|
||||||
)}
|
|
||||||
</TableCell>
|
|
||||||
</TableRow>
|
|
||||||
<TableRow selected={props.isSelected}>
|
|
||||||
<TableCell style={{ paddingBottom: 0, paddingTop: 0 }} colSpan={7}>
|
|
||||||
<Collapse in={open} timeout="auto" unmountOnExit>
|
|
||||||
<Box margin={1}>
|
|
||||||
<Typography variant="h6" gutterBottom component="div">
|
|
||||||
Payload
|
|
||||||
</Typography>
|
|
||||||
<SyntaxHighlighter language="json">
|
|
||||||
{JSON.stringify(task.payload, null, 2)}
|
|
||||||
</SyntaxHighlighter>
|
|
||||||
</Box>
|
|
||||||
</Collapse>
|
|
||||||
</TableCell>
|
|
||||||
</TableRow>
|
|
||||||
</React.Fragment>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default connector(ArchivedTasksTable);
|
|
@ -91,7 +91,7 @@ function PendingTasksTable(props: Props & ReduxProps) {
|
|||||||
const { pollInterval, listPendingTasksAsync, queue, pageSize } = props;
|
const { pollInterval, listPendingTasksAsync, queue, pageSize } = props;
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
const [page, setPage] = useState(0);
|
const [page, setPage] = useState(0);
|
||||||
const [selectedKeys, setSelectedKeys] = useState<string[]>([]);
|
const [selectedIds, setSelectedIds] = useState<string[]>([]);
|
||||||
const [activeTaskId, setActiveTaskId] = useState<string>("");
|
const [activeTaskId, setActiveTaskId] = useState<string>("");
|
||||||
|
|
||||||
const handleChangePage = (
|
const handleChangePage = (
|
||||||
@ -110,10 +110,10 @@ function PendingTasksTable(props: Props & ReduxProps) {
|
|||||||
|
|
||||||
const handleSelectAllClick = (event: React.ChangeEvent<HTMLInputElement>) => {
|
const handleSelectAllClick = (event: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
if (event.target.checked) {
|
if (event.target.checked) {
|
||||||
const newSelected = props.tasks.map((t) => t.key);
|
const newSelected = props.tasks.map((t) => t.id);
|
||||||
setSelectedKeys(newSelected);
|
setSelectedIds(newSelected);
|
||||||
} else {
|
} else {
|
||||||
setSelectedKeys([]);
|
setSelectedIds([]);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -127,14 +127,14 @@ function PendingTasksTable(props: Props & ReduxProps) {
|
|||||||
|
|
||||||
const handleBatchDeleteClick = () => {
|
const handleBatchDeleteClick = () => {
|
||||||
props
|
props
|
||||||
.batchDeletePendingTasksAsync(queue, selectedKeys)
|
.batchDeletePendingTasksAsync(queue, selectedIds)
|
||||||
.then(() => setSelectedKeys([]));
|
.then(() => setSelectedIds([]));
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleBatchArchiveClick = () => {
|
const handleBatchArchiveClick = () => {
|
||||||
props
|
props
|
||||||
.batchArchivePendingTasksAsync(queue, selectedKeys)
|
.batchArchivePendingTasksAsync(queue, selectedIds)
|
||||||
.then(() => setSelectedKeys([]));
|
.then(() => setSelectedIds([]));
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchData = useCallback(() => {
|
const fetchData = useCallback(() => {
|
||||||
@ -171,7 +171,7 @@ function PendingTasksTable(props: Props & ReduxProps) {
|
|||||||
];
|
];
|
||||||
|
|
||||||
const rowCount = props.tasks.length;
|
const rowCount = props.tasks.length;
|
||||||
const numSelected = selectedKeys.length;
|
const numSelected = selectedIds.length;
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<TableActions
|
<TableActions
|
||||||
@ -243,22 +243,20 @@ function PendingTasksTable(props: Props & ReduxProps) {
|
|||||||
<Row
|
<Row
|
||||||
key={task.id}
|
key={task.id}
|
||||||
task={task}
|
task={task}
|
||||||
isSelected={selectedKeys.includes(task.key)}
|
isSelected={selectedIds.includes(task.id)}
|
||||||
onSelectChange={(checked: boolean) => {
|
onSelectChange={(checked: boolean) => {
|
||||||
if (checked) {
|
if (checked) {
|
||||||
setSelectedKeys(selectedKeys.concat(task.key));
|
setSelectedIds(selectedIds.concat(task.id));
|
||||||
} else {
|
} else {
|
||||||
setSelectedKeys(
|
setSelectedIds(selectedIds.filter((id) => id !== task.id));
|
||||||
selectedKeys.filter((key) => key !== task.key)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
allActionPending={props.allActionPending}
|
allActionPending={props.allActionPending}
|
||||||
onDeleteClick={() =>
|
onDeleteClick={() =>
|
||||||
props.deletePendingTaskAsync(queue, task.key)
|
props.deletePendingTaskAsync(queue, task.id)
|
||||||
}
|
}
|
||||||
onArchiveClick={() => {
|
onArchiveClick={() => {
|
||||||
props.archivePendingTaskAsync(queue, task.key);
|
props.archivePendingTaskAsync(queue, task.id);
|
||||||
}}
|
}}
|
||||||
onActionCellEnter={() => setActiveTaskId(task.id)}
|
onActionCellEnter={() => setActiveTaskId(task.id)}
|
||||||
onActionCellLeave={() => setActiveTaskId("")}
|
onActionCellLeave={() => setActiveTaskId("")}
|
||||||
|
@ -98,7 +98,7 @@ function RetryTasksTable(props: Props & ReduxProps) {
|
|||||||
const { pollInterval, listRetryTasksAsync, queue, pageSize } = props;
|
const { pollInterval, listRetryTasksAsync, queue, pageSize } = props;
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
const [page, setPage] = useState(0);
|
const [page, setPage] = useState(0);
|
||||||
const [selectedKeys, setSelectedKeys] = useState<string[]>([]);
|
const [selectedIds, setSelectedIds] = useState<string[]>([]);
|
||||||
const [activeTaskId, setActiveTaskId] = useState<string>("");
|
const [activeTaskId, setActiveTaskId] = useState<string>("");
|
||||||
|
|
||||||
const handleChangePage = (
|
const handleChangePage = (
|
||||||
@ -117,10 +117,10 @@ function RetryTasksTable(props: Props & ReduxProps) {
|
|||||||
|
|
||||||
const handleSelectAllClick = (event: React.ChangeEvent<HTMLInputElement>) => {
|
const handleSelectAllClick = (event: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
if (event.target.checked) {
|
if (event.target.checked) {
|
||||||
const newSelected = props.tasks.map((t) => t.key);
|
const newSelected = props.tasks.map((t) => t.id);
|
||||||
setSelectedKeys(newSelected);
|
setSelectedIds(newSelected);
|
||||||
} else {
|
} else {
|
||||||
setSelectedKeys([]);
|
setSelectedIds([]);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -138,20 +138,20 @@ function RetryTasksTable(props: Props & ReduxProps) {
|
|||||||
|
|
||||||
const handleBatchRunClick = () => {
|
const handleBatchRunClick = () => {
|
||||||
props
|
props
|
||||||
.batchRunRetryTasksAsync(queue, selectedKeys)
|
.batchRunRetryTasksAsync(queue, selectedIds)
|
||||||
.then(() => setSelectedKeys([]));
|
.then(() => setSelectedIds([]));
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleBatchDeleteClick = () => {
|
const handleBatchDeleteClick = () => {
|
||||||
props
|
props
|
||||||
.batchDeleteRetryTasksAsync(queue, selectedKeys)
|
.batchDeleteRetryTasksAsync(queue, selectedIds)
|
||||||
.then(() => setSelectedKeys([]));
|
.then(() => setSelectedIds([]));
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleBatchArchiveClick = () => {
|
const handleBatchArchiveClick = () => {
|
||||||
props
|
props
|
||||||
.batchArchiveRetryTasksAsync(queue, selectedKeys)
|
.batchArchiveRetryTasksAsync(queue, selectedIds)
|
||||||
.then(() => setSelectedKeys([]));
|
.then(() => setSelectedIds([]));
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchData = useCallback(() => {
|
const fetchData = useCallback(() => {
|
||||||
@ -190,7 +190,7 @@ function RetryTasksTable(props: Props & ReduxProps) {
|
|||||||
];
|
];
|
||||||
|
|
||||||
const rowCount = props.tasks.length;
|
const rowCount = props.tasks.length;
|
||||||
const numSelected = selectedKeys.length;
|
const numSelected = selectedIds.length;
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<TableActions
|
<TableActions
|
||||||
@ -272,24 +272,22 @@ function RetryTasksTable(props: Props & ReduxProps) {
|
|||||||
key={task.id}
|
key={task.id}
|
||||||
task={task}
|
task={task}
|
||||||
allActionPending={props.allActionPending}
|
allActionPending={props.allActionPending}
|
||||||
isSelected={selectedKeys.includes(task.key)}
|
isSelected={selectedIds.includes(task.id)}
|
||||||
onSelectChange={(checked: boolean) => {
|
onSelectChange={(checked: boolean) => {
|
||||||
if (checked) {
|
if (checked) {
|
||||||
setSelectedKeys(selectedKeys.concat(task.key));
|
setSelectedIds(selectedIds.concat(task.id));
|
||||||
} else {
|
} else {
|
||||||
setSelectedKeys(
|
setSelectedIds(selectedIds.filter((id) => id !== task.id));
|
||||||
selectedKeys.filter((key) => key !== task.key)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
onRunClick={() => {
|
onRunClick={() => {
|
||||||
props.runRetryTaskAsync(task.queue, task.key);
|
props.runRetryTaskAsync(task.queue, task.id);
|
||||||
}}
|
}}
|
||||||
onDeleteClick={() => {
|
onDeleteClick={() => {
|
||||||
props.deleteRetryTaskAsync(task.queue, task.key);
|
props.deleteRetryTaskAsync(task.queue, task.id);
|
||||||
}}
|
}}
|
||||||
onArchiveClick={() => {
|
onArchiveClick={() => {
|
||||||
props.archiveRetryTaskAsync(task.queue, task.key);
|
props.archiveRetryTaskAsync(task.queue, task.id);
|
||||||
}}
|
}}
|
||||||
onActionCellEnter={() => setActiveTaskId(task.id)}
|
onActionCellEnter={() => setActiveTaskId(task.id)}
|
||||||
onActionCellLeave={() => setActiveTaskId("")}
|
onActionCellLeave={() => setActiveTaskId("")}
|
||||||
|
@ -98,7 +98,7 @@ function ScheduledTasksTable(props: Props & ReduxProps) {
|
|||||||
const { pollInterval, listScheduledTasksAsync, queue, pageSize } = props;
|
const { pollInterval, listScheduledTasksAsync, queue, pageSize } = props;
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
const [page, setPage] = useState(0);
|
const [page, setPage] = useState(0);
|
||||||
const [selectedKeys, setSelectedKeys] = useState<string[]>([]);
|
const [selectedIds, setSelectedIds] = useState<string[]>([]);
|
||||||
const [activeTaskId, setActiveTaskId] = useState<string>("");
|
const [activeTaskId, setActiveTaskId] = useState<string>("");
|
||||||
|
|
||||||
const handleChangePage = (
|
const handleChangePage = (
|
||||||
@ -117,10 +117,10 @@ function ScheduledTasksTable(props: Props & ReduxProps) {
|
|||||||
|
|
||||||
const handleSelectAllClick = (event: React.ChangeEvent<HTMLInputElement>) => {
|
const handleSelectAllClick = (event: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
if (event.target.checked) {
|
if (event.target.checked) {
|
||||||
const newSelected = props.tasks.map((t) => t.key);
|
const newSelected = props.tasks.map((t) => t.id);
|
||||||
setSelectedKeys(newSelected);
|
setSelectedIds(newSelected);
|
||||||
} else {
|
} else {
|
||||||
setSelectedKeys([]);
|
setSelectedIds([]);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -138,20 +138,20 @@ function ScheduledTasksTable(props: Props & ReduxProps) {
|
|||||||
|
|
||||||
const handleBatchRunClick = () => {
|
const handleBatchRunClick = () => {
|
||||||
props
|
props
|
||||||
.batchRunScheduledTasksAsync(queue, selectedKeys)
|
.batchRunScheduledTasksAsync(queue, selectedIds)
|
||||||
.then(() => setSelectedKeys([]));
|
.then(() => setSelectedIds([]));
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleBatchDeleteClick = () => {
|
const handleBatchDeleteClick = () => {
|
||||||
props
|
props
|
||||||
.batchDeleteScheduledTasksAsync(queue, selectedKeys)
|
.batchDeleteScheduledTasksAsync(queue, selectedIds)
|
||||||
.then(() => setSelectedKeys([]));
|
.then(() => setSelectedIds([]));
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleBatchArchiveClick = () => {
|
const handleBatchArchiveClick = () => {
|
||||||
props
|
props
|
||||||
.batchArchiveScheduledTasksAsync(queue, selectedKeys)
|
.batchArchiveScheduledTasksAsync(queue, selectedIds)
|
||||||
.then(() => setSelectedKeys([]));
|
.then(() => setSelectedIds([]));
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchData = useCallback(() => {
|
const fetchData = useCallback(() => {
|
||||||
@ -187,7 +187,7 @@ function ScheduledTasksTable(props: Props & ReduxProps) {
|
|||||||
];
|
];
|
||||||
|
|
||||||
const rowCount = props.tasks.length;
|
const rowCount = props.tasks.length;
|
||||||
const numSelected = selectedKeys.length;
|
const numSelected = selectedIds.length;
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<TableActions
|
<TableActions
|
||||||
@ -269,24 +269,22 @@ function ScheduledTasksTable(props: Props & ReduxProps) {
|
|||||||
key={task.id}
|
key={task.id}
|
||||||
task={task}
|
task={task}
|
||||||
allActionPending={props.allActionPending}
|
allActionPending={props.allActionPending}
|
||||||
isSelected={selectedKeys.includes(task.key)}
|
isSelected={selectedIds.includes(task.id)}
|
||||||
onSelectChange={(checked: boolean) => {
|
onSelectChange={(checked: boolean) => {
|
||||||
if (checked) {
|
if (checked) {
|
||||||
setSelectedKeys(selectedKeys.concat(task.key));
|
setSelectedIds(selectedIds.concat(task.id));
|
||||||
} else {
|
} else {
|
||||||
setSelectedKeys(
|
setSelectedIds(selectedIds.filter((id) => id !== task.id));
|
||||||
selectedKeys.filter((key) => key !== task.key)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
onRunClick={() => {
|
onRunClick={() => {
|
||||||
props.runScheduledTaskAsync(queue, task.key);
|
props.runScheduledTaskAsync(queue, task.id);
|
||||||
}}
|
}}
|
||||||
onDeleteClick={() => {
|
onDeleteClick={() => {
|
||||||
props.deleteScheduledTaskAsync(queue, task.key);
|
props.deleteScheduledTaskAsync(queue, task.id);
|
||||||
}}
|
}}
|
||||||
onArchiveClick={() => {
|
onArchiveClick={() => {
|
||||||
props.archiveScheduledTaskAsync(queue, task.key);
|
props.archiveScheduledTaskAsync(queue, task.id);
|
||||||
}}
|
}}
|
||||||
onActionCellEnter={() => setActiveTaskId(task.id)}
|
onActionCellEnter={() => setActiveTaskId(task.id)}
|
||||||
onActionCellLeave={() => setActiveTaskId("")}
|
onActionCellLeave={() => setActiveTaskId("")}
|
||||||
|
@ -273,19 +273,19 @@ function Row(props: RowProps) {
|
|||||||
</TableHead>
|
</TableHead>
|
||||||
<TableBody>
|
<TableBody>
|
||||||
{server.active_workers.map((worker) => (
|
{server.active_workers.map((worker) => (
|
||||||
<TableRow key={worker.task.id}>
|
<TableRow key={worker.task_id}>
|
||||||
<TableCell component="th" scope="row">
|
<TableCell component="th" scope="row">
|
||||||
{uuidPrefix(worker.task.id)}
|
{uuidPrefix(worker.task_id)}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell>
|
<TableCell>
|
||||||
<SyntaxHighlighter
|
<SyntaxHighlighter
|
||||||
language="json"
|
language="json"
|
||||||
customStyle={{ margin: 0 }}
|
customStyle={{ margin: 0 }}
|
||||||
>
|
>
|
||||||
{JSON.stringify(worker.task.payload)}
|
{JSON.stringify(worker.task_payload)}
|
||||||
</SyntaxHighlighter>
|
</SyntaxHighlighter>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell>{worker.task.queue}</TableCell>
|
<TableCell>{worker.queue}</TableCell>
|
||||||
<TableCell>{timeAgo(worker.start_time)}</TableCell>
|
<TableCell>{timeAgo(worker.start_time)}</TableCell>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
))}
|
))}
|
||||||
|
@ -319,10 +319,10 @@ function queuesReducer(
|
|||||||
...queueInfo.currentStats,
|
...queueInfo.currentStats,
|
||||||
archived:
|
archived:
|
||||||
queueInfo.currentStats.archived +
|
queueInfo.currentStats.archived +
|
||||||
action.payload.archived_keys.length,
|
action.payload.archived_ids.length,
|
||||||
pending:
|
pending:
|
||||||
queueInfo.currentStats.pending -
|
queueInfo.currentStats.pending -
|
||||||
action.payload.archived_keys.length,
|
action.payload.archived_ids.length,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
@ -339,10 +339,10 @@ function queuesReducer(
|
|||||||
currentStats: {
|
currentStats: {
|
||||||
...queueInfo.currentStats,
|
...queueInfo.currentStats,
|
||||||
size:
|
size:
|
||||||
queueInfo.currentStats.size - action.payload.deleted_keys.length,
|
queueInfo.currentStats.size - action.payload.deleted_ids.length,
|
||||||
pending:
|
pending:
|
||||||
queueInfo.currentStats.pending -
|
queueInfo.currentStats.pending -
|
||||||
action.payload.deleted_keys.length,
|
action.payload.deleted_ids.length,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
@ -395,10 +395,10 @@ function queuesReducer(
|
|||||||
...queueInfo.currentStats,
|
...queueInfo.currentStats,
|
||||||
pending:
|
pending:
|
||||||
queueInfo.currentStats.pending +
|
queueInfo.currentStats.pending +
|
||||||
action.payload.pending_keys.length,
|
action.payload.pending_ids.length,
|
||||||
scheduled:
|
scheduled:
|
||||||
queueInfo.currentStats.scheduled -
|
queueInfo.currentStats.scheduled -
|
||||||
action.payload.pending_keys.length,
|
action.payload.pending_ids.length,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
@ -416,10 +416,10 @@ function queuesReducer(
|
|||||||
...queueInfo.currentStats,
|
...queueInfo.currentStats,
|
||||||
archived:
|
archived:
|
||||||
queueInfo.currentStats.archived +
|
queueInfo.currentStats.archived +
|
||||||
action.payload.archived_keys.length,
|
action.payload.archived_ids.length,
|
||||||
scheduled:
|
scheduled:
|
||||||
queueInfo.currentStats.scheduled -
|
queueInfo.currentStats.scheduled -
|
||||||
action.payload.archived_keys.length,
|
action.payload.archived_ids.length,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
@ -436,10 +436,10 @@ function queuesReducer(
|
|||||||
currentStats: {
|
currentStats: {
|
||||||
...queueInfo.currentStats,
|
...queueInfo.currentStats,
|
||||||
size:
|
size:
|
||||||
queueInfo.currentStats.size - action.payload.deleted_keys.length,
|
queueInfo.currentStats.size - action.payload.deleted_ids.length,
|
||||||
scheduled:
|
scheduled:
|
||||||
queueInfo.currentStats.scheduled -
|
queueInfo.currentStats.scheduled -
|
||||||
action.payload.deleted_keys.length,
|
action.payload.deleted_ids.length,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
@ -528,9 +528,9 @@ function queuesReducer(
|
|||||||
...queueInfo.currentStats,
|
...queueInfo.currentStats,
|
||||||
pending:
|
pending:
|
||||||
queueInfo.currentStats.pending +
|
queueInfo.currentStats.pending +
|
||||||
action.payload.pending_keys.length,
|
action.payload.pending_ids.length,
|
||||||
retry:
|
retry:
|
||||||
queueInfo.currentStats.retry - action.payload.pending_keys.length,
|
queueInfo.currentStats.retry - action.payload.pending_ids.length,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
@ -548,10 +548,10 @@ function queuesReducer(
|
|||||||
...queueInfo.currentStats,
|
...queueInfo.currentStats,
|
||||||
archived:
|
archived:
|
||||||
queueInfo.currentStats.pending +
|
queueInfo.currentStats.pending +
|
||||||
action.payload.archived_keys.length,
|
action.payload.archived_ids.length,
|
||||||
retry:
|
retry:
|
||||||
queueInfo.currentStats.retry -
|
queueInfo.currentStats.retry -
|
||||||
action.payload.archived_keys.length,
|
action.payload.archived_ids.length,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
@ -568,9 +568,9 @@ function queuesReducer(
|
|||||||
currentStats: {
|
currentStats: {
|
||||||
...queueInfo.currentStats,
|
...queueInfo.currentStats,
|
||||||
size:
|
size:
|
||||||
queueInfo.currentStats.size - action.payload.deleted_keys.length,
|
queueInfo.currentStats.size - action.payload.deleted_ids.length,
|
||||||
retry:
|
retry:
|
||||||
queueInfo.currentStats.retry - action.payload.deleted_keys.length,
|
queueInfo.currentStats.retry - action.payload.deleted_ids.length,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
@ -658,10 +658,10 @@ function queuesReducer(
|
|||||||
...queueInfo.currentStats,
|
...queueInfo.currentStats,
|
||||||
pending:
|
pending:
|
||||||
queueInfo.currentStats.pending +
|
queueInfo.currentStats.pending +
|
||||||
action.payload.pending_keys.length,
|
action.payload.pending_ids.length,
|
||||||
archived:
|
archived:
|
||||||
queueInfo.currentStats.archived -
|
queueInfo.currentStats.archived -
|
||||||
action.payload.pending_keys.length,
|
action.payload.pending_ids.length,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
@ -678,10 +678,10 @@ function queuesReducer(
|
|||||||
currentStats: {
|
currentStats: {
|
||||||
...queueInfo.currentStats,
|
...queueInfo.currentStats,
|
||||||
size:
|
size:
|
||||||
queueInfo.currentStats.size - action.payload.deleted_keys.length,
|
queueInfo.currentStats.size - action.payload.deleted_ids.length,
|
||||||
archived:
|
archived:
|
||||||
queueInfo.currentStats.archived -
|
queueInfo.currentStats.archived -
|
||||||
action.payload.deleted_keys.length,
|
action.payload.deleted_ids.length,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
@ -126,7 +126,7 @@ function snackbarReducer(
|
|||||||
};
|
};
|
||||||
|
|
||||||
case BATCH_RUN_SCHEDULED_TASKS_SUCCESS: {
|
case BATCH_RUN_SCHEDULED_TASKS_SUCCESS: {
|
||||||
const n = action.payload.pending_keys.length;
|
const n = action.payload.pending_ids.length;
|
||||||
return {
|
return {
|
||||||
isOpen: true,
|
isOpen: true,
|
||||||
message: `${n} scheduled ${
|
message: `${n} scheduled ${
|
||||||
@ -136,7 +136,7 @@ function snackbarReducer(
|
|||||||
}
|
}
|
||||||
|
|
||||||
case BATCH_ARCHIVE_PENDING_TASKS_SUCCESS: {
|
case BATCH_ARCHIVE_PENDING_TASKS_SUCCESS: {
|
||||||
const n = action.payload.archived_keys.length;
|
const n = action.payload.archived_ids.length;
|
||||||
return {
|
return {
|
||||||
isOpen: true,
|
isOpen: true,
|
||||||
message: `${n} pending ${
|
message: `${n} pending ${
|
||||||
@ -146,7 +146,7 @@ function snackbarReducer(
|
|||||||
}
|
}
|
||||||
|
|
||||||
case BATCH_DELETE_PENDING_TASKS_SUCCESS: {
|
case BATCH_DELETE_PENDING_TASKS_SUCCESS: {
|
||||||
const n = action.payload.deleted_keys.length;
|
const n = action.payload.deleted_ids.length;
|
||||||
return {
|
return {
|
||||||
isOpen: true,
|
isOpen: true,
|
||||||
message: `${n} pending ${n === 1 ? "task" : "tasks"} deleted`,
|
message: `${n} pending ${n === 1 ? "task" : "tasks"} deleted`,
|
||||||
@ -154,7 +154,7 @@ function snackbarReducer(
|
|||||||
}
|
}
|
||||||
|
|
||||||
case BATCH_ARCHIVE_SCHEDULED_TASKS_SUCCESS: {
|
case BATCH_ARCHIVE_SCHEDULED_TASKS_SUCCESS: {
|
||||||
const n = action.payload.archived_keys.length;
|
const n = action.payload.archived_ids.length;
|
||||||
return {
|
return {
|
||||||
isOpen: true,
|
isOpen: true,
|
||||||
message: `${n} scheduled ${
|
message: `${n} scheduled ${
|
||||||
@ -164,7 +164,7 @@ function snackbarReducer(
|
|||||||
}
|
}
|
||||||
|
|
||||||
case BATCH_DELETE_SCHEDULED_TASKS_SUCCESS: {
|
case BATCH_DELETE_SCHEDULED_TASKS_SUCCESS: {
|
||||||
const n = action.payload.deleted_keys.length;
|
const n = action.payload.deleted_ids.length;
|
||||||
return {
|
return {
|
||||||
isOpen: true,
|
isOpen: true,
|
||||||
message: `${n} scheduled ${n === 1 ? "task" : "tasks"} deleted`,
|
message: `${n} scheduled ${n === 1 ? "task" : "tasks"} deleted`,
|
||||||
@ -208,7 +208,7 @@ function snackbarReducer(
|
|||||||
};
|
};
|
||||||
|
|
||||||
case BATCH_RUN_RETRY_TASKS_SUCCESS: {
|
case BATCH_RUN_RETRY_TASKS_SUCCESS: {
|
||||||
const n = action.payload.pending_keys.length;
|
const n = action.payload.pending_ids.length;
|
||||||
return {
|
return {
|
||||||
isOpen: true,
|
isOpen: true,
|
||||||
message: `${n} retry ${n === 1 ? "task is" : "tasks are"} now pending`,
|
message: `${n} retry ${n === 1 ? "task is" : "tasks are"} now pending`,
|
||||||
@ -216,7 +216,7 @@ function snackbarReducer(
|
|||||||
}
|
}
|
||||||
|
|
||||||
case BATCH_ARCHIVE_RETRY_TASKS_SUCCESS: {
|
case BATCH_ARCHIVE_RETRY_TASKS_SUCCESS: {
|
||||||
const n = action.payload.archived_keys.length;
|
const n = action.payload.archived_ids.length;
|
||||||
return {
|
return {
|
||||||
isOpen: true,
|
isOpen: true,
|
||||||
message: `${n} retry ${n === 1 ? "task is" : "tasks are"} now archived`,
|
message: `${n} retry ${n === 1 ? "task is" : "tasks are"} now archived`,
|
||||||
@ -224,7 +224,7 @@ function snackbarReducer(
|
|||||||
}
|
}
|
||||||
|
|
||||||
case BATCH_DELETE_RETRY_TASKS_SUCCESS: {
|
case BATCH_DELETE_RETRY_TASKS_SUCCESS: {
|
||||||
const n = action.payload.deleted_keys.length;
|
const n = action.payload.deleted_ids.length;
|
||||||
return {
|
return {
|
||||||
isOpen: true,
|
isOpen: true,
|
||||||
message: `${n} retry ${n === 1 ? "task" : "tasks"} deleted`,
|
message: `${n} retry ${n === 1 ? "task" : "tasks"} deleted`,
|
||||||
@ -256,7 +256,7 @@ function snackbarReducer(
|
|||||||
};
|
};
|
||||||
|
|
||||||
case BATCH_RUN_ARCHIVED_TASKS_SUCCESS: {
|
case BATCH_RUN_ARCHIVED_TASKS_SUCCESS: {
|
||||||
const n = action.payload.pending_keys.length;
|
const n = action.payload.pending_ids.length;
|
||||||
return {
|
return {
|
||||||
isOpen: true,
|
isOpen: true,
|
||||||
message: `${n} archived ${
|
message: `${n} archived ${
|
||||||
@ -266,7 +266,7 @@ function snackbarReducer(
|
|||||||
}
|
}
|
||||||
|
|
||||||
case BATCH_DELETE_ARCHIVED_TASKS_SUCCESS: {
|
case BATCH_DELETE_ARCHIVED_TASKS_SUCCESS: {
|
||||||
const n = action.payload.deleted_keys.length;
|
const n = action.payload.deleted_ids.length;
|
||||||
return {
|
return {
|
||||||
isOpen: true,
|
isOpen: true,
|
||||||
message: `${n} archived ${n === 1 ? "task" : "tasks"} deleted`,
|
message: `${n} archived ${n === 1 ? "task" : "tasks"} deleted`,
|
||||||
|
@ -560,7 +560,7 @@ function tasksReducer(
|
|||||||
pendingTasks: {
|
pendingTasks: {
|
||||||
...state.pendingTasks,
|
...state.pendingTasks,
|
||||||
data: state.pendingTasks.data.map((task) => {
|
data: state.pendingTasks.data.map((task) => {
|
||||||
if (task.key !== action.taskKey) {
|
if (task.id !== action.taskId) {
|
||||||
return task;
|
return task;
|
||||||
}
|
}
|
||||||
return { ...task, requestPending: true };
|
return { ...task, requestPending: true };
|
||||||
@ -575,7 +575,7 @@ function tasksReducer(
|
|||||||
pendingTasks: {
|
pendingTasks: {
|
||||||
...state.pendingTasks,
|
...state.pendingTasks,
|
||||||
data: state.pendingTasks.data.filter(
|
data: state.pendingTasks.data.filter(
|
||||||
(task) => task.key !== action.taskKey
|
(task) => task.id !== action.taskId
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@ -587,7 +587,7 @@ function tasksReducer(
|
|||||||
pendingTasks: {
|
pendingTasks: {
|
||||||
...state.pendingTasks,
|
...state.pendingTasks,
|
||||||
data: state.pendingTasks.data.map((task) => {
|
data: state.pendingTasks.data.map((task) => {
|
||||||
if (task.key !== action.taskKey) {
|
if (task.id !== action.taskId) {
|
||||||
return task;
|
return task;
|
||||||
}
|
}
|
||||||
return { ...task, requestPending: false };
|
return { ...task, requestPending: false };
|
||||||
@ -634,7 +634,7 @@ function tasksReducer(
|
|||||||
...state.pendingTasks,
|
...state.pendingTasks,
|
||||||
batchActionPending: true,
|
batchActionPending: true,
|
||||||
data: state.pendingTasks.data.map((task) => {
|
data: state.pendingTasks.data.map((task) => {
|
||||||
if (!action.taskKeys.includes(task.key)) {
|
if (!action.taskIds.includes(task.id)) {
|
||||||
return task;
|
return task;
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
@ -647,7 +647,7 @@ function tasksReducer(
|
|||||||
|
|
||||||
case BATCH_ARCHIVE_PENDING_TASKS_SUCCESS: {
|
case BATCH_ARCHIVE_PENDING_TASKS_SUCCESS: {
|
||||||
const newData = state.pendingTasks.data.filter(
|
const newData = state.pendingTasks.data.filter(
|
||||||
(task) => !action.payload.archived_keys.includes(task.key)
|
(task) => !action.payload.archived_ids.includes(task.id)
|
||||||
);
|
);
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
@ -661,7 +661,7 @@ function tasksReducer(
|
|||||||
|
|
||||||
case BATCH_DELETE_PENDING_TASKS_SUCCESS: {
|
case BATCH_DELETE_PENDING_TASKS_SUCCESS: {
|
||||||
const newData = state.pendingTasks.data.filter(
|
const newData = state.pendingTasks.data.filter(
|
||||||
(task) => !action.payload.deleted_keys.includes(task.key)
|
(task) => !action.payload.deleted_ids.includes(task.id)
|
||||||
);
|
);
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
@ -681,7 +681,7 @@ function tasksReducer(
|
|||||||
...state.pendingTasks,
|
...state.pendingTasks,
|
||||||
batchActionPending: false,
|
batchActionPending: false,
|
||||||
data: state.pendingTasks.data.map((task) => {
|
data: state.pendingTasks.data.map((task) => {
|
||||||
if (!action.taskKeys.includes(task.key)) {
|
if (!action.taskIds.includes(task.id)) {
|
||||||
return task;
|
return task;
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
@ -700,7 +700,7 @@ function tasksReducer(
|
|||||||
scheduledTasks: {
|
scheduledTasks: {
|
||||||
...state.scheduledTasks,
|
...state.scheduledTasks,
|
||||||
data: state.scheduledTasks.data.map((task) => {
|
data: state.scheduledTasks.data.map((task) => {
|
||||||
if (task.key !== action.taskKey) {
|
if (task.id !== action.taskId) {
|
||||||
return task;
|
return task;
|
||||||
}
|
}
|
||||||
return { ...task, requestPending: true };
|
return { ...task, requestPending: true };
|
||||||
@ -716,7 +716,7 @@ function tasksReducer(
|
|||||||
scheduledTasks: {
|
scheduledTasks: {
|
||||||
...state.scheduledTasks,
|
...state.scheduledTasks,
|
||||||
data: state.scheduledTasks.data.filter(
|
data: state.scheduledTasks.data.filter(
|
||||||
(task) => task.key !== action.taskKey
|
(task) => task.id !== action.taskId
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@ -729,7 +729,7 @@ function tasksReducer(
|
|||||||
scheduledTasks: {
|
scheduledTasks: {
|
||||||
...state.scheduledTasks,
|
...state.scheduledTasks,
|
||||||
data: state.scheduledTasks.data.map((task) => {
|
data: state.scheduledTasks.data.map((task) => {
|
||||||
if (task.key !== action.taskKey) {
|
if (task.id !== action.taskId) {
|
||||||
return task;
|
return task;
|
||||||
}
|
}
|
||||||
return { ...task, requestPending: false };
|
return { ...task, requestPending: false };
|
||||||
@ -780,7 +780,7 @@ function tasksReducer(
|
|||||||
...state.scheduledTasks,
|
...state.scheduledTasks,
|
||||||
batchActionPending: true,
|
batchActionPending: true,
|
||||||
data: state.scheduledTasks.data.map((task) => {
|
data: state.scheduledTasks.data.map((task) => {
|
||||||
if (!action.taskKeys.includes(task.key)) {
|
if (!action.taskIds.includes(task.id)) {
|
||||||
return task;
|
return task;
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
@ -793,7 +793,7 @@ function tasksReducer(
|
|||||||
|
|
||||||
case BATCH_RUN_SCHEDULED_TASKS_SUCCESS: {
|
case BATCH_RUN_SCHEDULED_TASKS_SUCCESS: {
|
||||||
const newData = state.scheduledTasks.data.filter(
|
const newData = state.scheduledTasks.data.filter(
|
||||||
(task) => !action.payload.pending_keys.includes(task.key)
|
(task) => !action.payload.pending_ids.includes(task.id)
|
||||||
);
|
);
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
@ -807,7 +807,7 @@ function tasksReducer(
|
|||||||
|
|
||||||
case BATCH_ARCHIVE_SCHEDULED_TASKS_SUCCESS: {
|
case BATCH_ARCHIVE_SCHEDULED_TASKS_SUCCESS: {
|
||||||
const newData = state.scheduledTasks.data.filter(
|
const newData = state.scheduledTasks.data.filter(
|
||||||
(task) => !action.payload.archived_keys.includes(task.key)
|
(task) => !action.payload.archived_ids.includes(task.id)
|
||||||
);
|
);
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
@ -821,7 +821,7 @@ function tasksReducer(
|
|||||||
|
|
||||||
case BATCH_DELETE_SCHEDULED_TASKS_SUCCESS: {
|
case BATCH_DELETE_SCHEDULED_TASKS_SUCCESS: {
|
||||||
const newData = state.scheduledTasks.data.filter(
|
const newData = state.scheduledTasks.data.filter(
|
||||||
(task) => !action.payload.deleted_keys.includes(task.key)
|
(task) => !action.payload.deleted_ids.includes(task.id)
|
||||||
);
|
);
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
@ -842,7 +842,7 @@ function tasksReducer(
|
|||||||
...state.scheduledTasks,
|
...state.scheduledTasks,
|
||||||
batchActionPending: false,
|
batchActionPending: false,
|
||||||
data: state.scheduledTasks.data.map((task) => {
|
data: state.scheduledTasks.data.map((task) => {
|
||||||
if (!action.taskKeys.includes(task.key)) {
|
if (!action.taskIds.includes(task.id)) {
|
||||||
return task;
|
return task;
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
@ -861,7 +861,7 @@ function tasksReducer(
|
|||||||
retryTasks: {
|
retryTasks: {
|
||||||
...state.retryTasks,
|
...state.retryTasks,
|
||||||
data: state.retryTasks.data.map((task) => {
|
data: state.retryTasks.data.map((task) => {
|
||||||
if (task.key !== action.taskKey) {
|
if (task.id !== action.taskId) {
|
||||||
return task;
|
return task;
|
||||||
}
|
}
|
||||||
return { ...task, requestPending: true };
|
return { ...task, requestPending: true };
|
||||||
@ -877,7 +877,7 @@ function tasksReducer(
|
|||||||
retryTasks: {
|
retryTasks: {
|
||||||
...state.retryTasks,
|
...state.retryTasks,
|
||||||
data: state.retryTasks.data.filter(
|
data: state.retryTasks.data.filter(
|
||||||
(task) => task.key !== action.taskKey
|
(task) => task.id !== action.taskId
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@ -890,7 +890,7 @@ function tasksReducer(
|
|||||||
retryTasks: {
|
retryTasks: {
|
||||||
...state.retryTasks,
|
...state.retryTasks,
|
||||||
data: state.retryTasks.data.map((task) => {
|
data: state.retryTasks.data.map((task) => {
|
||||||
if (task.key !== action.taskKey) {
|
if (task.id !== action.taskId) {
|
||||||
return task;
|
return task;
|
||||||
}
|
}
|
||||||
return { ...task, requestPending: false };
|
return { ...task, requestPending: false };
|
||||||
@ -941,7 +941,7 @@ function tasksReducer(
|
|||||||
...state.retryTasks,
|
...state.retryTasks,
|
||||||
batchActionPending: true,
|
batchActionPending: true,
|
||||||
data: state.retryTasks.data.map((task) => {
|
data: state.retryTasks.data.map((task) => {
|
||||||
if (!action.taskKeys.includes(task.key)) {
|
if (!action.taskIds.includes(task.id)) {
|
||||||
return task;
|
return task;
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
@ -954,7 +954,7 @@ function tasksReducer(
|
|||||||
|
|
||||||
case BATCH_RUN_RETRY_TASKS_SUCCESS: {
|
case BATCH_RUN_RETRY_TASKS_SUCCESS: {
|
||||||
const newData = state.retryTasks.data.filter(
|
const newData = state.retryTasks.data.filter(
|
||||||
(task) => !action.payload.pending_keys.includes(task.key)
|
(task) => !action.payload.pending_ids.includes(task.id)
|
||||||
);
|
);
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
@ -968,7 +968,7 @@ function tasksReducer(
|
|||||||
|
|
||||||
case BATCH_ARCHIVE_RETRY_TASKS_SUCCESS: {
|
case BATCH_ARCHIVE_RETRY_TASKS_SUCCESS: {
|
||||||
const newData = state.retryTasks.data.filter(
|
const newData = state.retryTasks.data.filter(
|
||||||
(task) => !action.payload.archived_keys.includes(task.key)
|
(task) => !action.payload.archived_ids.includes(task.id)
|
||||||
);
|
);
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
@ -982,7 +982,7 @@ function tasksReducer(
|
|||||||
|
|
||||||
case BATCH_DELETE_RETRY_TASKS_SUCCESS: {
|
case BATCH_DELETE_RETRY_TASKS_SUCCESS: {
|
||||||
const newData = state.retryTasks.data.filter(
|
const newData = state.retryTasks.data.filter(
|
||||||
(task) => !action.payload.deleted_keys.includes(task.key)
|
(task) => !action.payload.deleted_ids.includes(task.id)
|
||||||
);
|
);
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
@ -1003,7 +1003,7 @@ function tasksReducer(
|
|||||||
...state.retryTasks,
|
...state.retryTasks,
|
||||||
batchActionPending: false,
|
batchActionPending: false,
|
||||||
data: state.retryTasks.data.map((task) => {
|
data: state.retryTasks.data.map((task) => {
|
||||||
if (!action.taskKeys.includes(task.key)) {
|
if (!action.taskIds.includes(task.id)) {
|
||||||
return task;
|
return task;
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
@ -1021,7 +1021,7 @@ function tasksReducer(
|
|||||||
archivedTasks: {
|
archivedTasks: {
|
||||||
...state.archivedTasks,
|
...state.archivedTasks,
|
||||||
data: state.archivedTasks.data.map((task) => {
|
data: state.archivedTasks.data.map((task) => {
|
||||||
if (task.key !== action.taskKey) {
|
if (task.id !== action.taskId) {
|
||||||
return task;
|
return task;
|
||||||
}
|
}
|
||||||
return { ...task, requestPending: true };
|
return { ...task, requestPending: true };
|
||||||
@ -1036,7 +1036,7 @@ function tasksReducer(
|
|||||||
archivedTasks: {
|
archivedTasks: {
|
||||||
...state.archivedTasks,
|
...state.archivedTasks,
|
||||||
data: state.archivedTasks.data.filter(
|
data: state.archivedTasks.data.filter(
|
||||||
(task) => task.key !== action.taskKey
|
(task) => task.id !== action.taskId
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@ -1048,7 +1048,7 @@ function tasksReducer(
|
|||||||
archivedTasks: {
|
archivedTasks: {
|
||||||
...state.archivedTasks,
|
...state.archivedTasks,
|
||||||
data: state.archivedTasks.data.map((task) => {
|
data: state.archivedTasks.data.map((task) => {
|
||||||
if (task.key !== action.taskKey) {
|
if (task.id !== action.taskId) {
|
||||||
return task;
|
return task;
|
||||||
}
|
}
|
||||||
return { ...task, requestPending: false };
|
return { ...task, requestPending: false };
|
||||||
@ -1095,7 +1095,7 @@ function tasksReducer(
|
|||||||
...state.archivedTasks,
|
...state.archivedTasks,
|
||||||
batchActionPending: true,
|
batchActionPending: true,
|
||||||
data: state.archivedTasks.data.map((task) => {
|
data: state.archivedTasks.data.map((task) => {
|
||||||
if (!action.taskKeys.includes(task.key)) {
|
if (!action.taskIds.includes(task.id)) {
|
||||||
return task;
|
return task;
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
@ -1108,7 +1108,7 @@ function tasksReducer(
|
|||||||
|
|
||||||
case BATCH_RUN_ARCHIVED_TASKS_SUCCESS: {
|
case BATCH_RUN_ARCHIVED_TASKS_SUCCESS: {
|
||||||
const newData = state.archivedTasks.data.filter(
|
const newData = state.archivedTasks.data.filter(
|
||||||
(task) => !action.payload.pending_keys.includes(task.key)
|
(task) => !action.payload.pending_ids.includes(task.id)
|
||||||
);
|
);
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
@ -1122,7 +1122,7 @@ function tasksReducer(
|
|||||||
|
|
||||||
case BATCH_DELETE_ARCHIVED_TASKS_SUCCESS: {
|
case BATCH_DELETE_ARCHIVED_TASKS_SUCCESS: {
|
||||||
const newData = state.archivedTasks.data.filter(
|
const newData = state.archivedTasks.data.filter(
|
||||||
(task) => !action.payload.deleted_keys.includes(task.key)
|
(task) => !action.payload.deleted_ids.includes(task.id)
|
||||||
);
|
);
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
@ -1142,7 +1142,7 @@ function tasksReducer(
|
|||||||
...state.archivedTasks,
|
...state.archivedTasks,
|
||||||
batchActionPending: false,
|
batchActionPending: false,
|
||||||
data: state.archivedTasks.data.map((task) => {
|
data: state.archivedTasks.data.map((task) => {
|
||||||
if (!action.taskKeys.includes(task.key)) {
|
if (!action.taskIds.includes(task.id)) {
|
||||||
return task;
|
return task;
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
|
Loading…
Reference in New Issue
Block a user