fix: resolve issue with quick navigation failure in applications

This commit is contained in:
zhengkunwang223 2025-12-22 18:48:38 +08:00
parent 63d5d70314
commit c84405c675
3 changed files with 7 additions and 36 deletions

View file

@ -28,8 +28,6 @@
<AppInfo
:installed="installed"
:defaultLink="defaultLink"
@open-link="$emit('openLink')"
@to-link="$emit('toLink')"
@jump-to-path="$emit('jumpToPath', '/settings/panel')"
></AppInfo>
<div class="app-divider" />
@ -65,8 +63,6 @@ defineEmits([
'openTerminal',
'openOperate',
'favoriteInstall',
'openLink',
'toLink',
'jumpToPath',
'ignoreApp',
'toContainer',

View file

@ -13,9 +13,7 @@
<el-popover placement="right" trigger="hover" v-if="hasLinkButton(installed)" :width="400">
<template #reference>
<el-button plain icon="Promotion" size="small" @click="$emit('openLink')">
{{ $t('app.toLink') }}
</el-button>
<el-button plain icon="Promotion" size="small">{{ $t('app.toLink') }}</el-button>
</template>
<table>
<tbody>
@ -24,7 +22,7 @@
<el-button
type="primary"
link
@click="$emit('toLink', 'http://' + defaultLink + ':' + installed.httpPort)"
@click="toLink('http://' + defaultLink + ':' + installed.httpPort)"
>
{{ 'http://' + defaultLink + ':' + installed.httpPort }}
</el-button>
@ -35,7 +33,7 @@
<el-button
type="primary"
link
@click="$emit('toLink', 'https://' + defaultLink + ':' + installed.httpsPort)"
@click="toLink('https://' + defaultLink + ':' + installed.httpsPort)"
>
{{ 'https://' + defaultLink + ':' + installed.httpsPort }}
</el-button>
@ -43,7 +41,7 @@
</tr>
<tr v-if="installed.webUI != ''">
<td>
<el-button type="primary" link @click="$emit('toLink')">
<el-button type="primary" link @click="toLink(installed.webUI)">
{{ installed.webUI }}
</el-button>
</td>
@ -69,7 +67,7 @@
<script lang="ts" setup>
import { App } from '@/api/interface/app';
import { getAge } from '@/utils/util';
import { getAge, toLink } from '@/utils/util';
interface Props {
installed: App.AppInstalled;
@ -77,7 +75,7 @@ interface Props {
}
defineProps<Props>();
defineEmits(['openLink', 'toLink', 'jumpToPath']);
defineEmits(['jumpToPath']);
const hasLinkButton = (installed: any) => {
return (

View file

@ -61,8 +61,6 @@
@favorite-install="favoriteInstall(installed)"
@to-folder="routerToFileWithPath(installed.path)"
@open-uploads="openUploads(installed.appKey, installed.name)"
@open-link="openLink(defaultLink, installed)"
@to-link="toLink(installed.webUI)"
@jump-to-path="jumpToPath(router, '/settings/panel')"
@to-container="toContainer(installed)"
@ignore-app="ignoreApp(installed)"
@ -139,7 +137,7 @@ import { onMounted, onUnmounted, reactive, ref } from 'vue';
import i18n from '@/lang';
import { ElMessageBox } from 'element-plus';
import { App } from '@/api/interface/app';
import { jumpToPath, toLink } from '@/utils/util';
import { jumpToPath } from '@/utils/util';
import { useRouter } from 'vue-router';
import { MsgSuccess } from '@/utils/message';
import { getAgentSettingByKey } from '@/api/modules/setting';
@ -444,27 +442,6 @@ 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;