From 36b81f6dba630416c0d2a6d2de87b83d9342cf82 Mon Sep 17 00:00:00 2001 From: CityFun <31820853+zhengkunwang223@users.noreply.github.com> Date: Fri, 30 May 2025 11:36:03 +0800 Subject: [PATCH] fix: fix issue with can not delete web ui (#8878) --- frontend/src/api/interface/app.ts | 2 ++ .../app-store/installed/detail/index.vue | 13 ++++---- .../src/views/app-store/installed/index.vue | 30 ++++++++++++++++++- 3 files changed, 38 insertions(+), 7 deletions(-) diff --git a/frontend/src/api/interface/app.ts b/frontend/src/api/interface/app.ts index 9d34235ba..d982c8029 100644 --- a/frontend/src/api/interface/app.ts +++ b/frontend/src/api/interface/app.ts @@ -143,8 +143,10 @@ export namespace App { canUpdate: boolean; path: string; httpPort?: number; + httpsPort?: number; favorite: boolean; app: App; + webUI: string; } export interface AppInstallDto { diff --git a/frontend/src/views/app-store/installed/detail/index.vue b/frontend/src/views/app-store/installed/detail/index.vue index fd84c3435..2530afebb 100644 --- a/frontend/src/views/app-store/installed/detail/index.vue +++ b/frontend/src/views/app-store/installed/detail/index.vue @@ -242,7 +242,7 @@ const get = async () => { if (res.data.webUI != '') { const httpConfig = splitHttp(res.data.webUI); webUI.domain = httpConfig.url; - webUI.protocol = httpConfig.proto; + webUI.protocol = httpConfig.proto + '://'; } appType.value = res.data.type; } catch (error) { @@ -289,14 +289,15 @@ const submit = async (formEl: FormInstance) => { }; const updateAppConfig = async () => { - if (!webUI.domain || webUI.domain === '') { - return; - } try { - await updateInstallConfig({ + let req = { installID: Number(paramData.value.id), webUI: webUI.protocol + webUI.domain, - }); + }; + if (!webUI.domain || webUI.domain === '') { + req.webUI = ''; + } + await updateInstallConfig(req); MsgSuccess(i18n.global.t('commons.msg.updateSuccess')); handleClose(); } catch (error) {} diff --git a/frontend/src/views/app-store/installed/index.vue b/frontend/src/views/app-store/installed/index.vue index cf4000b0e..6ac3d315a 100644 --- a/frontend/src/views/app-store/installed/index.vue +++ b/frontend/src/views/app-store/installed/index.vue @@ -249,7 +249,12 @@ :width="400" > @@ -277,6 +282,8 @@ }} + + { } catch (error) {} }; +const openLink = (defaultLink: string, installed: App.AppInstalled) => { + if (defaultLink != '' && installed.webUI != '') { + return; + } + if (defaultLink == '' && installed.webUI == '') { + return; + } + if (installed.webUI != '') { + toLink(installed.webUI); + return; + } + if (installed.httpsPort > 0) { + toLink('https://' + defaultLink + ':' + installed.httpsPort); + return; + } + if (installed.httpPort > 0) { + toLink('http://' + defaultLink + ':' + installed.httpPort); + return; + } +}; + onMounted(() => { getConfig(); const path = router.currentRoute.value.path;