CN-399 Detection--服务质量事件 指标变化曲线开发:时间查询参数应为秒级时间戳
This commit is contained in:
@@ -160,8 +160,8 @@ export default {
|
||||
|
||||
get(api.detection.performanceEvent.metric, {
|
||||
domain: this.detection.domain,
|
||||
startTime: this.searchStartTime*1000,
|
||||
endTime: this.searchEndTime*1000,
|
||||
startTime: this.searchStartTime,
|
||||
endTime: this.searchEndTime,
|
||||
}).then((response) => {
|
||||
if (response.code === 200) {
|
||||
resolve(response.data.result[0])
|
||||
|
||||
@@ -92,13 +92,13 @@
|
||||
|
||||
<script>
|
||||
import { api, getData } from '@/utils/api'
|
||||
import { eventSeverityColor, unitTypes } from '@/utils/constants'
|
||||
import { eventSeverityColor,unitTypes ,topDomain} from '@/utils/constants'
|
||||
import { getSecond } from '@/utils/date-util'
|
||||
import { get } from '@/utils/http'
|
||||
import * as echarts from 'echarts'
|
||||
import { markRaw } from 'vue'
|
||||
import { metricOption } from '@/views/detections/options/detectionOptions'
|
||||
import { sortBy, reverseSortBy, computeSecondaryDomain } from '@/utils/tools'
|
||||
import { sortBy,reverseSortBy } from '@/utils/tools'
|
||||
export default {
|
||||
name: 'DetectionPerformanceEventDomainOverview',
|
||||
props: {
|
||||
@@ -135,10 +135,35 @@ export default {
|
||||
}
|
||||
return result || '-'
|
||||
}
|
||||
},
|
||||
computeSecondaryDomain () {
|
||||
return function (name) {
|
||||
// 命中的顶级域名
|
||||
let hitTopDomain = ''
|
||||
// 同顶级域名比对
|
||||
const hits = []
|
||||
topDomain.forEach(td => {
|
||||
const hitIndex = name.lastIndexOf(td)
|
||||
if (hitIndex > -1 && hitIndex + td.length === name.length) {
|
||||
hits.push(td)
|
||||
}
|
||||
})
|
||||
if (hits.length > 0) {
|
||||
hits.sort((a, b) => {
|
||||
return b.split('.').length - a.split('.').length
|
||||
})
|
||||
hitTopDomain = hits[0]
|
||||
} else {
|
||||
const arr = name.split('.')
|
||||
hitTopDomain = arr[arr.length - 1]
|
||||
}
|
||||
const index = name.lastIndexOf(hitTopDomain)
|
||||
const preArr = name.substring(0, index).split('.')
|
||||
return [preArr[preArr.length - 2], hitTopDomain].join('.')
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
computeSecondaryDomain,
|
||||
query () {
|
||||
this.queryBasic().then(responses => {
|
||||
responses && (this.basicInfo = responses)
|
||||
@@ -194,8 +219,8 @@ export default {
|
||||
|
||||
get(api.detection.performanceEvent.metric, {
|
||||
domain: this.detection.domain,
|
||||
startTime: this.searchStartTime*1000,
|
||||
endTime: this.searchEndTime*1000,
|
||||
startTime: this.searchStartTime,
|
||||
endTime: this.searchEndTime,
|
||||
}).then((response) => {
|
||||
if (response.code === 200) {
|
||||
resolve(response.data.result[0])
|
||||
|
||||
@@ -183,8 +183,8 @@ export default {
|
||||
|
||||
get(api.detection.performanceEvent.metric, {
|
||||
domain: this.detection.domain,
|
||||
startTime: this.searchStartTime*1000,
|
||||
endTime: this.searchEndTime*1000,
|
||||
startTime: this.searchStartTime,
|
||||
endTime: this.searchEndTime,
|
||||
}).then((response) => {
|
||||
if (response.code === 200) {
|
||||
resolve(response.data.result[0])
|
||||
|
||||
Reference in New Issue
Block a user