mirror of https://github.com/1Panel-dev/1Panel
feat: 解决快速安装应用跳转失败问题 (#2178)
parent
0c2d971d72
commit
fb00ba812a
|
@ -130,7 +130,7 @@ const setting = () => {
|
|||
};
|
||||
|
||||
const goRouter = async (key: string) => {
|
||||
router.push({ name: 'AppDetail', params: { appKey: key } });
|
||||
router.push({ name: 'AppAll', query: { install: key } });
|
||||
};
|
||||
|
||||
const onCheck = async () => {
|
||||
|
|
|
@ -28,17 +28,6 @@ const appStoreRouter = {
|
|||
requiresAuth: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'detail/:appKey',
|
||||
name: 'AppDetail',
|
||||
component: () => import('@/views/app-store/detail/index.vue'),
|
||||
props: true,
|
||||
hidden: true,
|
||||
meta: {
|
||||
activeMenu: '/apps',
|
||||
requiresAuth: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'installed',
|
||||
name: 'AppInstalled',
|
||||
|
|
|
@ -176,6 +176,7 @@ const canUpdate = ref(false);
|
|||
const syncing = ref(false);
|
||||
const detailRef = ref();
|
||||
const installRef = ref();
|
||||
const installKey = ref('');
|
||||
|
||||
const getColor = (index: number) => {
|
||||
return colorArr[index];
|
||||
|
@ -245,6 +246,15 @@ const searchByName = (name: string) => {
|
|||
};
|
||||
|
||||
onMounted(() => {
|
||||
if (router.currentRoute.value.query.install) {
|
||||
installKey.value = String(router.currentRoute.value.query.install);
|
||||
const params = {
|
||||
app: {
|
||||
key: installKey.value,
|
||||
},
|
||||
};
|
||||
installRef.value.acceptParams(params);
|
||||
}
|
||||
search(req);
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -4,41 +4,35 @@
|
|||
<DrawerHeader :header="$t('app.detail')" :back="handleClose" />
|
||||
</template>
|
||||
<div class="brief" v-loading="loadingApp">
|
||||
<el-row :gutter="20">
|
||||
<div>
|
||||
<el-col :span="3">
|
||||
<el-avatar shape="square" :size="180" :src="app.icon" />
|
||||
</el-col>
|
||||
<div class="detail flex">
|
||||
<div class="w-12 h-12 bg-gray-100 rounded p-1 shadow-md icon">
|
||||
<img :src="app.icon" alt="App Icon" class="w-full h-full rounded" />
|
||||
</div>
|
||||
<el-col :span="18">
|
||||
<div class="detail">
|
||||
<div class="name">
|
||||
<span>{{ app.name }}</span>
|
||||
</div>
|
||||
<div class="description">
|
||||
<span>
|
||||
{{ language == 'zh' || language == 'tw' ? app.shortDescZh : app.shortDescEn }}
|
||||
</span>
|
||||
</div>
|
||||
<br />
|
||||
<div v-if="!loadingDetail">
|
||||
<el-alert
|
||||
style="width: 300px"
|
||||
v-if="!appDetail.enable"
|
||||
:title="$t('app.limitHelper')"
|
||||
type="warning"
|
||||
show-icon
|
||||
:closable="false"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<el-button round v-if="appDetail.enable" @click="openInstall" type="primary">
|
||||
{{ $t('app.install') }}
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="ml-4">
|
||||
<div class="name mb-2">
|
||||
<span>{{ app.name }}</span>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="description mb-4">
|
||||
<span>
|
||||
{{ language == 'zh' || language == 'tw' ? app.shortDescZh : app.shortDescEn }}
|
||||
</span>
|
||||
</div>
|
||||
<br />
|
||||
<div v-if="!loadingDetail" class="mb-2">
|
||||
<el-alert
|
||||
style="width: 300px"
|
||||
v-if="!appDetail.enable"
|
||||
:title="$t('app.limitHelper')"
|
||||
type="warning"
|
||||
show-icon
|
||||
:closable="false"
|
||||
/>
|
||||
</div>
|
||||
<el-button round v-if="appDetail.enable" @click="openInstall" type="primary">
|
||||
{{ $t('app.install') }}
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="divider"></div>
|
||||
<div>
|
||||
<el-row>
|
||||
|
@ -170,7 +164,9 @@ defineExpose({
|
|||
}
|
||||
}
|
||||
|
||||
.detail {
|
||||
.icon {
|
||||
width: 180px;
|
||||
height: 180px;
|
||||
}
|
||||
|
||||
.version {
|
||||
|
|
|
@ -11,7 +11,13 @@
|
|||
</template>
|
||||
<el-row v-loading="loading">
|
||||
<el-col :span="22" :offset="1">
|
||||
<el-alert :title="$t('app.appInstallWarn')" class="common-prompt" :closable="false" type="error" />
|
||||
<el-alert
|
||||
:title="$t('app.appInstallWarn')"
|
||||
class="common-prompt"
|
||||
:closable="false"
|
||||
type="error"
|
||||
v-if="canEditPort(installData.app.key)"
|
||||
/>
|
||||
<el-form
|
||||
@submit.prevent
|
||||
ref="paramForm"
|
||||
|
@ -191,6 +197,9 @@ const appVersions = ref<string[]>([]);
|
|||
const handleClose = () => {
|
||||
open.value = false;
|
||||
resetForm();
|
||||
if (router.currentRoute.value.query.install) {
|
||||
router.push({ name: 'AppAll' });
|
||||
}
|
||||
};
|
||||
const paramKey = ref(1);
|
||||
|
||||
|
|
|
@ -249,8 +249,8 @@ const getLabel = (row: ParamObj): string => {
|
|||
}
|
||||
};
|
||||
|
||||
const toPage = (appKey: string) => {
|
||||
router.push({ name: 'AppDetail', params: { appKey: appKey } });
|
||||
const toPage = (key: string) => {
|
||||
router.push({ name: 'AppAll', query: { install: key } });
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
|
|
|
@ -355,7 +355,7 @@ const loadDB = async () => {
|
|||
};
|
||||
|
||||
const goRouter = async () => {
|
||||
router.push({ name: 'AppDetail', params: { appKey: 'mysql' } });
|
||||
router.push({ name: 'AppAll', query: { install: 'mysql' } });
|
||||
};
|
||||
|
||||
const onChange = async (info: any) => {
|
||||
|
@ -372,7 +372,7 @@ const goDashboard = async () => {
|
|||
};
|
||||
|
||||
const getAppDetail = (key: string) => {
|
||||
router.push({ name: 'AppDetail', params: { appKey: key } });
|
||||
router.push({ name: 'AppAll', query: { install: key } });
|
||||
};
|
||||
|
||||
const loadDashboardPort = async () => {
|
||||
|
|
|
@ -102,7 +102,7 @@ const goDashboard = async () => {
|
|||
dialogPortJumpRef.value.acceptParams({ port: redisCommandPort.value });
|
||||
};
|
||||
const getAppDetail = (key: string) => {
|
||||
router.push({ name: 'AppDetail', params: { appKey: key } });
|
||||
router.push({ name: 'AppAll', query: { install: key } });
|
||||
};
|
||||
|
||||
const loadDashboardPort = async () => {
|
||||
|
|
|
@ -64,7 +64,7 @@ const acceptParams = (): void => {
|
|||
};
|
||||
|
||||
const goInstall = (key: string) => {
|
||||
router.push({ name: 'AppDetail', params: { appKey: key } });
|
||||
router.push({ name: 'AppAll', query: { install: key } });
|
||||
};
|
||||
|
||||
const search = async (req: App.AppReq) => {
|
||||
|
|
|
@ -635,6 +635,8 @@ onMounted(() => {
|
|||
|
||||
<style scoped lang="scss">
|
||||
.path {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border: 1px solid #ebeef5;
|
||||
background-color: var(--panel-path-bg);
|
||||
height: 30px;
|
||||
|
|
Loading…
Reference in New Issue