From 87e9662af47a760ee5d2789e829a88f83fc833d5 Mon Sep 17 00:00:00 2001 From: zhengkunwang <31820853+zhengkunwang223@users.noreply.github.com> Date: Wed, 9 Aug 2023 14:08:12 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E5=85=B3=E9=97=AD?= =?UTF-8?q?=E9=AB=98=E7=BA=A7=E8=AE=BE=E7=BD=AE=E4=B9=8B=E5=90=8E=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E6=8F=90=E7=A4=BA=E7=AB=AF=E5=8F=A3=E6=94=BE=E5=BC=80?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=20(#1887)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/global/business.ts | 11 +++-------- frontend/src/views/app-store/detail/install/index.vue | 4 ++-- .../src/views/app-store/installed/detail/index.vue | 2 +- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/frontend/src/global/business.ts b/frontend/src/global/business.ts index f126fc705..3e3eb42e4 100644 --- a/frontend/src/global/business.ts +++ b/frontend/src/global/business.ts @@ -1,13 +1,8 @@ import router from '@/routers'; -export function canEditPort(app: any): boolean { - if (app.key == 'openresty') { - return false; - } - if (app.type == 'php') { - return false; - } - return true; +export function canEditPort(appKey: string): boolean { + const apps = ['openresty', 'php', 'frpc', 'frps', 'ddns-go', 'home-assistant']; + return !apps.includes(appKey); } export function toFolder(folder: string) { diff --git a/frontend/src/views/app-store/detail/install/index.vue b/frontend/src/views/app-store/detail/install/index.vue index 2adfc0069..9153f8c9a 100644 --- a/frontend/src/views/app-store/detail/install/index.vue +++ b/frontend/src/views/app-store/detail/install/index.vue @@ -75,7 +75,7 @@ {{ $t('container.limitHelper', [limits.memory]) }}{{ req.memoryUnit }}B - + {{ $t('app.allowPortHelper') }} @@ -224,7 +224,7 @@ const submit = async (formEl: FormInstance | undefined) => { if (req.memoryLimit < 0) { req.memoryLimit = 0; } - if (installData.value.app.key != 'openresty' && req.advanced && !req.allowPort) { + if (canEditPort(installData.value.app.key) && !req.allowPort) { ElMessageBox.confirm(i18n.global.t('app.installWarn'), i18n.global.t('app.checkTitle'), { confirmButtonText: i18n.global.t('commons.button.confirm'), cancelButtonText: i18n.global.t('commons.button.cancel'), diff --git a/frontend/src/views/app-store/installed/detail/index.vue b/frontend/src/views/app-store/installed/detail/index.vue index bf51f2ec9..21c4de9f4 100644 --- a/frontend/src/views/app-store/installed/detail/index.vue +++ b/frontend/src/views/app-store/installed/detail/index.vue @@ -75,7 +75,7 @@ {{ $t('container.limitHelper') }} - + {{ $t('app.allowPortHelper') }}