This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
nezha-nezha-fronted/nezha-fronted/src/components/common/alert/alertMessageInfoDetail.vue

65 lines
2.0 KiB
Vue
Raw Normal View History

2022-03-31 09:52:13 +08:00
<template>
2022-03-31 10:45:20 +08:00
<div class="info-box-header">
2022-03-31 09:52:13 +08:00
<div v-for="item in cardNames" :key="item.key" v-if="infoData[item.key]">
2022-03-31 10:45:20 +08:00
<div class="info-box-title">{{item.label}}</div>
2022-03-31 15:52:17 +08:00
<div v-if="item.key === 'summary' || item.key === 'description'" class="info-box-content">
2022-03-31 09:52:13 +08:00
{{infoData[item.key]}}
</div>
2022-03-31 10:45:20 +08:00
<div v-if="item.key==='labels'" class="info-box-content">
<span v-for="(item, i) in labelsSort(infoData.labels)" :key="i">
<span
@mouseenter="labelHover(infoData, item.label, true, true, $event)"
@mouseleave="labelHover(infoData, item.label, false, true,)">
<nz-alert-tag
v-if="item.label !== 'alertname' && item.label !== 'severity'" :key="item.label" :cursor-point="tagType(item.label) !== 'info'"
:label="item.label"
:type="tagType(item.label)"
style="margin: 5px 0 5px 5px;"
>
{{item.value}}
</nz-alert-tag>
</span>
</span>
2022-03-31 09:52:13 +08:00
</div>
2022-03-31 10:45:20 +08:00
<div v-if="item.key==='startAt'" class="info-box-content">
2022-03-31 09:52:13 +08:00
{{utcTimeToTimezoneStr(infoData[item.key])}}
</div>
</div>
2022-03-31 10:45:20 +08:00
<alertLabel
v-if="alertLabelShow"
:id="alertLabelId"
:that="alertLabelObj"
:type="alertLabelType"
2022-04-20 16:57:14 +08:00
:alertTableDialog="true"
2022-03-31 10:45:20 +08:00
></alertLabel>
2022-03-31 09:52:13 +08:00
</div>
</template>
<script>
2022-03-31 10:45:20 +08:00
import alertMessageLabelMixin from '@/components/common/alert/alertMessageLabelMixin'
import alertLabelMixin from '@/components/common/mixin/alertLabelMixin'
2022-03-31 09:52:13 +08:00
export default {
name: 'alertMessageInfoDetail',
props: {
infoData: {
type: Object
}
},
2022-03-31 10:45:20 +08:00
mixins: [alertMessageLabelMixin, alertLabelMixin],
2022-03-31 09:52:13 +08:00
data () {
return {
cardNames: [
{ key: 'summary', label: this.$t('alert.summary') },
2022-03-31 15:52:17 +08:00
{ key: 'description', label: this.$t('overall.remark') },
2022-03-31 09:52:13 +08:00
{ key: 'labels', label: this.$t('alert.list.labels') },
{ key: 'startAt', label: this.$t('alert.startAt') }
]
}
}
}
</script>
<style scoped>
</style>