mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2024-11-24 02:59:16 +08:00
fix: 解决数据库切换版本不正确的问题 (#7111)
This commit is contained in:
parent
f1afc0f4d9
commit
ee0e17a496
@ -47,6 +47,7 @@ var (
|
||||
ErrXpackNotFound = "ErrXpackNotFound"
|
||||
ErrXpackNotActive = "ErrXpackNotActive"
|
||||
ErrXpackLost = "ErrXpackLost"
|
||||
ErrXpackTimeout = "ErrXpackTimeout"
|
||||
ErrXpackOutOfDate = "ErrXpackOutOfDate"
|
||||
)
|
||||
|
||||
|
@ -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({
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user