fix: detections 性能事件下拉内容risk level映射
This commit is contained in:
@@ -38,7 +38,7 @@
|
|||||||
<div class="overview__row">
|
<div class="overview__row">
|
||||||
<div class="row__label">{{$t('entities.riskLevel')}}</div>
|
<div class="row__label">{{$t('entities.riskLevel')}}</div>
|
||||||
<div class="row__content">
|
<div class="row__content">
|
||||||
<div class="row__tag" :style="`background-color:${eventSeverityColor[basicInfo.appRisk]}`">{{basicInfo.appRisk || '-'}}</div>
|
<div class="row__tag" :style="`background-color:${eventSeverityColor[basicInfo.appRisk]}`">{{basicInfo.appRisk ? getRiskLevel(basicInfo.appRisk) : '-'}}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -88,7 +88,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { eventSeverityColor, unitTypes } from '@/utils/constants'
|
import { eventSeverityColor, unitTypes, riskLevelMapping } from '@/utils/constants'
|
||||||
import { api, getData } from '@/utils/api'
|
import { api, getData } from '@/utils/api'
|
||||||
import { getSecond } from '@/utils/date-util'
|
import { getSecond } from '@/utils/date-util'
|
||||||
import { get } from '@/utils/http'
|
import { get } from '@/utils/http'
|
||||||
@@ -104,12 +104,22 @@ export default {
|
|||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
|
riskLevelMapping,
|
||||||
eventSeverityColor,
|
eventSeverityColor,
|
||||||
basicInfo: {},
|
basicInfo: {},
|
||||||
metricList: []
|
metricList: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
getRiskLevel () {
|
||||||
|
return function (appRisk) {
|
||||||
|
if (this.riskLevelMapping[appRisk]) {
|
||||||
|
return this.riskLevelMapping[appRisk].name
|
||||||
|
} else {
|
||||||
|
return appRisk
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
computeLocation () {
|
computeLocation () {
|
||||||
return function (basicInfo) {
|
return function (basicInfo) {
|
||||||
let result = ''
|
let result = ''
|
||||||
|
|||||||
Reference in New Issue
Block a user