feat: 数据库从服务器获取增加提示信息 (#1817)

pull/1819/head
ssongliu 2023-08-03 14:45:27 +08:00 committed by GitHub
parent e4462c06fe
commit b0320a4ebc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 22 additions and 11 deletions

View File

@ -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

View File

@ -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',

View File

@ -333,6 +333,7 @@ const message = {
confChange: '',
loadFromRemote: '',
loadFromRemoteHelper: ' 1Panel',
passwordHelper: '',
remote: '',
remoteDB: '',

View File

@ -333,6 +333,7 @@ const message = {
confChange: '',
loadFromRemote: '',
loadFromRemoteHelper: ' 1Panel',
passwordHelper: '',
remote: '',
remoteDB: '',

View File

@ -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 () => {

View File

@ -31,7 +31,7 @@
<el-input clearable v-model.trim="dialogData.rowData!.address" />
</el-form-item>
<el-form-item :label="$t('commons.table.port')" prop="port">
<el-input clearable v-model.trim="dialogData.rowData!.port" />
<el-input clearable v-model.number="dialogData.rowData!.port" />
</el-form-item>
<el-form-item :label="$t('commons.login.username')" prop="username">
<el-input clearable v-model.trim="dialogData.rowData!.username" />