mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-10-10 07:26:35 +08:00
fix: fix issue with can not delete web ui (#8878)
This commit is contained in:
parent
8c8a4d2881
commit
36b81f6dba
3 changed files with 38 additions and 7 deletions
|
@ -143,8 +143,10 @@ export namespace App {
|
|||
canUpdate: boolean;
|
||||
path: string;
|
||||
httpPort?: number;
|
||||
httpsPort?: number;
|
||||
favorite: boolean;
|
||||
app: App;
|
||||
webUI: string;
|
||||
}
|
||||
|
||||
export interface AppInstallDto {
|
||||
|
|
|
@ -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) {}
|
||||
|
|
|
@ -249,7 +249,12 @@
|
|||
:width="400"
|
||||
>
|
||||
<template #reference>
|
||||
<el-button plain icon="Promotion" size="small">
|
||||
<el-button
|
||||
plain
|
||||
icon="Promotion"
|
||||
size="small"
|
||||
@click="openLink(defaultLink, installed)"
|
||||
>
|
||||
{{ $t('app.toLink') }}
|
||||
</el-button>
|
||||
</template>
|
||||
|
@ -277,6 +282,8 @@
|
|||
}}
|
||||
</el-button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-if="defaultLink != ''">
|
||||
<td v-if="installed.httpsPort > 0">
|
||||
<el-button
|
||||
type="primary"
|
||||
|
@ -700,6 +707,27 @@ const getConfig = async () => {
|
|||
} 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;
|
||||
|
|
Loading…
Add table
Reference in a new issue