1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-01-19 08:19:15 +08:00

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

This commit is contained in:
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,6 +316,11 @@ const search = async (column?: any) => {
};
const loadDB = async () => {
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(() => {
@ -324,6 +330,7 @@ const loadDB = async () => {
.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" />