CN-361 fix: 域名下拉异常

This commit is contained in:
chenjinsong
2022-03-10 23:23:26 +08:00
parent 70996eaabb
commit 71781bda5f
10 changed files with 69 additions and 76 deletions

View File

@@ -264,7 +264,7 @@ export default {
const queryParams = {
startTime: parseInt(this.timeFilter.startTime / 1000),
endTime: parseInt(this.timeFilter.endTime / 1000),
appName: this.entityData.appName
appName: this.entity.appName
}
return queryParams
},
@@ -278,25 +278,10 @@ export default {
this.chartData = response.data.result
}
})
}
},
watch: {
entityData: {
immediate: true,
deep: true,
handler (n) {
if (n) {
this.singleValues.chartDatas.splice(0, 1, this.$_.get(n, 'establishLatency'))
this.singleValues.chartDatas.splice(1, 1, this.$_.get(n, 'httpResponseLatency'))
this.singleValues.chartDatas.splice(2, 1, this.$_.get(n, 'sslConLatency'))
this.singleValues.chartDatas.splice(3, 1, this.$_.get(n, 'sequenceGapLossPercent'))
this.singleValues.chartDatas.splice(4, 1, this.$_.get(n, 'pktRetransPercent'))
this.$nextTick(() => {
this.getRelatedServerDataOne(this.relatedServerDomainUrl)
this.getRelatedServerDataTow(this.relatedServerIpUrl)
})
}
}
},
queryRelated () {
this.getRelatedServerDataOne(this.relatedServerDomainUrl)
this.getRelatedServerDataTwo(this.relatedServerIpUrl)
}
},
mounted () {

View File

@@ -272,7 +272,7 @@ export default {
const queryParams = {
startTime: parseInt(this.timeFilter.startTime / 1000),
endTime: parseInt(this.timeFilter.endTime / 1000),
domain: this.entityData.domainName
domain: this.entity.domainName
}
return queryParams
},
@@ -290,28 +290,21 @@ export default {
getBasicProperties () {
get(this.basicProperties, this.getQueryParams()).then(response => {
if (response.code === 200) {
this.entityData = response.data.result
this.entityData = {
...this.entityData,
domainCategory: response.data.result.domainCategory,
domainCategoryGroup: response.data.result.domainCategoryGroup,
domainDescription: response.data.result.domainDescription,
domainReputationScore: response.data.result.domainReputationScore,
domainWhoisAddress: response.data.result.domainWhoisAddress,
domainWhoisOrg: response.data.result.domainWhoisOrg
}
}
})
}
},
watch: {
entityData: {
immediate: true,
deep: true,
handler (n) {
if (n) {
this.singleValues.chartDatas.splice(0, 1, this.$_.get(n, 'establishLatency'))
this.singleValues.chartDatas.splice(1, 1, this.$_.get(n, 'httpResponseLatency'))
this.singleValues.chartDatas.splice(2, 1, this.$_.get(n, 'sslConLatency'))
this.singleValues.chartDatas.splice(3, 1, this.$_.get(n, 'sequenceGapLossPercent'))
this.singleValues.chartDatas.splice(4, 1, this.$_.get(n, 'pktRetransPercent'))
this.$nextTick(() => {
this.getRelatedServerDataOne(this.relatedServerAppUrl)
this.getRelatedServerDataTow(this.relatedServerIpUrl)
})
}
}
},
queryRelated () {
this.getRelatedServerDataOne(this.relatedServerAppUrl)
this.getRelatedServerDataTwo(this.relatedServerIpUrl)
}
},
mounted () {

View File

@@ -4,11 +4,11 @@
<div class="overview__content">
<div class="overview__row">
<div class="row__label row__label--width130">{{$t('overall.location')}}</div>
<div class="row__content">{{entityData.ipLocationCountry || '-'}}</div>
<div class="row__content">{{ipLocationRegion(entity)}}</div>
</div>
<div class="overview__row">
<div class="row__label row__label--width130">ASN</div>
<div class="row__content">{{entityData.ipAsn || '-'}}</div>
<div class="row__content">{{entity.ipAsn || '-'}}</div>
</div>
</div>
</div>
@@ -252,12 +252,31 @@ export default {
timer: null
}
},
computed: {
ipLocationRegion () {
return function (entityData) {
const hasProvinceAndCity = entityData.ipLocationProvince && entityData.ipLocationCity &&
entityData.ipLocationProvince !== 'null' && entityData.ipLocationCity !== 'null'
const hasProvince = entityData.ipLocationProvince && entityData.ipLocationProvince !== 'null'
const hasCity = entityData.ipLocationCity && entityData.ipLocationCity !== 'null'
if (hasProvinceAndCity) {
return `${entityData.ipLocationProvince}, ${entityData.ipLocationCity}`
} else if (hasProvince) {
return entityData.ipLocationProvince
} else if (hasCity) {
return entityData.ipLocationCity
} else {
return '-'
}
}
}
},
methods: {
getQueryParams () {
const queryParams = {
startTime: parseInt(this.timeFilter.startTime / 1000),
endTime: parseInt(this.timeFilter.endTime / 1000),
ip: this.entityData.ipAddr
ip: this.entity.ipAddr
}
return queryParams
},
@@ -271,24 +290,10 @@ export default {
this.chartData = response.data.result
}
})
}
},
watch: {
entityData: {
deep: true,
handler (n) {
if (n) {
this.singleValues.chartDatas.splice(0, 1, this.$_.get(n, 'establishLatency'))
this.singleValues.chartDatas.splice(1, 1, this.$_.get(n, 'httpResponseLatency'))
this.singleValues.chartDatas.splice(2, 1, this.$_.get(n, 'sslConLatency'))
this.singleValues.chartDatas.splice(3, 1, this.$_.get(n, 'sequenceGapLossPercent'))
this.singleValues.chartDatas.splice(4, 1, this.$_.get(n, 'pktRetransPercent'))
this.$nextTick(() => {
this.getRelatedServerDataOne(this.relatedServerDomainUrl)
this.getRelatedServerDataTow(this.relatedServerAppUrl)
})
}
}
},
queryRelated () {
this.getRelatedServerDataOne(this.relatedServerDomainUrl)
this.getRelatedServerDataTwo(this.relatedServerAppUrl)
}
},
mounted () {

View File

@@ -149,6 +149,12 @@ export default {
this.entityData.sslConLatency = response.data.result.sslConLatency
this.entityData.sequenceGapLossPercent = response.data.result.sequenceGapLossPercent
this.entityData.pktRetransPercent = response.data.result.pktRetransPercent
this.singleValues.chartDatas.splice(0, 1, this.$_.get(this.entityData, 'establishLatency'))
this.singleValues.chartDatas.splice(1, 1, this.$_.get(this.entityData, 'httpResponseLatency'))
this.singleValues.chartDatas.splice(2, 1, this.$_.get(this.entityData, 'sslConLatency'))
this.singleValues.chartDatas.splice(3, 1, this.$_.get(this.entityData, 'sequenceGapLossPercent'))
this.singleValues.chartDatas.splice(4, 1, this.$_.get(this.entityData, 'pktRetransPercent'))
}
})
}
@@ -224,12 +230,13 @@ export default {
queryEntityDetail () {
this.queryEntityDetailTraffic()
this.queryEntityDetailRelation()
// this.queryEntityDetailRelation()
this.queryEntityDetailAlert()
this.queryEntityDetailSecurity()
this.queryEntityDetailNetworkQuantity()
this.queryEntityDetailLinkOutUrl()
this.queryEntityDetailLinkInUrl()
this.queryRelated()
}
},
setup () {
@@ -241,7 +248,6 @@ export default {
},
mounted () {
if (this.listMode === 'list') {
this.entityData = _.cloneDeep(this.entity)
this.chartOption = _.cloneDeep(entityListLineOption)
setTimeout(() => { this.queryEntityDetail() })
}