diff --git a/backend/app/service/backup_app.go b/backend/app/service/backup_app.go
index 6e235e2d1..f0da8abd8 100644
--- a/backend/app/service/backup_app.go
+++ b/backend/app/service/backup_app.go
@@ -202,7 +202,6 @@ func handleAppRecover(install *model.AppInstall, recoverFile string, isRollback
global.LOG.Errorf("handle recover from sql.gz failed, err: %v", err)
return err
}
- _ = NewIMysqlService().LoadFromRemote("local")
}
if err := handleUnTar(tmpPath+"/app.tar.gz", fmt.Sprintf("%s/%s", constant.AppInstallDir, install.App.Key)); err != nil {
@@ -224,6 +223,7 @@ func handleAppRecover(install *model.AppInstall, recoverFile string, isRollback
oldInstall.Status = constant.StatusRunning
oldInstall.AppId = install.AppId
oldInstall.AppDetailId = install.AppDetailId
+ oldInstall.App.ID = install.AppId
if err := appInstallRepo.Save(context.Background(), &oldInstall); err != nil {
global.LOG.Errorf("save db app install failed, err: %v", err)
return err
diff --git a/frontend/src/lang/modules/en.ts b/frontend/src/lang/modules/en.ts
index 90b922dc1..b6758e7cb 100644
--- a/frontend/src/lang/modules/en.ts
+++ b/frontend/src/lang/modules/en.ts
@@ -338,6 +338,8 @@ const message = {
'This port is the exposed port of the container. You need to save the modification separately and restart the container!',
loadFromRemote: 'load from Server',
+ loadFromRemoteHelper:
+ 'This action will synchronize the database info on the server to 1Panel, do you want to continue?',
passwordHelper: 'Unable to retrieve, please modify',
remote: 'Remote',
remoteDB: 'Remote DB',
diff --git a/frontend/src/lang/modules/tw.ts b/frontend/src/lang/modules/tw.ts
index c507bda5b..353ca9e55 100644
--- a/frontend/src/lang/modules/tw.ts
+++ b/frontend/src/lang/modules/tw.ts
@@ -333,6 +333,7 @@ const message = {
confChange: '配置修改',
loadFromRemote: '從服務器獲取',
+ loadFromRemoteHelper: '此操作將同步服務器上數據庫信息到 1Panel,是否繼續?',
passwordHelper: '無法獲取密碼,請修改',
remote: '遠程',
remoteDB: '遠程服務器',
diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts
index 496f28584..bd8675df0 100644
--- a/frontend/src/lang/modules/zh.ts
+++ b/frontend/src/lang/modules/zh.ts
@@ -333,6 +333,7 @@ const message = {
confChange: '配置修改',
loadFromRemote: '从服务器获取',
+ loadFromRemoteHelper: '此操作将同步服务器上数据库信息到 1Panel,是否继续?',
passwordHelper: '无法获取密码,请修改',
remote: '远程',
remoteDB: '远程服务器',
diff --git a/frontend/src/views/database/mysql/index.vue b/frontend/src/views/database/mysql/index.vue
index 52dd76317..4b3cd1208 100644
--- a/frontend/src/views/database/mysql/index.vue
+++ b/frontend/src/views/database/mysql/index.vue
@@ -214,6 +214,7 @@ import Backups from '@/components/backup/index.vue';
import UploadDialog from '@/components/upload/index.vue';
import PortJumpDialog from '@/components/port-jump/index.vue';
import { dateFormat } from '@/utils/util';
+import { ElMessageBox } from 'element-plus';
import { onMounted, reactive, ref } from 'vue';
import {
deleteCheckMysqlDB,
@@ -315,15 +316,21 @@ const search = async (column?: any) => {
};
const loadDB = async () => {
- loading.value = true;
- await loadDBFromRemote(paginationConfig.from)
- .then(() => {
- loading.value = false;
- search();
- })
- .catch(() => {
- loading.value = false;
- });
+ ElMessageBox.confirm(i18n.global.t('database.loadFromRemoteHelper'), i18n.global.t('commons.msg.infoTitle'), {
+ confirmButtonText: i18n.global.t('commons.button.confirm'),
+ cancelButtonText: i18n.global.t('commons.button.cancel'),
+ type: 'info',
+ }).then(async () => {
+ loading.value = true;
+ await loadDBFromRemote(paginationConfig.from)
+ .then(() => {
+ loading.value = false;
+ search();
+ })
+ .catch(() => {
+ loading.value = false;
+ });
+ });
};
const goRouter = async () => {
diff --git a/frontend/src/views/database/mysql/remote/operate/index.vue b/frontend/src/views/database/mysql/remote/operate/index.vue
index d21b82d49..e8a8496d9 100644
--- a/frontend/src/views/database/mysql/remote/operate/index.vue
+++ b/frontend/src/views/database/mysql/remote/operate/index.vue
@@ -31,7 +31,7 @@
-
+