Skip to content

Commit 1bbf8c1

Browse files
authored
Merge pull request #689 from veops/dev_ui_250408
feat(ui): CI Type[AD] - update scanning configuration
2 parents 435bb2a + 93e919b commit 1bbf8c1

File tree

8 files changed

+462
-210
lines changed

8 files changed

+462
-210
lines changed

cmdb-ui/src/modules/cmdb/components/nodeSetting/index.vue

Lines changed: 0 additions & 147 deletions
This file was deleted.

cmdb-ui/src/modules/cmdb/lang/en.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ const cmdb_en = {
7777
confirmDeleteADT: 'Do you confirm to delete [{pluginName}]',
7878
attributeMap: 'Attribute mapping',
7979
nodeConfig: 'Node Configuration',
80+
scanningParameter: 'Scanning Parameter',
8081
autoDiscovery: 'AutoDiscovery',
8182
node: 'Node',
8283
adExecConfig: 'Execute configuration',
@@ -253,6 +254,20 @@ const cmdb_en = {
253254
checkModalColumn4: 'Last checkup time',
254255
testModalTitle: 'Automated discovery testing',
255256
attrMapTableAttrPlaceholder: 'Please edit the name',
257+
SNMPConfiguration: 'SNMP Configuration',
258+
nodeList: 'Node List',
259+
defaultVersion: 'Default Version',
260+
defaultCommunity: 'Default Community',
261+
timeout: 'Timeout',
262+
retryCount: 'Retry Count',
263+
scanningConfiguration: 'Scanning Configuration',
264+
initialNode: 'Initial Node',
265+
defaultGateway: 'Default Gateway',
266+
recursiveOrNot: 'Recursive Or Not',
267+
recursiveTip: 'Scanning Configuration: When disabling recursion, the node list must be configured.',
268+
maximumDepth: 'Maximum Depth',
269+
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',
270+
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',
256271
nodeSettingIp: 'Network device IP address',
257272
nodeSettingIpTip: 'Please enter the ip address',
258273
nodeSettingIpTip1: 'ip address format error',

cmdb-ui/src/modules/cmdb/lang/zh.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ const cmdb_zh = {
7777
confirmDeleteADT: '确认删除 【{pluginName}】',
7878
attributeMap: '字段映射',
7979
nodeConfig: '节点配置',
80+
scanningParameter: '扫描参数',
8081
autoDiscovery: '自动发现属性',
8182
node: '节点',
8283
adExecConfig: '执行配置',
@@ -253,6 +254,20 @@ const cmdb_zh = {
253254
checkModalColumn4: '最近检查时间',
254255
testModalTitle: '自动发现测试',
255256
attrMapTableAttrPlaceholder: '请编辑名称',
257+
SNMPConfiguration: 'SNMP配置',
258+
nodeList: '节点列表',
259+
defaultVersion: '默认版本',
260+
defaultCommunity: '默认 Community',
261+
timeout: '超时时间',
262+
retryCount: '重试次数',
263+
scanningConfiguration: '扫描配置',
264+
initialNode: '初始节点',
265+
defaultGateway: '默认网关',
266+
recursiveOrNot: '是否递归',
267+
recursiveTip: '扫描配置关闭递归时, 必须配置节点列表',
268+
maximumDepth: '最大深度',
269+
snmpFormTip1: '节点列表:如果不是默认的SNMP版本和Community则需要单独配置\n超时时间:建立SNMP连接的超时时间\n重试次数:建立SNMP连接的重试次数',
270+
snmpFormTip2: '初始节点: 开始扫描的第一个节点,如果不配置则是从默认网关开始递归扫描\n是否递归: 默认开启,表示尽可能发现所有网络设备和拓扑关系;如果关闭,则仅扫描节点列表里的设备\n最大深度: 网络设备拓扑的深度\nCIDR:扫描的结果用CIDR进行过滤,不配置则不会过滤。格式: 192.168.1.0/24',
256271
nodeSettingIp: '网络设备IP地址',
257272
nodeSettingIpTip: '请输入 ip 地址',
258273
nodeSettingIpTip1: 'ip地址格式错误',
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
<template>
2+
<a-form-model
3+
:model="formData"
4+
labelAlign="right"
5+
:labelCol="labelCol"
6+
:wrapperCol="{ span: 6 }"
7+
class="attr-ad-form"
8+
>
9+
<a-form-model-item
10+
:label="$t('cmdb.ciType.defaultVersion')"
11+
>
12+
<a-select
13+
v-model="formData.version"
14+
allowClear
15+
>
16+
<a-select-option value="1">
17+
v1
18+
</a-select-option>
19+
<a-select-option value="2c">
20+
v2c
21+
</a-select-option>
22+
</a-select>
23+
</a-form-model-item>
24+
25+
<a-form-model-item
26+
:label="$t('cmdb.ciType.defaultCommunity')"
27+
>
28+
<a-input v-model="formData.community" />
29+
</a-form-model-item>
30+
31+
<a-form-model-item
32+
:label="$t('cmdb.ciType.timeout')"
33+
>
34+
<a-input-number
35+
v-model="formData.timeout"
36+
:min="0"
37+
:precision="0"
38+
/>
39+
</a-form-model-item>
40+
41+
<a-form-model-item
42+
:label="$t('cmdb.ciType.retryCount')"
43+
>
44+
<a-input-number
45+
v-model="formData.retries"
46+
:min="0"
47+
:precision="0"
48+
/>
49+
</a-form-model-item>
50+
</a-form-model>
51+
</template>
52+
53+
<script>
54+
export default {
55+
name: 'SNMPConfig',
56+
model: {
57+
prop: 'value',
58+
event: 'change',
59+
},
60+
props: {
61+
value: {
62+
type: Object,
63+
default: () => {},
64+
},
65+
},
66+
inject: ['provide_labelCol'],
67+
computed: {
68+
formData: {
69+
get() {
70+
return this.value
71+
},
72+
set(newValue) {
73+
this.$emit('change', newValue)
74+
}
75+
},
76+
labelCol() {
77+
return this.provide_labelCol()
78+
}
79+
}
80+
}
81+
</script>
82+
83+
<style lang="less" scoped>
84+
</style>
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<template>
2+
<a-form-model
3+
:model="formData"
4+
labelAlign="right"
5+
:labelCol="labelCol"
6+
:wrapperCol="{ span: 6 }"
7+
class="attr-ad-form"
8+
>
9+
<a-form-model-item
10+
:label="$t('cmdb.ciType.initialNode')"
11+
>
12+
<a-input
13+
v-model="formData.initial_node"
14+
:placeholder="$t('cmdb.ciType.defaultGateway')"
15+
/>
16+
</a-form-model-item>
17+
18+
<a-form-model-item
19+
:label="$t('cmdb.ciType.recursiveOrNot')"
20+
>
21+
<a-switch v-model="formData.recursive_scan" />
22+
</a-form-model-item>
23+
24+
<a-form-model-item
25+
:label="$t('cmdb.ciType.maximumDepth')"
26+
>
27+
<a-input-number
28+
v-model="formData.max_depth"
29+
:min="0"
30+
:precision="0"
31+
/>
32+
</a-form-model-item>
33+
</a-form-model>
34+
</template>
35+
36+
<script>
37+
export default {
38+
name: 'SNMPScanningConfig',
39+
model: {
40+
prop: 'value',
41+
event: 'change',
42+
},
43+
props: {
44+
value: {
45+
type: Object,
46+
default: () => {},
47+
},
48+
},
49+
inject: ['provide_labelCol'],
50+
computed: {
51+
formData: {
52+
get() {
53+
return this.value
54+
},
55+
set(newValue) {
56+
this.$emit('change', newValue)
57+
}
58+
},
59+
labelCol() {
60+
return this.provide_labelCol()
61+
}
62+
},
63+
methods: {
64+
}
65+
}
66+
</script>

0 commit comments

Comments
 (0)