2020-07-27 18:26:44 +08:00
|
|
|
<template>
|
2021-10-26 17:47:49 +08:00
|
|
|
<div :class="calcHeight(that.position,that)" :style="calcPosition(that.position,that)" class="alert-label__border" ref="alertLabels">
|
2021-05-14 17:50:06 +08:00
|
|
|
<div class="alert-label-info" v-if="type==='asset'" v-loading="loading">
|
|
|
|
|
<div class="alert-label-box">
|
|
|
|
|
<div class="alert-label-title">ID</div>
|
|
|
|
|
<div class="alert-label-value">{{alertLabelData && alertLabelData.id ? alertLabelData.id : '--'}}</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="alert-label-box">
|
2021-10-27 16:49:58 +08:00
|
|
|
<div class="alert-label-title">{{$t('overall.name')}}</div>
|
2021-05-14 17:50:06 +08:00
|
|
|
<div class="alert-label-value">{{alertLabelData && alertLabelData.name ? alertLabelData.name : '--'}}</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="alert-label-box">
|
2021-10-27 16:49:58 +08:00
|
|
|
<div class="alert-label-title">{{$t('overall.manageIp')}}</div>
|
2021-05-14 17:50:06 +08:00
|
|
|
<div class="alert-label-value">{{alertLabelData && alertLabelData.manageIp ? alertLabelData.manageIp : '--'}}</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="alert-label-box">
|
2021-10-27 16:49:58 +08:00
|
|
|
<div class="alert-label-title">{{$t('overall.type')}}</div>
|
2021-10-26 17:47:49 +08:00
|
|
|
<div class="alert-label-value">{{alertLabelData && alertLabelData.type && alertLabelData.type.name ? alertLabelData.type.name:'--'}}</div>
|
2021-05-14 17:50:06 +08:00
|
|
|
</div>
|
|
|
|
|
<div class="alert-label-box">
|
2021-10-27 16:49:58 +08:00
|
|
|
<div class="alert-label-title">{{$t('overall.state')}}</div>
|
2021-05-14 17:50:06 +08:00
|
|
|
<div class="alert-label-value">{{alertLabelData && alertLabelData.state && alertLabelData.state.name ? alertLabelData.state.name : '--'}}</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="alert-label-box">
|
|
|
|
|
<div class="alert-label-title">Ping</div>
|
|
|
|
|
<div class="alert-label-value">
|
|
|
|
|
<div v-if="alertLabelData" :class="{'green-bg': alertLabelData && alertLabelData.pingInfo && alertLabelData.pingInfo.status === 1,'red-bg': alertLabelData && alertLabelData.pingInfo && alertLabelData.pingInfo.status === 0}" class="active-icon"></div>
|
2021-11-08 15:03:17 +08:00
|
|
|
<span v-if="alertLabelData">{{alertLabelData && alertLabelData.pingInfo && alertLabelData.pingInfo.rtt ? alertLabelData.pingInfo.rtt + 'ms':''}}</span>
|
2020-10-15 18:20:32 +08:00
|
|
|
</div>
|
2021-05-14 17:50:06 +08:00
|
|
|
</div>
|
|
|
|
|
<div class="alert-label-box">
|
2021-10-27 16:49:58 +08:00
|
|
|
<div class="alert-label-title">{{$t('overall.dc')}}</div>
|
2021-10-26 17:47:49 +08:00
|
|
|
<div class="alert-label-value">{{alertLabelData && alertLabelData.dc && alertLabelData.dc.name ? alertLabelData.dc.name:'--'}}</div>
|
2021-05-14 17:50:06 +08:00
|
|
|
</div>
|
|
|
|
|
<div class="alert-label-box">
|
2021-10-27 16:49:58 +08:00
|
|
|
<div class="alert-label-title">{{$t('overall.cabinet')}}</div>
|
2021-10-26 17:47:49 +08:00
|
|
|
<div class="alert-label-value">{{alertLabelData && alertLabelData.cabinet && alertLabelData.cabinet.name ? alertLabelData.cabinet.name : '--'}}</div>
|
2021-05-14 17:50:06 +08:00
|
|
|
</div>
|
|
|
|
|
<div class="alert-label-box">
|
2021-10-27 16:49:58 +08:00
|
|
|
<div class="alert-label-title">{{$t('overall.brand')}}</div>
|
|
|
|
|
<div class="alert-label-value">{{alertLabelData && alertLabelData.brand && alertLabelData.brand.name ? alertLabelData.brand.name : '--'}}</div>
|
2021-05-14 17:50:06 +08:00
|
|
|
</div>
|
|
|
|
|
<div class="alert-label-box">
|
2021-10-27 16:49:58 +08:00
|
|
|
<div class="alert-label-title">{{$t('overall.model')}}</div>
|
2021-05-14 17:50:06 +08:00
|
|
|
<div class="alert-label-value">{{alertLabelData && alertLabelData.model && alertLabelData.model.name ? alertLabelData.model.name : '--'}}</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="alert-label-box">
|
2021-10-27 16:49:58 +08:00
|
|
|
<div class="alert-label-title">{{$t('overall.alert')}}</div>
|
2022-03-01 11:04:16 +08:00
|
|
|
<div class="alert-label-value" v-if="alertLabelData">
|
|
|
|
|
<i :class="alertLabelData.alertNum ? 'red' : 'green'" class="nz-icon nz-icon-overview-alert vertical-align-top;" @mouseenter="tooltipHover('',true, $event)" @mouseleave="tooltipHover('',false, $event)"></i>
|
|
|
|
|
<div v-if="alertNumtooltipShow" class="alert-days-info-tooltip" :style="{left: position.left + 'px',top:position.top + 'px'}">
|
|
|
|
|
<div class="tooltip-title">Alert message (active)</div>
|
|
|
|
|
<div class="severity-info" style='justify-content: space-between'>
|
|
|
|
|
<div class="severity-name">{{$t('overall.result.total')}}</div>
|
|
|
|
|
<div class="severity-value">{{alertLabelData.alertNum}}</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<alertDaysInfo
|
|
|
|
|
v-show="!trendLoading"
|
|
|
|
|
:alertDaysData="alertDaysData"
|
|
|
|
|
/>
|
2020-07-29 09:53:46 +08:00
|
|
|
</div>
|
2020-07-28 11:45:37 +08:00
|
|
|
</div>
|
2021-05-14 17:50:06 +08:00
|
|
|
<div class="alert-label-box">
|
2021-10-26 17:47:49 +08:00
|
|
|
<div class="alert-label-title">Endpoint</div>
|
|
|
|
|
<div class="alert-label-value">
|
|
|
|
|
<i class="nz-icon nz-icon-overview-endpoint monitorColor"></i>
|
2021-10-28 16:03:32 +08:00
|
|
|
<span>{{alertLabelData && alertLabelData.endpointNum ? alertLabelData.endpointNum : 0}}</span></div>
|
2021-05-14 17:50:06 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2020-07-28 11:45:37 +08:00
|
|
|
|
2021-05-14 17:50:06 +08:00
|
|
|
<div class="alert-label-info" v-if="type==='module'" v-loading="loading">
|
|
|
|
|
<div class="alert-label-box">
|
|
|
|
|
<div class="alert-label-title">ID</div>
|
|
|
|
|
<div class="alert-label-value">{{alertLabelData && alertLabelData.id ? alertLabelData.id : '--'}}</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="alert-label-box">
|
2021-10-27 16:49:58 +08:00
|
|
|
<div class="alert-label-title">{{$t('overall.name')}}</div>
|
2021-05-14 17:50:06 +08:00
|
|
|
<div class="alert-label-value">{{alertLabelData && alertLabelData.name ? alertLabelData.name : '--'}}</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="alert-label-box">
|
2021-10-27 16:49:58 +08:00
|
|
|
<div class="alert-label-title">{{$t('overall.project')}}</div>
|
2021-05-14 17:50:06 +08:00
|
|
|
<div class="alert-label-value">{{alertLabelData && alertLabelData.project && alertLabelData.project.name ?alertLabelData.project.name : '--'}}</div>
|
2020-07-29 09:53:46 +08:00
|
|
|
</div>
|
2021-05-14 17:50:06 +08:00
|
|
|
<div class="alert-label-box">
|
2021-10-26 17:47:49 +08:00
|
|
|
<div class="alert-label-title">Endpoint</div>
|
|
|
|
|
<div class="alert-label-value">
|
|
|
|
|
<i class="nz-icon nz-icon-overview-endpoint monitorColor"></i>
|
2021-10-28 16:03:32 +08:00
|
|
|
<span>{{alertLabelData && alertLabelData.endpointNum ? alertLabelData.endpointNum : 0}}</span></div>
|
2021-10-26 17:47:49 +08:00
|
|
|
</div>
|
|
|
|
|
<div class="alert-label-box">
|
2021-10-27 16:49:58 +08:00
|
|
|
<div class="alert-label-title">{{$t('overall.asset')}}</div>
|
2021-10-26 17:47:49 +08:00
|
|
|
<div class="alert-label-value">
|
2021-10-27 16:59:46 +08:00
|
|
|
<i class="nz-icon nz-icon-overview-project monitorColor color23BF9A"/>
|
2021-10-26 17:47:49 +08:00
|
|
|
<span>{{alertLabelData && alertLabelData.assetNum ? alertLabelData.assetNum: 0}}</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="alert-label-box">
|
2021-10-27 16:49:58 +08:00
|
|
|
<div class="alert-label-title">{{$t('overall.alert')}}</div>
|
2022-03-01 11:04:16 +08:00
|
|
|
<div class="alert-label-value" v-if="alertLabelData">
|
|
|
|
|
<i :class="alertLabelData.alertNum ? 'red' : 'green'" class="nz-icon nz-icon-overview-alert vertical-align-top;" @mouseenter="tooltipHover('',true, $event)" @mouseleave="tooltipHover('',false, $event)"></i>
|
|
|
|
|
<div v-if="alertNumtooltipShow" class="alert-days-info-tooltip" :style="{left: position.left + 'px',top:position.top + 'px'}">
|
|
|
|
|
<div class="tooltip-title">Alert message (active)</div>
|
|
|
|
|
<div class="severity-info" style='justify-content: space-between'>
|
|
|
|
|
<div class="severity-name">{{$t('overall.result.total')}}</div>
|
|
|
|
|
<div class="severity-value">{{alertLabelData.alertNum}}</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<alertDaysInfo
|
|
|
|
|
v-show="!trendLoading"
|
|
|
|
|
:alertDaysData="alertDaysData"
|
|
|
|
|
/>
|
2021-10-26 17:47:49 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2021-05-14 17:50:06 +08:00
|
|
|
<div class="alert-label-box">
|
2021-10-27 16:49:58 +08:00
|
|
|
<div class="alert-label-title">{{$t('overall.remark')}}</div>
|
2021-11-01 09:39:42 +08:00
|
|
|
<div class="alert-label-value alert-label-remark">{{alertLabelData && alertLabelData.remark ? alertLabelData.remark : '--'}}</div>
|
2021-05-14 17:50:06 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2020-07-28 11:45:37 +08:00
|
|
|
|
2021-05-14 17:50:06 +08:00
|
|
|
<div class="alert-label-info" v-if="type==='project'" v-loading="loading">
|
|
|
|
|
<div class="alert-label-box">
|
|
|
|
|
<div class="alert-label-title">ID</div>
|
|
|
|
|
<div class="alert-label-value">{{alertLabelData && alertLabelData ? alertLabelData.id : '--'}}</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="alert-label-box">
|
2021-10-27 16:49:58 +08:00
|
|
|
<div class="alert-label-title">{{$t('overall.name')}}</div>
|
2021-05-14 17:50:06 +08:00
|
|
|
<div class="alert-label-value">{{alertLabelData && alertLabelData ? alertLabelData.name : '--'}}</div>
|
2020-07-29 09:53:46 +08:00
|
|
|
</div>
|
2021-05-14 17:50:06 +08:00
|
|
|
<div class="alert-label-box">
|
2021-10-27 16:49:58 +08:00
|
|
|
<div class="alert-label-title">{{$t('overall.module')}}</div>
|
2021-10-27 10:59:54 +08:00
|
|
|
<div class="alert-label-value">
|
|
|
|
|
<i style="cursor: pointer" class="nz-icon nz-icon-overview-module monitorColor"/>
|
2022-01-14 18:04:34 +08:00
|
|
|
<span>{{alertLabelData && alertLabelData.moduleNum ? alertLabelData.moduleNum : '--'}}</span>
|
|
|
|
|
</div>
|
2021-10-27 10:59:54 +08:00
|
|
|
</div>
|
|
|
|
|
<div class="alert-label-box">
|
|
|
|
|
<div class="alert-label-title">Endpoint</div>
|
|
|
|
|
<div class="alert-label-value">
|
|
|
|
|
<i class="nz-icon nz-icon-overview-endpoint monitorColor"></i>
|
2021-10-28 16:03:32 +08:00
|
|
|
<span>{{alertLabelData && alertLabelData.endpointNum ? alertLabelData.endpointNum : 0}}</span></div>
|
2021-10-27 10:59:54 +08:00
|
|
|
</div>
|
|
|
|
|
<div class="alert-label-box">
|
2021-10-27 16:49:58 +08:00
|
|
|
<div class="alert-label-title">{{$t('overall.asset')}}</div>
|
2021-10-27 10:59:54 +08:00
|
|
|
<div class="alert-label-value">
|
2021-10-27 16:59:46 +08:00
|
|
|
<i class="nz-icon nz-icon-overview-project monitorColor color23BF9A"/>
|
2021-10-27 10:59:54 +08:00
|
|
|
<span>{{alertLabelData && alertLabelData.assetNum ? alertLabelData.assetNum: 0}}</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="alert-label-box">
|
2021-10-27 16:49:58 +08:00
|
|
|
<div class="alert-label-title">{{$t('overall.alert')}}</div>
|
2022-03-01 11:04:16 +08:00
|
|
|
<div class="alert-label-value" v-if="alertLabelData">
|
|
|
|
|
<i :class="alertLabelData.alertNum ? 'red' : 'green'" class="nz-icon nz-icon-overview-alert vertical-align-top;" @mouseenter="tooltipHover('',true, $event)" @mouseleave="tooltipHover('',false, $event)"></i>
|
|
|
|
|
<div v-if="alertNumtooltipShow" class="alert-days-info-tooltip" :style="{left: position.left + 'px',top:position.top + 'px'}">
|
|
|
|
|
<div class="tooltip-title">Alert message (active)</div>
|
|
|
|
|
<div class="severity-info" style='justify-content: space-between'>
|
|
|
|
|
<div class="severity-name">{{$t('overall.result.total')}}</div>
|
|
|
|
|
<div class="severity-value">{{alertLabelData.alertNum}}</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<alertDaysInfo
|
|
|
|
|
v-show="!trendLoading"
|
|
|
|
|
:alertDaysData="alertDaysData"
|
|
|
|
|
/>
|
2021-10-27 10:59:54 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2021-05-14 17:50:06 +08:00
|
|
|
<div class="alert-label-box">
|
2021-10-27 16:49:58 +08:00
|
|
|
<div class="alert-label-title">{{$t('overall.remark')}}</div>
|
2021-11-01 09:39:42 +08:00
|
|
|
<div class="alert-label-value alert-label-remark">{{alertLabelData && alertLabelData.remark ? alertLabelData.remark : '--'}}</div>
|
2021-05-14 17:50:06 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2020-11-17 10:00:39 +08:00
|
|
|
|
2021-05-14 17:50:06 +08:00
|
|
|
<div class="alert-label-info" v-if="type==='endpoint'" v-loading="loading">
|
|
|
|
|
<div class="alert-label-box">
|
|
|
|
|
<div class="alert-label-title">ID</div>
|
|
|
|
|
<div class="alert-label-value">{{alertLabelData && alertLabelData.id ? alertLabelData.id : '--'}}</div>
|
|
|
|
|
</div>
|
2021-07-02 10:25:55 +08:00
|
|
|
<div class="alert-label-box">
|
2021-10-27 16:49:58 +08:00
|
|
|
<div class="alert-label-title">{{$t('overall.name')}}</div>
|
2021-07-02 10:25:55 +08:00
|
|
|
<div class="alert-label-value">{{alertLabelData && alertLabelData.name ? alertLabelData.name : '--'}}</div>
|
|
|
|
|
</div>
|
2021-05-14 17:50:06 +08:00
|
|
|
<div class="alert-label-box">
|
2021-10-27 16:49:58 +08:00
|
|
|
<div class="alert-label-title">{{$t('overall.project')}}</div>
|
2021-05-14 17:50:06 +08:00
|
|
|
<div class="alert-label-value">{{alertLabelData && alertLabelData.project && alertLabelData.project.name ? alertLabelData.project.name : '--'}}</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="alert-label-box">
|
2021-10-27 16:49:58 +08:00
|
|
|
<div class="alert-label-title">{{$t('overall.module')}}</div>
|
|
|
|
|
<div class="alert-label-value">
|
|
|
|
|
<i style="cursor: pointer" class="nz-icon nz-icon-overview-module monitorColor"/>
|
|
|
|
|
<span>{{alertLabelData && alertLabelData.module && alertLabelData.module.name ? alertLabelData.module.name : '--'}}</span>
|
|
|
|
|
</div>
|
2021-05-14 17:50:06 +08:00
|
|
|
</div>
|
|
|
|
|
<div class="alert-label-box">
|
2021-10-27 16:49:58 +08:00
|
|
|
<div class="alert-label-title">{{$t('overall.asset')}}</div>
|
2021-10-26 17:47:49 +08:00
|
|
|
<div class="alert-label-value">
|
2021-10-27 16:59:46 +08:00
|
|
|
<i class="nz-icon nz-icon-overview-project monitorColor color23BF9A"></i>
|
|
|
|
|
<span>{{alertLabelData && alertLabelData.asset.name ? alertLabelData.asset.name : '--'}}</span>
|
2021-10-26 17:47:49 +08:00
|
|
|
</div>
|
2021-05-14 17:50:06 +08:00
|
|
|
</div>
|
|
|
|
|
<div class="alert-label-box">
|
2021-10-27 16:49:58 +08:00
|
|
|
<div class="alert-label-title">{{$t('overall.alert')}}</div>
|
2022-03-01 11:04:16 +08:00
|
|
|
<div class="alert-label-value" v-if="alertLabelData">
|
|
|
|
|
<i :class="alertLabelData.alertNum ? 'red' : 'green'" class="nz-icon nz-icon-overview-alert vertical-align-top;" @mouseenter="tooltipHover('',true, $event)" @mouseleave="tooltipHover('',false, $event)"></i>
|
|
|
|
|
<div v-if="alertNumtooltipShow" class="alert-days-info-tooltip" :style="{left: position.left + 'px',top:position.top + 'px'}">
|
|
|
|
|
<div class="tooltip-title">Alert message (active)</div>
|
|
|
|
|
<div class="severity-info" style='justify-content: space-between'>
|
|
|
|
|
<div class="severity-name">{{$t('overall.result.total')}}</div>
|
|
|
|
|
<div class="severity-value">{{alertLabelData.alertNum}}</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<alertDaysInfo
|
|
|
|
|
v-show="!trendLoading"
|
|
|
|
|
:alertDaysData="alertDaysData"
|
|
|
|
|
/>
|
2021-10-26 17:47:49 +08:00
|
|
|
</div>
|
2021-05-14 17:50:06 +08:00
|
|
|
</div>
|
|
|
|
|
<div class="alert-label-box">
|
2021-10-27 16:49:58 +08:00
|
|
|
<div class="alert-label-title">{{$t('overall.state')}}</div>
|
2021-10-26 18:09:39 +08:00
|
|
|
<div class="alert-label-value">
|
2021-10-26 17:47:49 +08:00
|
|
|
<span style="width: auto">
|
2021-11-01 23:05:28 +08:00
|
|
|
<span class="endpoint-cell-left"><i class="nz-icon nz-icon-Metrics active" /> {{$t('project.endpoint.metrics')}} </span>
|
2021-10-27 16:49:58 +08:00
|
|
|
<span v-if="alertLabelData && alertLabelData.configs[0].state === 0">
|
2021-10-26 17:47:49 +08:00
|
|
|
<span class="active-icon red-bg inline-block"></span>
|
|
|
|
|
</span>
|
|
|
|
|
<span v-else-if="alertLabelData && alertLabelData.configs[0].state === 1">
|
|
|
|
|
<span class="active-icon green-bg inline-block"></span>
|
|
|
|
|
</span>
|
|
|
|
|
<span v-else-if="alertLabelData && alertLabelData.configs[0].state">
|
|
|
|
|
<span class="active-icon gray-bg inline-block"></span>
|
|
|
|
|
</span>
|
|
|
|
|
</span>
|
|
|
|
|
<span style="width: auto">
|
2021-11-01 23:05:28 +08:00
|
|
|
<span class="endpoint-cell-left" style="margin-left: 10px"><i class="nz-icon nz-icon-logs active" /> {{$t('project.endpoint.logs')}} </span>
|
2021-10-27 16:49:58 +08:00
|
|
|
<span v-if="alertLabelData && alertLabelData.configs[1].state === 0">
|
2021-10-26 17:47:49 +08:00
|
|
|
<span class="active-icon red-bg inline-block"></span>
|
|
|
|
|
</span>
|
|
|
|
|
<span v-else-if="alertLabelData && alertLabelData.configs[1].state === 1">
|
|
|
|
|
<span class="active-icon green-bg inline-block"></span>
|
|
|
|
|
</span>
|
|
|
|
|
<span v-else-if="alertLabelData && alertLabelData.configs[1].state">
|
|
|
|
|
<span class="active-icon gray-bg inline-block"></span>
|
|
|
|
|
</span>
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
2021-05-14 17:50:06 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2021-09-14 14:19:38 +08:00
|
|
|
|
2021-09-14 15:36:55 +08:00
|
|
|
<div class="alert-label-info" v-if="type==='dc'" v-loading="loading">
|
2021-09-14 14:19:38 +08:00
|
|
|
<div class="alert-label-box">
|
|
|
|
|
<div class="alert-label-title">ID</div>
|
|
|
|
|
<div class="alert-label-value">{{alertLabelData && alertLabelData.id ? alertLabelData.id : '--'}}</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="alert-label-box">
|
2021-10-27 16:49:58 +08:00
|
|
|
<div class="alert-label-title">{{$t('overall.name')}}</div>
|
2021-09-14 14:19:38 +08:00
|
|
|
<div class="alert-label-value">{{alertLabelData && alertLabelData.name ? alertLabelData.name : '--'}}</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="alert-label-box">
|
2021-10-27 16:49:58 +08:00
|
|
|
<div class="alert-label-title">{{$t('overall.location')}}</div>
|
2021-09-14 14:19:38 +08:00
|
|
|
<div class="alert-label-value">{{alertLabelData && alertLabelData.location && alertLabelData.location ? alertLabelData.location : '--'}}</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="alert-label-box">
|
2021-10-27 16:49:58 +08:00
|
|
|
<div class="alert-label-title">{{$t('overall.cabinet')}}</div>
|
2021-10-26 17:47:49 +08:00
|
|
|
<div class="alert-label-value">
|
2021-10-29 12:01:35 +08:00
|
|
|
<i v-if="alertLabelData" class="nz-icon nz-icon-cabinet monitorColor" :class="alertLabelData && alertLabelData.cabinetNum> 0 ? 'color23BF9A' : 'colorEF7458'"/>
|
|
|
|
|
<span>{{alertLabelData && alertLabelData.cabinetNum ? alertLabelData.cabinetNum : 0}}</span></div>
|
2021-09-14 14:19:38 +08:00
|
|
|
</div>
|
|
|
|
|
<div class="alert-label-box">
|
2021-10-27 16:49:58 +08:00
|
|
|
<div class="alert-label-title">{{$t('overall.asset')}}</div>
|
2021-10-26 17:47:49 +08:00
|
|
|
<div class="alert-label-value">
|
2021-10-27 16:59:46 +08:00
|
|
|
<i class="nz-icon nz-icon-overview-project monitorColor color23BF9A"/>
|
2021-10-28 16:03:32 +08:00
|
|
|
<span>{{alertLabelData && alertLabelData.assetNum && alertLabelData.assetNum ? alertLabelData.assetNum: 0}}</span>
|
2021-10-27 16:49:58 +08:00
|
|
|
</div>
|
2021-09-14 14:19:38 +08:00
|
|
|
</div>
|
|
|
|
|
<div class="alert-label-box">
|
2021-10-27 16:49:58 +08:00
|
|
|
<div class="alert-label-title">{{$t('overall.alert')}}</div>
|
2022-03-01 11:04:16 +08:00
|
|
|
<div class="alert-label-value" v-if="alertLabelData">
|
|
|
|
|
<i :class="alertLabelData.alertNum ? 'red' : 'green'" class="nz-icon nz-icon-overview-alert vertical-align-top;" @mouseenter="tooltipHover('',true, $event)" @mouseleave="tooltipHover('',false, $event)"></i>
|
|
|
|
|
<div v-if="alertNumtooltipShow" class="alert-days-info-tooltip" :style="{left: position.left + 'px',top:position.top + 'px'}">
|
|
|
|
|
<div class="tooltip-title">Alert message (active)</div>
|
|
|
|
|
<div class="severity-info" style='justify-content: space-between'>
|
|
|
|
|
<div class="severity-name">{{$t('overall.result.total')}}</div>
|
|
|
|
|
<div class="severity-value">{{alertLabelData.alertNum}}</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<alertDaysInfo
|
|
|
|
|
v-show="!trendLoading"
|
|
|
|
|
:alertDaysData="alertDaysData"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
2021-09-14 14:19:38 +08:00
|
|
|
</div>
|
|
|
|
|
<div class="alert-label-box">
|
2021-10-27 16:49:58 +08:00
|
|
|
<div class="alert-label-title">{{$t('overall.state')}}</div>
|
2021-10-26 17:47:49 +08:00
|
|
|
<div class="alert-label-value" style="margin-left: 3px">
|
|
|
|
|
<div v-if="alertLabelData" :class="{'green-bg': alertLabelData && alertLabelData.state === 'ON','red-bg': alertLabelData && alertLabelData.state === 'OFF'}" class="active-icon"></div>
|
|
|
|
|
<span v-if="alertLabelData && alertLabelData.state === 'ON'">{{ $t('overall.enabled') }}</span>
|
|
|
|
|
<span v-if="alertLabelData && alertLabelData.state === 'OFF'">{{ $t('overall.disabled') }}</span>
|
2021-09-14 14:19:38 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
2020-09-28 16:27:03 +08:00
|
|
|
</div>
|
2020-07-27 18:26:44 +08:00
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
2022-03-01 11:04:16 +08:00
|
|
|
import trendMixin from './trendMixins'
|
2021-03-19 18:52:19 +08:00
|
|
|
export default {
|
|
|
|
|
name: 'alertLabel',
|
2022-03-01 11:04:16 +08:00
|
|
|
mixins: [trendMixin],
|
2021-03-19 18:52:19 +08:00
|
|
|
props: {
|
|
|
|
|
id: {},
|
|
|
|
|
type: {},
|
|
|
|
|
// labelLoading:{},
|
2021-10-26 17:47:49 +08:00
|
|
|
that: {},
|
2021-11-02 10:17:26 +08:00
|
|
|
detailList: Boolean,
|
|
|
|
|
alertTableDialog: Boolean
|
2021-03-19 18:52:19 +08:00
|
|
|
},
|
|
|
|
|
data () {
|
|
|
|
|
return {
|
|
|
|
|
alertLabelData: null,
|
2021-11-02 16:07:50 +08:00
|
|
|
loading: true,
|
2022-03-07 09:37:27 +08:00
|
|
|
heightList: 0
|
2021-03-19 18:52:19 +08:00
|
|
|
}
|
2021-05-14 17:50:06 +08:00
|
|
|
},
|
|
|
|
|
watch: {
|
|
|
|
|
id: {
|
|
|
|
|
immediate: true,
|
|
|
|
|
deep: true,
|
|
|
|
|
handler (n) {
|
|
|
|
|
this.init()
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
that: {
|
|
|
|
|
immediate: true,
|
|
|
|
|
deep: true,
|
|
|
|
|
handler (n) {
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
LRTriangle: {
|
|
|
|
|
immediate: true,
|
|
|
|
|
deep: true,
|
|
|
|
|
handler (n) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-03-19 18:52:19 +08:00
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
|
calcPosition () {
|
|
|
|
|
return function (position) {
|
|
|
|
|
const clientHeight = (document.body.clientHeight < document.documentElement.clientHeight) ? document.body.clientHeight : document.documentElement.clientHeight
|
2021-10-26 17:47:49 +08:00
|
|
|
const leftOffSetView = this.detailList ? -80 : 10
|
|
|
|
|
const leftOffSet = this.detailList ? -80 : 10
|
2021-11-02 16:07:50 +08:00
|
|
|
const topOffSet = this.detailList ? 60 : 22
|
2021-12-31 10:15:36 +08:00
|
|
|
if (position.top > clientHeight / 2) {
|
2021-03-19 18:52:19 +08:00
|
|
|
return {
|
2021-10-26 17:47:49 +08:00
|
|
|
left: `${position.left + position.width + leftOffSet}px`,
|
2021-11-02 16:07:50 +08:00
|
|
|
top: `${position.top - this.heightList + topOffSet}px`
|
2021-03-19 18:52:19 +08:00
|
|
|
}
|
2021-11-02 10:17:26 +08:00
|
|
|
} else if (this.alertTableDialog) {
|
|
|
|
|
const dialog = document.querySelector('#dialog-alert-massage .el-dialog')
|
|
|
|
|
const dialogHeight = dialog.getBoundingClientRect()
|
|
|
|
|
if (dialogHeight) {
|
|
|
|
|
return {
|
|
|
|
|
left: `${position.left + position.width + 10 - dialogHeight.x}px`,
|
|
|
|
|
top: `${position.top - dialogHeight.y}px`
|
|
|
|
|
}
|
2021-03-19 18:52:19 +08:00
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
return {
|
2021-10-26 17:47:49 +08:00
|
|
|
left: `${position.left + position.width + leftOffSetView}px`,
|
2021-11-02 16:07:50 +08:00
|
|
|
top: `${position.top}px`
|
2020-09-28 16:27:03 +08:00
|
|
|
}
|
2020-10-15 18:20:32 +08:00
|
|
|
}
|
2020-09-28 16:27:03 +08:00
|
|
|
}
|
|
|
|
|
},
|
2021-03-19 18:52:19 +08:00
|
|
|
calcHeight () {
|
|
|
|
|
const self = this
|
|
|
|
|
return function (position) {
|
|
|
|
|
const clientHeight = (document.body.clientHeight < document.documentElement.clientHeight) ? document.body.clientHeight : document.documentElement.clientHeight
|
|
|
|
|
const elHeight = self.type === 'asset' ? 318 : (self.type === 'project' ? 70 : 70)
|
|
|
|
|
if (position.top + elHeight > clientHeight) {
|
|
|
|
|
return 'alert-labelUp'
|
2020-07-28 11:45:37 +08:00
|
|
|
} else {
|
2021-03-19 18:52:19 +08:00
|
|
|
return 'alert-label'
|
2020-07-28 11:45:37 +08:00
|
|
|
}
|
2020-11-17 10:00:39 +08:00
|
|
|
}
|
2021-03-19 18:52:19 +08:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
2021-05-14 17:50:06 +08:00
|
|
|
init () {
|
|
|
|
|
this.loading = true
|
|
|
|
|
if (this.type === 'asset') {
|
|
|
|
|
this.$get('asset/asset/' + this.id).then((res) => {
|
|
|
|
|
if (res.msg === 'success') {
|
|
|
|
|
this.loading = false
|
|
|
|
|
this.alertLabelData = res.data
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(res.msg)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
if (this.type === 'project') {
|
|
|
|
|
this.$get('monitor/project/' + this.id).then((res) => {
|
|
|
|
|
if (res.msg === 'success') {
|
|
|
|
|
this.loading = false
|
|
|
|
|
this.alertLabelData = res.data
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(res.msg)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
if (this.type === 'module') {
|
|
|
|
|
this.$get('monitor/module/' + this.id).then((res) => {
|
|
|
|
|
if (res.msg === 'success') {
|
|
|
|
|
this.loading = false
|
|
|
|
|
this.alertLabelData = res.data
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(res.msg)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
if (this.type === 'endpoint') {
|
|
|
|
|
this.$get('monitor/endpoint/' + this.id).then((res) => {
|
|
|
|
|
if (res.msg === 'success') {
|
|
|
|
|
this.loading = false
|
|
|
|
|
this.alertLabelData = res.data
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(res.msg)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
2021-09-14 15:36:55 +08:00
|
|
|
if (this.type === 'dc') {
|
2021-09-14 14:19:38 +08:00
|
|
|
this.$get('dc/' + this.id).then((res) => {
|
|
|
|
|
if (res.msg === 'success') {
|
|
|
|
|
this.loading = false
|
|
|
|
|
this.alertLabelData = res.data
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(res.msg)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
2022-03-01 11:04:16 +08:00
|
|
|
const weekDays = this.getWeeksTime()
|
|
|
|
|
if (this.trendTimer) {
|
|
|
|
|
clearTimeout(this.trendTimer)
|
|
|
|
|
this.trendTimer = null
|
|
|
|
|
}
|
|
|
|
|
this.trendTimer = setTimeout(() => {
|
|
|
|
|
this.trendLoading = true
|
|
|
|
|
const params = {
|
|
|
|
|
type: 'total',
|
|
|
|
|
dimension: 'priority',
|
|
|
|
|
step: 'd'
|
|
|
|
|
}
|
|
|
|
|
params[this.type + 'Id'] = this.id
|
|
|
|
|
this.$get('/stat/alertMessage/trend', params).then((res) => {
|
|
|
|
|
const alertDaysData = res.data.result ? res.data.result[0].values : []
|
|
|
|
|
const newWeekDays = JSON.parse(JSON.stringify(weekDays))
|
|
|
|
|
alertDaysData.forEach(item => {
|
|
|
|
|
item.values.forEach(time => {
|
|
|
|
|
const findItem = newWeekDays.find(days => days.time == time[0])
|
|
|
|
|
if (findItem) {
|
|
|
|
|
findItem[item.metric.priority] = time[1]
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.alertDaysData = newWeekDays
|
|
|
|
|
this.trendLoading = false
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
})
|
2021-05-14 17:50:06 +08:00
|
|
|
},
|
2021-03-19 18:52:19 +08:00
|
|
|
alertActiveStr () {
|
|
|
|
|
return this.$t('overall.active')
|
2020-07-27 18:26:44 +08:00
|
|
|
},
|
2021-03-19 18:52:19 +08:00
|
|
|
alertStateStr (num) {
|
|
|
|
|
if (num == 1) {
|
|
|
|
|
return this.$t('asset.inStock')
|
|
|
|
|
} else {
|
|
|
|
|
return this.$t('asset.notInStock')
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
2021-11-02 16:07:50 +08:00
|
|
|
mounted () {
|
2022-03-01 11:04:16 +08:00
|
|
|
if (this.$refs.alertLabels) {
|
|
|
|
|
this.heightList = this.$refs.alertLabels.getBoundingClientRect().height
|
|
|
|
|
} else {
|
|
|
|
|
this.heightList = ''
|
|
|
|
|
}
|
2021-11-02 16:07:50 +08:00
|
|
|
},
|
2021-03-19 18:52:19 +08:00
|
|
|
beforeDestroy () {
|
|
|
|
|
|
2020-07-27 18:26:44 +08:00
|
|
|
}
|
2021-03-19 18:52:19 +08:00
|
|
|
}
|
2020-07-27 18:26:44 +08:00
|
|
|
|
|
|
|
|
</script>
|