diff --git a/nezha-fronted/src/assets/css/components/page/config/mibBrowser.scss b/nezha-fronted/src/assets/css/components/page/config/mibBrowser.scss index 2c07c0bd0..7777e790a 100644 --- a/nezha-fronted/src/assets/css/components/page/config/mibBrowser.scss +++ b/nezha-fronted/src/assets/css/components/page/config/mibBrowser.scss @@ -115,7 +115,7 @@ } .mib-browser-detail-row:last-of-type div:last-of-type { position: absolute; - left: calc(25% + 2px); + left: calc(25% + 4px); width: calc(75% - 20px); height: 100%; padding-right: 12px; @@ -246,9 +246,6 @@ min-height: 28px; line-height: 28px; } -.mib-browser .el-dialog .el-dialog__footer { - margin-top: 0; -} .mib-browser .el-button:focus, .mib-browser .el-button:hover { color: unset; border-color: unset; @@ -260,3 +257,12 @@ height: 40px !important; } } + +.mib-browser .el-dialog{ + .el-dialog__body{ + padding: 30px 30px 0; + } + .el-dialog__footer{ + padding: 15px 30px; + } +} \ No newline at end of file diff --git a/nezha-fronted/src/components/page/config/mibBrowser.vue b/nezha-fronted/src/components/page/config/mibBrowser.vue index 73a3e8eca..69f5cd8e1 100644 --- a/nezha-fronted/src/components/page/config/mibBrowser.vue +++ b/nezha-fronted/src/components/page/config/mibBrowser.vue @@ -4,6 +4,12 @@ ref="dataList" > - -
+ + + +
- + +
+ + + + + + + + + + + + + + + +
+ + +
+
@@ -176,7 +211,6 @@ import fileSaver from 'file-saver' import nzDataList from '@/components/common/table/nzDataList' import xlsx from 'xlsx' import copy from '@/components/common/copy' - export default { name: 'mibBrowser', props: { @@ -191,6 +225,17 @@ export default { loading: false, treeLoading: false, snmpSetFormVisible: false, // snmp set表单 + rules: { + oid: [ + { required: true, message: this.$t('validate.required'), trigger: 'blur' } + ], + type: [ + { required: true, message: this.$t('validate.required'), trigger: 'change' } + ], + value: [ + { required: true, message: this.$t('validate.required'), trigger: 'blur' } + ] + }, searchParam: { host: '', oid: '', @@ -198,7 +243,9 @@ export default { operation: 'get', version: 2, community: 'public', - snmpCredentialId: null + snmpCredentialId: null, + type: '', + value: '' }, /* searchParam: { manageIp: '', @@ -246,7 +293,6 @@ export default { showTable: true, typeData: ['OctetString', 'Integer', 'OID', 'Gauge', 'Counter32', 'IpAddress', 'TimeTicks', 'Counter64', 'UnsignedInteger', 'BITS', 'Float', 'DateAndTime'], assetInputTimer: null, - credentialData: [] } }, @@ -323,30 +369,38 @@ export default { } this.getWalkData() }, - search (set) { - /* if (this.loading) { + + async search (set) { + if (this.loading) { return - } */ + } // this.popShow(); this.popHide() // 再调用一次,对数据赋值 /* 处理snmpset */ - /* if (!set) { + if (!set) { if (this.searchParam.operation == 'set') { this.snmpSetFormVisible = true return } } if (this.snmpSetFormVisible) { - if (!this.searchParam.oid || !this.searchParam.type || !this.searchParam.value) { - this.$message.error(this.$t('validate.required')) - return + try { + await this.$refs.form.validate() + this.snmpSetFormVisible = false + } catch (error) { + return false } - this.snmpSetFormVisible = false - } */ + } + this.loading = true + const params = this.$lodash.cloneDeep(this.searchParam) + if (params.operation != 'set') { + delete params.type + delete params.value + } setTimeout(() => { - this.$post('mib/browser', this.searchParam).then(response => { + this.$post('mib/browser', params).then(response => { this.loading = false if (response.code === 200) { this.resultData = this.resultData.concat(response.data.list)