1818 </el-form-item >
1919 <el-form-item :label =" $t('commons.login.password')" prop =" password" >
2020 <el-input type =" password" clearable show-password v-model =" form.password" ></el-input >
21+ <span class =" input-help" >{{ $t('commons.rule.illegalChar') }}</span >
2122 </el-form-item >
2223 <el-form-item :label =" $t('database.permission')" prop =" permission" >
2324 <el-select v-model =" form.permission" >
2425 <el-option value =" %" :label =" $t('database.permissionAll')" />
2526 <el-option
2627 v-if =" form.from !== 'local'"
2728 value =" localhost"
28- :label =" $t('terminal.localhost')"
29+ :label =" $t('terminal.localhost') + '(localhost)' "
2930 />
3031 <el-option value =" ip" :label =" $t('database.permissionForIP')" />
3132 </el-select >
33+ <span v-if =" form.from !== 'local'" class =" input-help" >
34+ {{ $t('database.localhostHelper') }}
35+ </span >
3236 </el-form-item >
3337 <el-form-item v-if =" form.permission === 'ip'" prop =" permissionIPs" >
3438 <el-input clearable :rows =" 3" type =" textarea" v-model =" form.permissionIPs" />
@@ -60,7 +64,6 @@ import { bindUser } from '@/api/modules/database';
6064import DrawerHeader from ' @/components/drawer-header/index.vue' ;
6165import { Rules } from ' @/global/form-rules' ;
6266import { MsgSuccess } from ' @/utils/message' ;
63- import { checkIp } from ' @/utils/util' ;
6467
6568const loading = ref ();
6669const bindVisible = ref (false );
@@ -79,21 +82,11 @@ const confirmDialogRef = ref();
7982
8083const rules = reactive ({
8184 username: [Rules .requiredInput , Rules .name ],
82- password: [Rules .paramComplexity ],
85+ password: [Rules .requiredInput , Rules . noSpace , Rules . illegal ],
8386 permission: [Rules .requiredSelect ],
84- permissionIPs: [{ validator: checkIPs , trigger: ' blur ' , required: true } ],
87+ permissionIPs: [Rules . requiredInput , Rules . noSpace , Rules . illegal ],
8588});
8689
87- function checkIPs(rule : any , value : any , callback : any ) {
88- let ips = form .permissionIPs .split (' ,' );
89- for (const item of ips ) {
90- if (checkIp (item )) {
91- return callback (new Error (i18n .global .t (' commons.rule.ip' )));
92- }
93- }
94- callback ();
95- }
96-
9790interface DialogProps {
9891 from: string ;
9992 database: string ;
0 commit comments