fix: 解决运行环境版本与已安装应用版本不一致的问题 (#980)

Closes https://github.com/1Panel-dev/1Panel/issues/978
pull/981/head
zhengkunwang223 2023-05-10 14:20:16 +08:00 committed by GitHub
parent 8ddaa26a57
commit 27cc3bcccd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 2 deletions

View File

@ -1,7 +1,7 @@
<template>
<el-drawer :close-on-click-modal="false" v-model="open" size="50%">
<template #header>
<DrawerHeader :header="$t('runtime.' + mode)" :back="handleClose" />
<DrawerHeader :header="$t('runtime.' + mode)" :resource="runtime.name" :back="handleClose" />
</template>
<el-row v-loading="loading">
<el-col :span="22" :offset="1">
@ -48,7 +48,11 @@
</el-select>
</el-col>
<el-col :span="12">
<el-select v-model="runtime.version" :disabled="mode === 'edit'">
<el-select
v-model="runtime.version"
:disabled="mode === 'edit'"
@change="changeVersion()"
>
<el-option
v-for="(version, index) in appVersions"
:key="index"
@ -207,6 +211,16 @@ const changeApp = (appId: number) => {
}
};
const changeVersion = () => {
initParam.value = false;
GetAppDetail(runtime.value.appId, runtime.value.version, 'runtime').then((res) => {
runtime.value.appDetailId = res.data.id;
runtime.value.image = res.data.image + ':' + runtime.value.version;
appParams.value = res.data.params;
initParam.value = true;
});
};
const getApp = (appkey: string, mode: string) => {
GetApp(appkey).then((res) => {
appVersions.value = res.data.versions || [];