diff --git a/packages/ui/certd-client/src/locales/langs/en-US/certd.ts b/packages/ui/certd-client/src/locales/langs/en-US/certd.ts index 6823f0e1e..50b5112b2 100644 --- a/packages/ui/certd-client/src/locales/langs/en-US/certd.ts +++ b/packages/ui/certd-client/src/locales/langs/en-US/certd.ts @@ -159,6 +159,7 @@ export default { selectedCount: "Selected {count} items", batchDelete: "Batch Delete", batchForceRerun: "Force Rerun", + batchRerun: "Rerun", applyCertificate: "Apply for Certificate", pipelineExecutionRecords: "Pipeline Execution Records", confirm: "Confirm", diff --git a/packages/ui/certd-client/src/locales/langs/zh-CN/certd.ts b/packages/ui/certd-client/src/locales/langs/zh-CN/certd.ts index 62528178c..53cf254df 100644 --- a/packages/ui/certd-client/src/locales/langs/zh-CN/certd.ts +++ b/packages/ui/certd-client/src/locales/langs/zh-CN/certd.ts @@ -165,6 +165,7 @@ export default { selectedCount: "已选择 {count} 项", batchDelete: "批量删除", batchForceRerun: "强制重新运行", + batchRerun: "重新运行", applyCertificate: "申请证书", pipelineExecutionRecords: "流水线执行记录", confirm: "确认", diff --git a/packages/ui/certd-client/src/views/certd/pipeline/api.ts b/packages/ui/certd-client/src/views/certd/pipeline/api.ts index 1d2d7f669..babc39ec2 100644 --- a/packages/ui/certd-client/src/views/certd/pipeline/api.ts +++ b/packages/ui/certd-client/src/views/certd/pipeline/api.ts @@ -117,11 +117,11 @@ export async function BatchDelete(pipelineIds: number[]): Promise { data: { ids: pipelineIds }, }); } -export async function BatchRerun(pipelineIds: number[]): Promise { +export async function BatchRerun(pipelineIds: number[], force: boolean): Promise { return await request({ url: apiPrefix + "/batchRerun", method: "post", - data: { ids: pipelineIds }, + data: { ids: pipelineIds, force }, }); } diff --git a/packages/ui/certd-client/src/views/certd/pipeline/components/batch-rerun.vue b/packages/ui/certd-client/src/views/certd/pipeline/components/batch-rerun.vue new file mode 100644 index 000000000..32ee21e11 --- /dev/null +++ b/packages/ui/certd-client/src/views/certd/pipeline/components/batch-rerun.vue @@ -0,0 +1,86 @@ + + + diff --git a/packages/ui/certd-client/src/views/certd/pipeline/index.vue b/packages/ui/certd-client/src/views/certd/pipeline/index.vue index 927180507..c916650cf 100644 --- a/packages/ui/certd-client/src/views/certd/pipeline/index.vue +++ b/packages/ui/certd-client/src/views/certd/pipeline/index.vue @@ -8,7 +8,7 @@
{{ t("certd.selectedCount", { count: selectedRowKeys.length }) }} - + @@ -28,6 +28,7 @@ import { dict, useFs } from "@fast-crud/fast-crud"; import createCrudOptions from "./crud"; import ChangeGroup from "./components/change-group.vue"; import ChangeTrigger from "./components/change-trigger.vue"; +import BatchRerun from "./components/batch-rerun.vue"; import { Modal, notification } from "ant-design-vue"; import * as api from "./api"; import { useI18n } from "/src/locales"; @@ -75,20 +76,6 @@ function batchDelete() { }, }); } - -function batchRerun() { - settingStore.checkPlus(); - Modal.confirm({ - title: "确认强制重新运行吗", - content: "确定要强制重新运行选中流水线吗?(20条一批执行)", - async onOk() { - await api.BatchRerun(selectedRowKeys.value); - notification.success({ message: "任务已提交" }); - await crudExpose.doRefresh(); - selectedRowKeys.value = []; - }, - }); -}