fix: 修复detection下拉内容中domain和app的展示调整

This commit is contained in:
刘洪洪
2023-01-09 16:36:44 +08:00
parent 4804748564
commit d84483c0dc
4 changed files with 44 additions and 30 deletions

View File

@@ -1086,3 +1086,27 @@ export function colorGradientCalculation (startColor, endColor, values) {
export function colorHexToRgbArr (hex) {
return [1, 3, 5].map((h) => parseInt(hex.substring(h, h + 2), 16))
}
/**
* 通过事件类型eventType转换对应名称
* @param type
* @returns {string}
*/
export function getNameByEventType (type) {
switch (type) {
case 'http error': {
return 'http error ratio'
}
case 'dns error': {
return 'dns error ratio'
}
case 'high dns response time': {
return 'dns response time'
}
// 目前ui并未找到此类型添加以防不测
case 'high http resopnse time':
default: {
return 'http response time'
}
}
}