From a2c9829c1ad3f29e7a3b211977678279af07d5c5 Mon Sep 17 00:00:00 2001 From: shuzhenyang Date: Thu, 9 May 2024 17:15:51 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=BD=93=E9=AA=8C?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/dashboard-front/src/language/lang.ts | 6 ++- .../src/views/backend-service/add.vue | 39 +++++++++++++------ .../src/views/basic-info/common/type.ts | 1 + .../setting/comps/select-check-box.vue | 4 ++ .../views/resource/version/edition/index.vue | 14 ++++++- .../stage/overview/comps/stage-card-list.vue | 5 ++- .../stage/overview/detail-mode/index.vue | 13 ++++++- 7 files changed, 65 insertions(+), 17 deletions(-) diff --git a/src/dashboard-front/src/language/lang.ts b/src/dashboard-front/src/language/lang.ts index d72c41772..1ca43a885 100644 --- a/src/dashboard-front/src/language/lang.ts +++ b/src/dashboard-front/src/language/lang.ts @@ -1355,7 +1355,11 @@ const lang: ILANG = { '请输入 SDK 版本号': ['Please enter the SDK version number'], 'SDK仅包含公开资源,生成后会上传到pypi源或bkrepo': ['The SDK only includes public resources, and will be uploaded to the PyPI or BKRepo source after generation'], '生成语言': ['Generation language'], - + '编辑后端服务': ['Edit back-end services'], + '去查看发布记录': ['Go to the release record'], + '后端服务内容保存成功,正在发布到对应的环境': ['The back-end service content is saved successfully and is being published to the corresponding environment'], + '当前后端服务({name})已绑定以下 {num} 个环境,所有修改都将发布到这些环境中:{names}': ['The current backend service ({name}) has bound the following {num} environments to which all changes will be published: {names}'], + '网关环境【prod】中的配置【后端服务地址】不合法。请在网关 `后端服务` 中进行配置。': ['The back-end service address configured in gateway environment prod is invalid. Please configure in Gateway back-end services.'], '最大 300s': ['Maximum 300s'], '恢复初始值': ['Reset to default'], '请输入超时时间': ['Please enter the timeout period'], diff --git a/src/dashboard-front/src/views/backend-service/add.vue b/src/dashboard-front/src/views/backend-service/add.vue index 5a76d7ca8..3334f2adc 100644 --- a/src/dashboard-front/src/views/backend-service/add.vue +++ b/src/dashboard-front/src/views/backend-service/add.vue @@ -384,18 +384,35 @@ const handleConfirm = async () => { } if (isPublish.value && props.editId) { sidesliderConfi.isShow = false; - InfoBox({ - title: t('内容保存成功,正在发布至环境中'), - infoType: 'success', - subTitle: t('如果编辑的后端服务绑定的环境有发布就会立即发布到对应环境当中'), - confirmText: t('去查看'), - cancelText: t('关闭'), - onConfirm: () => { - router.push({ - name: 'apigwReleaseHistory', - }); - }, + + const stageNames = stageConfig.value?.map((item: any) => { + return item.name; }); + + if (stageNames?.length) { + InfoBox({ + title: t('后端服务内容保存成功,正在发布到对应的环境'), + infoType: 'success', + width: 482, + subTitle: t('当前后端服务({name})已绑定以下 {num} 个环境,所有修改都将发布到这些环境中:{names}', { name: baseInfo.value.name, num: stageNames?.length, names: stageNames?.join(',') }), + confirmText: t('去查看发布记录'), + cancelText: t('关闭'), + onConfirm: () => { + router.push({ + name: 'apigwReleaseHistory', + }); + }, + }); + } else { + InfoBox({ + title: t('后端服务内容保存成功'), + infoType: 'success', + dialogType: 'confirm', + headerAlign: 'center', + footerAlign: 'center', + confirmText: t('关闭'), + }); + } } else { Message({ message: !props.editId ? t('新建成功') : t('更新成功'), diff --git a/src/dashboard-front/src/views/basic-info/common/type.ts b/src/dashboard-front/src/views/basic-info/common/type.ts index 175e96a65..d80a47d91 100644 --- a/src/dashboard-front/src/views/basic-info/common/type.ts +++ b/src/dashboard-front/src/views/basic-info/common/type.ts @@ -15,6 +15,7 @@ export interface BasicInfoParams { created_time: string public_key: string is_official: boolean + publish_validate_msg: string } export interface DialogParams { diff --git a/src/dashboard-front/src/views/resource/setting/comps/select-check-box.vue b/src/dashboard-front/src/views/resource/setting/comps/select-check-box.vue index b6aa3f0dc..39027be18 100644 --- a/src/dashboard-front/src/views/resource/setting/comps/select-check-box.vue +++ b/src/dashboard-front/src/views/resource/setting/comps/select-check-box.vue @@ -140,6 +140,10 @@ watch(curLabelIds, () => { // const handleToggle = async (v: boolean) => { + if (!v) { + showEdit.value = false; + optionName.value = ''; + } // 新增标签标识 if (isAdd.value) return; setTimeout(async () => { diff --git a/src/dashboard-front/src/views/resource/version/edition/index.vue b/src/dashboard-front/src/views/resource/version/edition/index.vue index 8f933f1c0..f987043a0 100644 --- a/src/dashboard-front/src/views/resource/version/edition/index.vue +++ b/src/dashboard-front/src/views/resource/version/edition/index.vue @@ -98,7 +98,9 @@ {{ item.name }} @@ -404,4 +406,14 @@ onUnmounted(() => { scrollbar-color: transparent transparent; } } +:deep(.menu-item-disabled) { + background-color: #dcdee5; + color: #fff; + cursor: not-allowed; + &:hover { + background-color: #dcdee5; + color: #fff; + cursor: not-allowed; + } +} diff --git a/src/dashboard-front/src/views/stage/overview/comps/stage-card-list.vue b/src/dashboard-front/src/views/stage/overview/comps/stage-card-list.vue index f6a6e91ca..6a7f7e4e4 100644 --- a/src/dashboard-front/src/views/stage/overview/comps/stage-card-list.vue +++ b/src/dashboard-front/src/views/stage/overview/comps/stage-card-list.vue @@ -31,7 +31,8 @@ {{ t('发布资源') }} @@ -73,7 +74,7 @@
{{ `${t('当前资源版本')}:` }}
- {{ t('未发布') }} + -- {{ stageData.resource_version.version || '--' }}