fix: 1、detection详情添加严重程度字段;2、修复detection的threshold详情因接口字段变更导致的报错

This commit is contained in:
刘洪洪
2024-08-16 18:32:09 +08:00
parent 9ce38d1a25
commit bc8a704088
4 changed files with 48 additions and 3 deletions

View File

@@ -1591,3 +1591,33 @@ export const headerCellClass = (row) => {
export const handleSpecialCode = (str) => {
return str.indexOf('&') > -1 ? str.replaceAll('&', '&') : str
}
/**
* 严重程度code和字符转换
* @param code
* @returns {string}
*/
export const getSeverityByCode = (code) => {
switch (code) {
case 5:
case '5': {
return 'Critical'
}
case 4:
case '4': {
return 'High'
}
case 3:
case '3': {
return 'Medium'
}
case 2:
case '2': {
return 'Low'
}
case 1:
case '1': {
return 'Info'
}
}
}