mirror of https://github.com/veops/cmdb.git
parent
388134b38c
commit
c0541b7e50
|
@ -276,7 +276,7 @@ export default {
|
||||||
} else if (_findADT.agent_id) {
|
} else if (_findADT.agent_id) {
|
||||||
this.agent_type = 'agent_id'
|
this.agent_type = 'agent_id'
|
||||||
} else {
|
} else {
|
||||||
this.agent_type = 'agent_id'
|
this.agent_type = this.agentTypeRadioList[0].value
|
||||||
}
|
}
|
||||||
if (_findADT.interval || (!_findADT.interval && !_findADT.cron)) {
|
if (_findADT.interval || (!_findADT.interval && !_findADT.cron)) {
|
||||||
this.interval = 'interval'
|
this.interval = 'interval'
|
||||||
|
@ -348,9 +348,17 @@ export default {
|
||||||
}
|
}
|
||||||
if (this.agent_type === 'agent_id' || this.agent_type === 'all') {
|
if (this.agent_type === 'agent_id' || this.agent_type === 'all') {
|
||||||
params.query_expr = ''
|
params.query_expr = ''
|
||||||
|
if (this.agent_type === 'agent_id' && !params.agent_id) {
|
||||||
|
this.$message.error('请填写指定节点!')
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (this.agent_type === 'query_expr' || this.agent_type === 'all') {
|
if (this.agent_type === 'query_expr' || this.agent_type === 'all') {
|
||||||
params.agent_id = ''
|
params.agent_id = ''
|
||||||
|
if (this.agent_type === 'query_expr' && !params.query_expr) {
|
||||||
|
this.$message.error('请从cmdb中选择!')
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
putCITypeDiscovery(currentAdt.id, params).then((res) => {
|
putCITypeDiscovery(currentAdt.id, params).then((res) => {
|
||||||
|
|
|
@ -560,6 +560,7 @@ export default {
|
||||||
} else {
|
} else {
|
||||||
q = `q=_type:${this.currentTypeId[0]},` + q
|
q = `q=_type:${this.currentTypeId[0]},` + q
|
||||||
}
|
}
|
||||||
|
if (this.currentTypeId[0]) {
|
||||||
const res = await searchCI2(q)
|
const res = await searchCI2(q)
|
||||||
this.pageNo = res.page
|
this.pageNo = res.page
|
||||||
this.numfound = res.numfound
|
this.numfound = res.numfound
|
||||||
|
@ -574,6 +575,7 @@ export default {
|
||||||
})
|
})
|
||||||
this.initialInstanceList = _.cloneDeep(this.instanceList)
|
this.initialInstanceList = _.cloneDeep(this.instanceList)
|
||||||
this.calcColumns()
|
this.calcColumns()
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
q += `&root_id=${this.treeKeys[this.treeKeys.length - 1].split('%')[0]}`
|
q += `&root_id=${this.treeKeys[this.treeKeys.length - 1].split('%')[0]}`
|
||||||
const typeId = parseInt(this.treeKeys[this.treeKeys.length - 1].split('%')[1])
|
const typeId = parseInt(this.treeKeys[this.treeKeys.length - 1].split('%')[1])
|
||||||
|
@ -608,6 +610,7 @@ export default {
|
||||||
} else {
|
} else {
|
||||||
q = `q=_type:${this.currentTypeId[0]},` + q
|
q = `q=_type:${this.currentTypeId[0]},` + q
|
||||||
}
|
}
|
||||||
|
if (this.currentTypeId[0]) {
|
||||||
const res = await searchCIRelation(q)
|
const res = await searchCIRelation(q)
|
||||||
|
|
||||||
const _data = Object.assign([], res.result)
|
const _data = Object.assign([], res.result)
|
||||||
|
@ -625,8 +628,10 @@ export default {
|
||||||
this.initialInstanceList = _.cloneDeep(this.instanceList)
|
this.initialInstanceList = _.cloneDeep(this.instanceList)
|
||||||
|
|
||||||
this.calcColumns()
|
this.calcColumns()
|
||||||
|
}
|
||||||
|
|
||||||
if (refreshType === 'refreshNumber') {
|
if (refreshType === 'refreshNumber') {
|
||||||
this.treeKeys.map((key, index) => {
|
const promises = this.treeKeys.map((key, index) => {
|
||||||
statisticsCIRelation({
|
statisticsCIRelation({
|
||||||
root_ids: key.split('%')[0],
|
root_ids: key.split('%')[0],
|
||||||
level: this.treeKeys.length - index,
|
level: this.treeKeys.length - index,
|
||||||
|
|
Loading…
Reference in New Issue