Skip to content

Commit 36b81f6

Browse files
fix: fix issue with can not delete web ui (#8878)
1 parent 8c8a4d2 commit 36b81f6

File tree

3 files changed

+38
-7
lines changed

3 files changed

+38
-7
lines changed

frontend/src/api/interface/app.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,10 @@ export namespace App {
143143
canUpdate: boolean;
144144
path: string;
145145
httpPort?: number;
146+
httpsPort?: number;
146147
favorite: boolean;
147148
app: App;
149+
webUI: string;
148150
}
149151

150152
export interface AppInstallDto {

frontend/src/views/app-store/installed/detail/index.vue

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ const get = async () => {
242242
if (res.data.webUI != '') {
243243
const httpConfig = splitHttp(res.data.webUI);
244244
webUI.domain = httpConfig.url;
245-
webUI.protocol = httpConfig.proto;
245+
webUI.protocol = httpConfig.proto + '://';
246246
}
247247
appType.value = res.data.type;
248248
} catch (error) {
@@ -289,14 +289,15 @@ const submit = async (formEl: FormInstance) => {
289289
};
290290
291291
const updateAppConfig = async () => {
292-
if (!webUI.domain || webUI.domain === '') {
293-
return;
294-
}
295292
try {
296-
await updateInstallConfig({
293+
let req = {
297294
installID: Number(paramData.value.id),
298295
webUI: webUI.protocol + webUI.domain,
299-
});
296+
};
297+
if (!webUI.domain || webUI.domain === '') {
298+
req.webUI = '';
299+
}
300+
await updateInstallConfig(req);
300301
MsgSuccess(i18n.global.t('commons.msg.updateSuccess'));
301302
handleClose();
302303
} catch (error) {}

frontend/src/views/app-store/installed/index.vue

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,12 @@
249249
:width="400"
250250
>
251251
<template #reference>
252-
<el-button plain icon="Promotion" size="small">
252+
<el-button
253+
plain
254+
icon="Promotion"
255+
size="small"
256+
@click="openLink(defaultLink, installed)"
257+
>
253258
{{ $t('app.toLink') }}
254259
</el-button>
255260
</template>
@@ -277,6 +282,8 @@
277282
}}
278283
</el-button>
279284
</td>
285+
</tr>
286+
<tr v-if="defaultLink != ''">
280287
<td v-if="installed.httpsPort > 0">
281288
<el-button
282289
type="primary"
@@ -700,6 +707,27 @@ const getConfig = async () => {
700707
} catch (error) {}
701708
};
702709
710+
const openLink = (defaultLink: string, installed: App.AppInstalled) => {
711+
if (defaultLink != '' && installed.webUI != '') {
712+
return;
713+
}
714+
if (defaultLink == '' && installed.webUI == '') {
715+
return;
716+
}
717+
if (installed.webUI != '') {
718+
toLink(installed.webUI);
719+
return;
720+
}
721+
if (installed.httpsPort > 0) {
722+
toLink('https://' + defaultLink + ':' + installed.httpsPort);
723+
return;
724+
}
725+
if (installed.httpPort > 0) {
726+
toLink('http://' + defaultLink + ':' + installed.httpPort);
727+
return;
728+
}
729+
};
730+
703731
onMounted(() => {
704732
getConfig();
705733
const path = router.currentRoute.value.path;

0 commit comments

Comments
 (0)