mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2024-11-27 12:39:01 +08:00
fix: 解决数据库切换版本不正确的问题 (#7111)
This commit is contained in:
parent
f1afc0f4d9
commit
ee0e17a496
@ -47,6 +47,7 @@ var (
|
|||||||
ErrXpackNotFound = "ErrXpackNotFound"
|
ErrXpackNotFound = "ErrXpackNotFound"
|
||||||
ErrXpackNotActive = "ErrXpackNotActive"
|
ErrXpackNotActive = "ErrXpackNotActive"
|
||||||
ErrXpackLost = "ErrXpackLost"
|
ErrXpackLost = "ErrXpackLost"
|
||||||
|
ErrXpackTimeout = "ErrXpackTimeout"
|
||||||
ErrXpackOutOfDate = "ErrXpackOutOfDate"
|
ErrXpackOutOfDate = "ErrXpackOutOfDate"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -159,8 +159,8 @@ const isDB = () => {
|
|||||||
return key.value === 'mysql' || key.value === 'mariadb' || key.value === 'postgresql';
|
return key.value === 'mysql' || key.value === 'mariadb' || key.value === 'postgresql';
|
||||||
};
|
};
|
||||||
|
|
||||||
const onCheck = async () => {
|
const onCheck = async (key: any, name: any) => {
|
||||||
await CheckAppInstalled(key.value, name.value)
|
await CheckAppInstalled(key, name)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
data.value = res.data;
|
data.value = res.data;
|
||||||
em('isExist', res.data);
|
em('isExist', res.data);
|
||||||
@ -206,7 +206,7 @@ const onOperate = async (operation: string) => {
|
|||||||
.then(() => {
|
.then(() => {
|
||||||
em('update:loading', false);
|
em('update:loading', false);
|
||||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||||
onCheck();
|
onCheck(key.value, name.value);
|
||||||
em('after');
|
em('after');
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
@ -234,7 +234,7 @@ const getTitle = (key: string) => {
|
|||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
key.value = props.appKey;
|
key.value = props.appKey;
|
||||||
name.value = props.appName;
|
name.value = props.appName;
|
||||||
onCheck();
|
onCheck(key.value, name.value);
|
||||||
});
|
});
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
|
@ -388,15 +388,13 @@ const onSetting = async () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const changeDatabase = async () => {
|
const changeDatabase = async () => {
|
||||||
if (currentDB.value.from === 'local') {
|
|
||||||
appStatusRef.value.onCheck();
|
|
||||||
}
|
|
||||||
for (const item of dbOptionsLocal.value) {
|
for (const item of dbOptionsLocal.value) {
|
||||||
if (item.database == currentDBName.value) {
|
if (item.database == currentDBName.value) {
|
||||||
currentDB.value = item;
|
currentDB.value = item;
|
||||||
appKey.value = item.type;
|
appKey.value = item.type;
|
||||||
appName.value = item.database;
|
appName.value = item.database;
|
||||||
search();
|
search();
|
||||||
|
appStatusRef.value?.onCheck(appKey.value, appName.value);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -351,15 +351,13 @@ const onSetting = async () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const changeDatabase = async () => {
|
const changeDatabase = async () => {
|
||||||
if (currentDB.value.from === 'local') {
|
|
||||||
appStatusRef.value.onCheck();
|
|
||||||
}
|
|
||||||
for (const item of dbOptionsLocal.value) {
|
for (const item of dbOptionsLocal.value) {
|
||||||
if (item.database == currentDBName.value) {
|
if (item.database == currentDBName.value) {
|
||||||
currentDB.value = item;
|
currentDB.value = item;
|
||||||
appKey.value = item.type;
|
appKey.value = item.type;
|
||||||
appName.value = item.database;
|
appName.value = item.database;
|
||||||
search();
|
search();
|
||||||
|
appStatusRef.value?.onCheck(appKey.value, appName.value);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -223,14 +223,12 @@ const goRouter = async (target: string) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const changeDatabase = async () => {
|
const changeDatabase = async () => {
|
||||||
if (currentDB.value.from === 'local') {
|
|
||||||
appStatusRef.value.onCheck();
|
|
||||||
}
|
|
||||||
for (const item of dbOptionsLocal.value) {
|
for (const item of dbOptionsLocal.value) {
|
||||||
if (item.database == currentDBName.value) {
|
if (item.database == currentDBName.value) {
|
||||||
currentDB.value = item;
|
currentDB.value = item;
|
||||||
appKey.value = item.type;
|
appKey.value = item.type;
|
||||||
appName.value = item.database;
|
appName.value = item.database;
|
||||||
|
appStatusRef.value?.onCheck(appKey.value, appName.value);
|
||||||
reOpenTerminal();
|
reOpenTerminal();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user