fix: 解决数据库切换版本不正确的问题 (#7111)

This commit is contained in:
ssongliu 2024-11-18 14:16:04 +08:00 committed by GitHub
parent f1afc0f4d9
commit ee0e17a496
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 8 additions and 13 deletions

View File

@ -47,6 +47,7 @@ var (
ErrXpackNotFound = "ErrXpackNotFound"
ErrXpackNotActive = "ErrXpackNotActive"
ErrXpackLost = "ErrXpackLost"
ErrXpackTimeout = "ErrXpackTimeout"
ErrXpackOutOfDate = "ErrXpackOutOfDate"
)

View File

@ -159,8 +159,8 @@ const isDB = () => {
return key.value === 'mysql' || key.value === 'mariadb' || key.value === 'postgresql';
};
const onCheck = async () => {
await CheckAppInstalled(key.value, name.value)
const onCheck = async (key: any, name: any) => {
await CheckAppInstalled(key, name)
.then((res) => {
data.value = res.data;
em('isExist', res.data);
@ -206,7 +206,7 @@ const onOperate = async (operation: string) => {
.then(() => {
em('update:loading', false);
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
onCheck();
onCheck(key.value, name.value);
em('after');
})
.catch(() => {
@ -234,7 +234,7 @@ const getTitle = (key: string) => {
onMounted(() => {
key.value = props.appKey;
name.value = props.appName;
onCheck();
onCheck(key.value, name.value);
});
defineExpose({

View File

@ -388,15 +388,13 @@ const onSetting = async () => {
};
const changeDatabase = async () => {
if (currentDB.value.from === 'local') {
appStatusRef.value.onCheck();
}
for (const item of dbOptionsLocal.value) {
if (item.database == currentDBName.value) {
currentDB.value = item;
appKey.value = item.type;
appName.value = item.database;
search();
appStatusRef.value?.onCheck(appKey.value, appName.value);
return;
}
}

View File

@ -351,15 +351,13 @@ const onSetting = async () => {
};
const changeDatabase = async () => {
if (currentDB.value.from === 'local') {
appStatusRef.value.onCheck();
}
for (const item of dbOptionsLocal.value) {
if (item.database == currentDBName.value) {
currentDB.value = item;
appKey.value = item.type;
appName.value = item.database;
search();
appStatusRef.value?.onCheck(appKey.value, appName.value);
return;
}
}

View File

@ -223,14 +223,12 @@ const goRouter = async (target: string) => {
};
const changeDatabase = async () => {
if (currentDB.value.from === 'local') {
appStatusRef.value.onCheck();
}
for (const item of dbOptionsLocal.value) {
if (item.database == currentDBName.value) {
currentDB.value = item;
appKey.value = item.type;
appName.value = item.database;
appStatusRef.value?.onCheck(appKey.value, appName.value);
reOpenTerminal();
return;
}