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;