Browse Source

添加了表单验证以确保新节点ID为必填项并符合特定输入规则

pull/131/head
StarsL.cn 3 months ago
parent
commit
da2ec6affd
  1. 10
      vue-consul/src/views/jms/index.vue

10
vue-consul/src/views/jms/index.vue

@ -100,14 +100,14 @@
</el-table-column>
</el-table>
<el-dialog title="开启同步JumpServer" :visible.sync="swFormVisible" :before-close="fetchData" width="33%">
<el-form ref="dataForm" :model="jms_sync" label-position="right" label-width="auto"
<el-form ref="dataForm" :rules="rules" :model="jms_sync" label-position="right" label-width="auto"
style="width: 90%; margin-left: 20px;">
<el-form-item label="同步间隔">
<el-input v-model="jms_sync.interval" style="width: 180px;" type="number">
<template slot="append">分钟</template>
</el-input>
</el-form-item>
<el-form-item required label="新节点ID">
<el-form-item label="新节点ID" prop="newid">
<el-input v-model="jms_sync.nodeid" />
</el-form-item>
<font size="3px" color="#ff0000">注意每个云账号必须在JumpServer创建一个新节点<br><br>JumpServer中已有的同名主机不会同步日志可查看同名信息</font>
@ -139,7 +139,11 @@ export default {
account_list: [],
jms_sync: { vendor: '', account: '', interval: '3', nodeid: '' },
switch_dict: {},
swFormVisible: false
swFormVisible: false,
rules: {
newid: [{ required: true, message: '此为必填项', trigger: 'change' },
{ validator: validateInput, trigger: ['blur', 'change'] }]
}
}
},
created() {

Loading…
Cancel
Save