diff --git a/cmdb-ui/src/modules/cmdb/components/nodeSetting/index.vue b/cmdb-ui/src/modules/cmdb/components/nodeSetting/index.vue
deleted file mode 100644
index 3cf1ddd..0000000
--- a/cmdb-ui/src/modules/cmdb/components/nodeSetting/index.vue
+++ /dev/null
@@ -1,147 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- v1
-
-
- v2c
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/cmdb-ui/src/modules/cmdb/lang/en.js b/cmdb-ui/src/modules/cmdb/lang/en.js
index f7c5794..e1ba949 100644
--- a/cmdb-ui/src/modules/cmdb/lang/en.js
+++ b/cmdb-ui/src/modules/cmdb/lang/en.js
@@ -77,6 +77,7 @@ const cmdb_en = {
confirmDeleteADT: 'Do you confirm to delete [{pluginName}]',
attributeMap: 'Attribute mapping',
nodeConfig: 'Node Configuration',
+ scanningParameter: 'Scanning Parameter',
autoDiscovery: 'AutoDiscovery',
node: 'Node',
adExecConfig: 'Execute configuration',
@@ -253,6 +254,20 @@ const cmdb_en = {
checkModalColumn4: 'Last checkup time',
testModalTitle: 'Automated discovery testing',
attrMapTableAttrPlaceholder: 'Please edit the name',
+ SNMPConfiguration: 'SNMP Configuration',
+ nodeList: 'Node List',
+ defaultVersion: 'Default Version',
+ defaultCommunity: 'Default Community',
+ timeout: 'Timeout',
+ retryCount: 'Retry Count',
+ scanningConfiguration: 'Scanning Configuration',
+ initialNode: 'Initial Node',
+ defaultGateway: 'Default Gateway',
+ recursiveOrNot: 'Recursive Or Not',
+ recursiveTip: 'Scanning Configuration: When disabling recursion, the node list must be configured.',
+ maximumDepth: 'Maximum Depth',
+ snmpFormTip1: 'Node list: need to be configured separately if it is not the default SNMP version and Community\nTimeout: timeout for establishing SNMP connection\nRetries: number of retries for establishing SNMP connection',
+ snmpFormTip2: 'Initial Node: the first node to start scanning, if not configured then the scanning starts recursively from the default gateway\nWhether recursive: on by default, it means that all the network devices and topology relationships are found as far as possible; if off, only the devices in the node list are scanned\nMaximum Depth: the depth of the topology of the network devices\nCIDR: the results of the scanning are filtered with CIDR, if not configured then it will not be filtered. Format: 192.168.1.0/24',
nodeSettingIp: 'Network device IP address',
nodeSettingIpTip: 'Please enter the ip address',
nodeSettingIpTip1: 'ip address format error',
diff --git a/cmdb-ui/src/modules/cmdb/lang/zh.js b/cmdb-ui/src/modules/cmdb/lang/zh.js
index a68a941..a41a25c 100644
--- a/cmdb-ui/src/modules/cmdb/lang/zh.js
+++ b/cmdb-ui/src/modules/cmdb/lang/zh.js
@@ -77,6 +77,7 @@ const cmdb_zh = {
confirmDeleteADT: '确认删除 【{pluginName}】',
attributeMap: '字段映射',
nodeConfig: '节点配置',
+ scanningParameter: '扫描参数',
autoDiscovery: '自动发现属性',
node: '节点',
adExecConfig: '执行配置',
@@ -253,6 +254,20 @@ const cmdb_zh = {
checkModalColumn4: '最近检查时间',
testModalTitle: '自动发现测试',
attrMapTableAttrPlaceholder: '请编辑名称',
+ SNMPConfiguration: 'SNMP配置',
+ nodeList: '节点列表',
+ defaultVersion: '默认版本',
+ defaultCommunity: '默认 Community',
+ timeout: '超时时间',
+ retryCount: '重试次数',
+ scanningConfiguration: '扫描配置',
+ initialNode: '初始节点',
+ defaultGateway: '默认网关',
+ recursiveOrNot: '是否递归',
+ recursiveTip: '扫描配置关闭递归时, 必须配置节点列表',
+ maximumDepth: '最大深度',
+ snmpFormTip1: '节点列表:如果不是默认的SNMP版本和Community则需要单独配置\n超时时间:建立SNMP连接的超时时间\n重试次数:建立SNMP连接的重试次数',
+ snmpFormTip2: '初始节点: 开始扫描的第一个节点,如果不配置则是从默认网关开始递归扫描\n是否递归: 默认开启,表示尽可能发现所有网络设备和拓扑关系;如果关闭,则仅扫描节点列表里的设备\n最大深度: 网络设备拓扑的深度\nCIDR:扫描的结果用CIDR进行过滤,不配置则不会过滤。格式: 192.168.1.0/24',
nodeSettingIp: '网络设备IP地址',
nodeSettingIpTip: '请输入 ip 地址',
nodeSettingIpTip1: 'ip地址格式错误',
diff --git a/cmdb-ui/src/modules/cmdb/views/ci_types/attrAD/SNMPConfig/index.vue b/cmdb-ui/src/modules/cmdb/views/ci_types/attrAD/SNMPConfig/index.vue
new file mode 100644
index 0000000..e98d0b3
--- /dev/null
+++ b/cmdb-ui/src/modules/cmdb/views/ci_types/attrAD/SNMPConfig/index.vue
@@ -0,0 +1,84 @@
+
+
+
+
+
+ v1
+
+
+ v2c
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/cmdb-ui/src/modules/cmdb/views/ci_types/attrAD/SNMPScanningConfig/index.vue b/cmdb-ui/src/modules/cmdb/views/ci_types/attrAD/SNMPScanningConfig/index.vue
new file mode 100644
index 0000000..977c84d
--- /dev/null
+++ b/cmdb-ui/src/modules/cmdb/views/ci_types/attrAD/SNMPScanningConfig/index.vue
@@ -0,0 +1,66 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/cmdb-ui/src/modules/cmdb/views/ci_types/attrAD/cidrTags/index.vue b/cmdb-ui/src/modules/cmdb/views/ci_types/attrAD/cidrTags/index.vue
index 9bc195c..4d8dad3 100644
--- a/cmdb-ui/src/modules/cmdb/views/ci_types/attrAD/cidrTags/index.vue
+++ b/cmdb-ui/src/modules/cmdb/views/ci_types/attrAD/cidrTags/index.vue
@@ -1,40 +1,34 @@
-
-
-
+
+
+
+
diff --git a/cmdb-ui/src/modules/cmdb/views/ci_types/attrADTabpane.vue b/cmdb-ui/src/modules/cmdb/views/ci_types/attrADTabpane.vue
index dff970d..350a2a1 100644
--- a/cmdb-ui/src/modules/cmdb/views/ci_types/attrADTabpane.vue
+++ b/cmdb-ui/src/modules/cmdb/views/ci_types/attrADTabpane.vue
@@ -54,11 +54,38 @@
/>
-
-
-
-
-
+
+
{
- this.$refs.nodeSetting.initNodesFunc()
+ this.$refs.nodeSetting.initNodesFunc(InitializeNodes)
})
let cidrList = []
- const cidr = _findADT?.extra_option?.cidr
if (Array.isArray(cidr) && cidr?.length) {
cidrList = cidr.map((v) => {
return {
@@ -427,7 +463,16 @@ export default {
}
})
}
- this.cidrList = cidrList
+ this.SNMPScanningConfigForm = {
+ version: extra_option?.version ?? '2c',
+ community: extra_option?.community ?? 'public',
+ timeout: extra_option?.timeout ?? 5,
+ retries: extra_option?.retries ?? 3,
+ initial_node: extra_option?.initial_node ?? '',
+ recursive_scan: extra_option?.recursive_scan ?? true,
+ max_depth: extra_option?.max_depth ?? 5,
+ cidr: cidrList
+ }
}
if (this.adrType === DISCOVERY_CATEGORY_TYPE.AGENT) {
this.tableData = (_find?.attributes || []).map((item) => {
@@ -501,12 +546,27 @@ export default {
}
if (this.adrType === DISCOVERY_CATEGORY_TYPE.SNMP) {
+ const {
+ cidr,
+ ...otherConfigForm
+ } = this.SNMPScanningConfigForm
+ const nodes = this.$refs.nodeSetting?.getNodeValue() ?? []
+
params = {
extra_option: {
- nodes: this.$refs.nodeSetting?.getNodeValue() ?? [],
- cidr: this?.cidrList?.map((item) => item.value) || []
+ ...otherConfigForm,
+ nodes,
+ cidr: cidr?.map((item) => item.value) || []
},
}
+
+ if (
+ !otherConfigForm?.recursive_scan &&
+ nodes?.some((item) => !item?.ip)
+ ) {
+ this.$message.error(this.$t('cmdb.ciType.recursiveTip'))
+ return
+ }
}
if (this.adrType === DISCOVERY_CATEGORY_TYPE.AGENT) {
const $table = this.$refs.attrMapTable
@@ -761,8 +821,18 @@ export default {
}
}
.attr-ad-snmp-form {
- .ant-form-item {
- margin-bottom: 0;
+ &-title {
+ font-size: 16px;
+ color: #000000;
+ margin-bottom: 12px;
+
+ & > i {
+ font-size: 14px;
+ }
+ }
+
+ /deep/ .ant-input-number {
+ width: 100%;
}
}