feat: 完成数据库端口修改功能

This commit is contained in:
ssongliu
2022-11-08 14:34:41 +08:00
committed by ssongliu
parent 85419b6dd4
commit 8431f49c47
14 changed files with 152 additions and 11 deletions

View File

@@ -104,6 +104,7 @@ import {
updateMysqlConfByFile,
updateMysqlDBInfo,
} from '@/api/modules/database';
import { ChangePort } from '@/api/modules/app';
import { Rules } from '@/global/form-rules';
import i18n from '@/lang';
@@ -152,6 +153,16 @@ const onSave = async (formEl: FormInstance | undefined, key: string, val: any) =
if (!result) {
return;
}
if (key === 'port') {
let params = {
key: baseInfo.mysqlKey,
name: mysqlName.value,
port: val,
};
await ChangePort(params);
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
return;
}
let changeForm = {
id: 0,
mysqlName: mysqlName.value,