From bb7102d543c796715e50be4a4c21c4c5b5362a56 Mon Sep 17 00:00:00 2001 From: zhengkunwang <31820853+zhengkunwang223@users.noreply.github.com> Date: Wed, 9 Aug 2023 18:04:12 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=BC=96=E8=BE=91=E8=BF=90=E8=A1=8C?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E5=A2=9E=E5=8A=A0=E6=8F=90=E7=A4=BA=20(#1896?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/api/interface/runtime.ts | 1 + .../views/website/runtime/create/index.vue | 25 +++++++++++-------- frontend/src/views/website/runtime/index.vue | 3 +++ 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/frontend/src/api/interface/runtime.ts b/frontend/src/api/interface/runtime.ts index 44e0e22e3..209cc45a9 100644 --- a/frontend/src/api/interface/runtime.ts +++ b/frontend/src/api/interface/runtime.ts @@ -12,6 +12,7 @@ export namespace Runtime { type: string; resource: string; version: string; + status: string; } export interface RuntimeReq extends ReqPage { diff --git a/frontend/src/views/website/runtime/create/index.vue b/frontend/src/views/website/runtime/create/index.vue index dc4ebf298..12e73b581 100644 --- a/frontend/src/views/website/runtime/create/index.vue +++ b/frontend/src/views/website/runtime/create/index.vue @@ -87,7 +87,6 @@ {{ $t('runtime.extendHelper') }}
- {{ $t('runtime.rebuildHelper') }} @@ -246,8 +245,8 @@ const submit = async (formEl: FormInstance | undefined) => { if (!valid) { return; } - loading.value = true; if (mode.value == 'create') { + loading.value = true; CreateRuntime(runtime.value) .then(() => { MsgSuccess(i18n.global.t('commons.msg.createSuccess')); @@ -257,14 +256,20 @@ const submit = async (formEl: FormInstance | undefined) => { loading.value = false; }); } else { - UpdateRuntime(runtime.value) - .then(() => { - MsgSuccess(i18n.global.t('commons.msg.updateSuccess')); - handleClose(); - }) - .finally(() => { - loading.value = false; - }); + ElMessageBox.confirm(i18n.global.t('runtime.rebuildHelper'), i18n.global.t('commons.msg.infoTitle'), { + confirmButtonText: i18n.global.t('commons.button.confirm'), + cancelButtonText: i18n.global.t('commons.button.cancel'), + }).then(async () => { + loading.value = true; + UpdateRuntime(runtime.value) + .then(() => { + MsgSuccess(i18n.global.t('commons.msg.updateSuccess')); + handleClose(); + }) + .finally(() => { + loading.value = false; + }); + }); } }); }; diff --git a/frontend/src/views/website/runtime/index.vue b/frontend/src/views/website/runtime/index.vue index 3cfd1a54a..d6926ecbc 100644 --- a/frontend/src/views/website/runtime/index.vue +++ b/frontend/src/views/website/runtime/index.vue @@ -97,6 +97,9 @@ const buttons = [ click: function (row: Runtime.Runtime) { openDetail(row); }, + disabled: function (row: Runtime.Runtime) { + return row.status === 'building'; + }, }, { label: i18n.global.t('commons.button.delete'),