2020-07-27 18:26:44 +08:00
|
|
|
<template>
|
2022-04-20 17:16:07 +08:00
|
|
|
<div
|
|
|
|
|
:class="calcHeight(that.position, that)"
|
|
|
|
|
:style="calcPosition(that.position, that)"
|
|
|
|
|
class="alert-label__border"
|
|
|
|
|
ref="alertLabels"
|
|
|
|
|
>
|
2022-06-20 15:37:09 +08:00
|
|
|
<!-- user info -->
|
|
|
|
|
<template v-if="type === 'user'">
|
|
|
|
|
<div class="alert-label-header-title">
|
|
|
|
|
<div
|
|
|
|
|
class="alert-label-header-circle"
|
|
|
|
|
:style="alertLabelData.online === 1 ? `background: ${userColor}` : `background: ${unUserColor}`"
|
|
|
|
|
>
|
|
|
|
|
<i class="nz-icon-user1 nz-icon user-online" :class="selectIcon(type)"></i>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="alert-label-header-name">
|
|
|
|
|
{{ alertLabelData && alertLabelData.name ? alertLabelData.name : "--" }}
|
|
|
|
|
</div>
|
|
|
|
|
<div class="flex-align-center">
|
|
|
|
|
<el-tag class="alert-label-fa" size="mini" v-if="alertLabelData.mfaLevel > 0" style="margin-left: 5px">2FA</el-tag>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-else>
|
2022-04-06 14:54:03 +08:00
|
|
|
<div class="alert-label-header-title">
|
2022-04-20 17:16:07 +08:00
|
|
|
<div
|
|
|
|
|
class="alert-label-header-circle"
|
|
|
|
|
:style="`background: ${alertColor}`"
|
|
|
|
|
>
|
|
|
|
|
<i class="nz-icon" :class="selectIcon(type)"></i>
|
2022-04-06 14:54:03 +08:00
|
|
|
</div>
|
|
|
|
|
<div class="alert-label-header-name">
|
2022-04-20 17:16:07 +08:00
|
|
|
{{ alertLabelData && alertLabelData.name ? alertLabelData.name : "--" }}
|
2022-04-06 14:54:03 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2022-06-20 15:37:09 +08:00
|
|
|
</template>
|
2022-04-20 17:16:07 +08:00
|
|
|
<div
|
|
|
|
|
class="alert-label-info"
|
|
|
|
|
v-if="type === 'asset'"
|
|
|
|
|
v-my-loading="loading"
|
|
|
|
|
>
|
2021-05-14 17:50:06 +08:00
|
|
|
<div class="alert-label-box">
|
|
|
|
|
<div class="alert-label-title">ID</div>
|
2022-04-20 17:16:07 +08:00
|
|
|
<div class="alert-label-value">
|
|
|
|
|
{{ alertLabelData && alertLabelData.id ? alertLabelData.id : "--" }}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2022-04-24 13:59:02 +08:00
|
|
|
<div class="alert-label-box name-labe">
|
2022-04-24 13:49:34 +08:00
|
|
|
<div class="alert-label-title">{{$t('overall.name')}}</div>
|
|
|
|
|
<div class="alert-label-value">{{alertLabelData && alertLabelData.name ? alertLabelData.name : '--'}}</div>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- <div class="alert-label-box name-labe">
|
2022-04-20 17:16:07 +08:00
|
|
|
<div class="alert-label-title">Name</div>
|
|
|
|
|
<div class="alert-label-value">
|
|
|
|
|
{{ alertLabelData && alertLabelData.name ? alertLabelData.name : "--" }}
|
|
|
|
|
</div>
|
2022-04-24 13:49:34 +08:00
|
|
|
</div> -->
|
2021-05-14 17:50:06 +08:00
|
|
|
<div class="alert-label-box">
|
2022-04-20 17:16:07 +08:00
|
|
|
<div class="alert-label-title">{{ $t("overall.manageIp") }}</div>
|
|
|
|
|
<div class="alert-label-value">
|
|
|
|
|
{{
|
|
|
|
|
alertLabelData && alertLabelData.manageIp
|
|
|
|
|
? alertLabelData.manageIp
|
|
|
|
|
: "--"
|
|
|
|
|
}}
|
|
|
|
|
</div>
|
2021-05-14 17:50:06 +08:00
|
|
|
</div>
|
|
|
|
|
<div class="alert-label-box">
|
2022-04-20 17:16:07 +08:00
|
|
|
<div class="alert-label-title">{{ $t("overall.type") }}</div>
|
|
|
|
|
<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">
|
2022-04-20 17:16:07 +08:00
|
|
|
<div class="alert-label-title">{{ $t("overall.state") }}</div>
|
|
|
|
|
<div class="alert-label-value">
|
|
|
|
|
{{
|
|
|
|
|
alertLabelData && alertLabelData.state && alertLabelData.state.name
|
|
|
|
|
? alertLabelData.state.name
|
|
|
|
|
: "--"
|
|
|
|
|
}}
|
|
|
|
|
</div>
|
2021-05-14 17:50:06 +08:00
|
|
|
</div>
|
|
|
|
|
<div class="alert-label-box">
|
|
|
|
|
<div class="alert-label-title">Ping</div>
|
|
|
|
|
<div class="alert-label-value">
|
2022-04-20 17:16:07 +08:00
|
|
|
<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>
|
|
|
|
|
<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">
|
2022-04-20 17:16:07 +08:00
|
|
|
<div class="alert-label-title">{{ $t("overall.dc") }}</div>
|
|
|
|
|
<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">
|
2022-04-20 17:16:07 +08:00
|
|
|
<div class="alert-label-title">{{ $t("overall.cabinet") }}</div>
|
|
|
|
|
<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">
|
2022-04-20 17:16:07 +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">
|
2022-04-20 17:16:07 +08:00
|
|
|
<div class="alert-label-title">{{ $t("overall.model") }}</div>
|
|
|
|
|
<div class="alert-label-value">
|
|
|
|
|
{{
|
|
|
|
|
alertLabelData && alertLabelData.model && alertLabelData.model.name
|
|
|
|
|
? alertLabelData.model.name
|
|
|
|
|
: "--"
|
|
|
|
|
}}
|
|
|
|
|
</div>
|
2021-05-14 17:50:06 +08:00
|
|
|
</div>
|
|
|
|
|
<div class="alert-label-box">
|
2022-04-20 17:16:07 +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">
|
2022-04-20 17:16:07 +08:00
|
|
|
<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">
|
|
|
|
|
{{ $t("project.topology.alert") }}({{ $t("asset.pingActive") }})
|
|
|
|
|
</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>
|
2022-03-01 11:04:16 +08:00
|
|
|
</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">
|
2022-04-20 17:16:07 +08:00
|
|
|
<div class="alert-label-title">{{ $t("asset.endpoint") }}</div>
|
2021-10-26 17:47:49 +08:00
|
|
|
<div class="alert-label-value">
|
|
|
|
|
<i class="nz-icon nz-icon-overview-endpoint monitorColor"></i>
|
2022-04-20 17:16:07 +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
|
|
|
|
2022-04-20 17:16:07 +08:00
|
|
|
<div
|
|
|
|
|
class="alert-label-info"
|
|
|
|
|
v-if="type === 'module'"
|
|
|
|
|
v-my-loading="loading"
|
|
|
|
|
>
|
2021-05-14 17:50:06 +08:00
|
|
|
<div class="alert-label-box">
|
|
|
|
|
<div class="alert-label-title">ID</div>
|
2022-04-20 17:16:07 +08:00
|
|
|
<div class="alert-label-value">
|
|
|
|
|
{{ alertLabelData && alertLabelData.id ? alertLabelData.id : "--" }}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="alert-label-box name-labe">
|
2022-04-24 13:49:34 +08:00
|
|
|
<div class="alert-label-title">{{$t('overall.name')}}</div>
|
2022-04-20 17:16:07 +08:00
|
|
|
<div class="alert-label-value">
|
|
|
|
|
{{ alertLabelData && alertLabelData.Name ? alertLabelData.Name : "--" }}
|
|
|
|
|
</div>
|
2021-05-14 17:50:06 +08:00
|
|
|
</div>
|
|
|
|
|
<div class="alert-label-box">
|
2022-04-20 17:16:07 +08:00
|
|
|
<div class="alert-label-title">{{ $t("overall.project") }}</div>
|
|
|
|
|
<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">
|
2022-04-20 17:16:07 +08:00
|
|
|
<div class="alert-label-title">{{ $t("asset.endpoint") }}</div>
|
2021-10-26 17:47:49 +08:00
|
|
|
<div class="alert-label-value">
|
|
|
|
|
<i class="nz-icon nz-icon-overview-endpoint monitorColor"></i>
|
2022-04-20 17:16:07 +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">
|
2022-04-20 17:16:07 +08:00
|
|
|
<div class="alert-label-title">{{ $t("overall.asset") }}</div>
|
2021-10-26 17:47:49 +08:00
|
|
|
<div class="alert-label-value">
|
2022-04-20 17:16:07 +08:00
|
|
|
<i
|
|
|
|
|
class="nz-icon nz-icon-overview-project monitorColor color23BF9A"
|
|
|
|
|
/>
|
|
|
|
|
<span>{{
|
|
|
|
|
alertLabelData && alertLabelData.assetNum
|
|
|
|
|
? alertLabelData.assetNum
|
|
|
|
|
: 0
|
|
|
|
|
}}</span>
|
2021-10-26 17:47:49 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="alert-label-box">
|
2022-04-20 17:16:07 +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">
|
2022-04-20 17:16:07 +08:00
|
|
|
<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">
|
|
|
|
|
{{ $t("project.topology.alert") }}({{ $t("asset.pingActive") }})
|
|
|
|
|
</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>
|
2022-03-01 11:04:16 +08:00
|
|
|
</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">
|
2022-04-20 17:16:07 +08:00
|
|
|
<div class="alert-label-title">{{ $t("overall.remark") }}</div>
|
|
|
|
|
<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
|
|
|
|
2022-04-20 17:16:07 +08:00
|
|
|
<div
|
|
|
|
|
class="alert-label-info"
|
|
|
|
|
v-if="type === 'project'"
|
|
|
|
|
v-my-loading="loading"
|
|
|
|
|
>
|
2021-05-14 17:50:06 +08:00
|
|
|
<div class="alert-label-box">
|
|
|
|
|
<div class="alert-label-title">ID</div>
|
2022-04-20 17:16:07 +08:00
|
|
|
<div class="alert-label-value">
|
|
|
|
|
{{ alertLabelData && alertLabelData ? alertLabelData.id : "--" }}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="alert-label-box name-labe">
|
2022-04-24 13:49:34 +08:00
|
|
|
<div class="alert-label-title">{{$t('overall.name')}}</div>
|
2022-04-20 17:16:07 +08:00
|
|
|
<div class="alert-label-value">
|
|
|
|
|
{{ alertLabelData && alertLabelData.name ? alertLabelData.name : "--" }}
|
|
|
|
|
</div>
|
2021-05-14 17:50:06 +08:00
|
|
|
</div>
|
|
|
|
|
<div class="alert-label-box">
|
2022-04-20 17:16:07 +08:00
|
|
|
<div class="alert-label-title">{{ $t("overall.module") }}</div>
|
2021-10-27 10:59:54 +08:00
|
|
|
<div class="alert-label-value">
|
2022-04-20 17:16:07 +08:00
|
|
|
<i
|
|
|
|
|
style="cursor: pointer"
|
|
|
|
|
class="nz-icon nz-icon-overview-module monitorColor"
|
|
|
|
|
/>
|
|
|
|
|
<span>{{
|
|
|
|
|
alertLabelData && alertLabelData.moduleNum
|
|
|
|
|
? alertLabelData.moduleNum
|
|
|
|
|
: "--"
|
|
|
|
|
}}</span>
|
2022-01-14 18:04:34 +08:00
|
|
|
</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>
|
2022-04-20 17:16:07 +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">
|
2022-04-20 17:16:07 +08:00
|
|
|
<div class="alert-label-title">{{ $t("overall.asset") }}</div>
|
2021-10-27 10:59:54 +08:00
|
|
|
<div class="alert-label-value">
|
2022-04-20 17:16:07 +08:00
|
|
|
<i
|
|
|
|
|
class="nz-icon nz-icon-overview-project monitorColor color23BF9A"
|
|
|
|
|
/>
|
|
|
|
|
<span>{{
|
|
|
|
|
alertLabelData && alertLabelData.assetNum
|
|
|
|
|
? alertLabelData.assetNum
|
|
|
|
|
: 0
|
|
|
|
|
}}</span>
|
2021-10-27 10:59:54 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="alert-label-box">
|
2022-04-20 17:16:07 +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">
|
2022-04-20 17:16:07 +08:00
|
|
|
<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">
|
|
|
|
|
{{ $t("project.topology.alert") }}({{ $t("asset.pingActive") }})
|
|
|
|
|
</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>
|
2022-03-01 11:04:16 +08:00
|
|
|
</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">
|
2022-04-20 17:16:07 +08:00
|
|
|
<div class="alert-label-title">{{ $t("overall.remark") }}</div>
|
|
|
|
|
<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
|
|
|
|
2022-04-20 17:16:07 +08:00
|
|
|
<div
|
|
|
|
|
class="alert-label-info"
|
|
|
|
|
v-if="type === 'endpoint'"
|
|
|
|
|
v-my-loading="loading"
|
|
|
|
|
>
|
2021-05-14 17:50:06 +08:00
|
|
|
<div class="alert-label-box">
|
|
|
|
|
<div class="alert-label-title">ID</div>
|
2022-04-20 17:16:07 +08:00
|
|
|
<div class="alert-label-value">
|
|
|
|
|
{{ alertLabelData && alertLabelData.id ? alertLabelData.id : "--" }}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="alert-label-box name-labe">
|
2022-04-24 13:49:34 +08:00
|
|
|
<div class="alert-label-title">{{$t('overall.name')}}</div>
|
2022-04-20 17:16:07 +08:00
|
|
|
<div class="alert-label-value">
|
|
|
|
|
{{ alertLabelData && alertLabelData.name ? alertLabelData.name : "--" }}
|
|
|
|
|
</div>
|
2021-05-14 17:50:06 +08:00
|
|
|
</div>
|
|
|
|
|
<div class="alert-label-box">
|
2022-04-20 17:16:07 +08:00
|
|
|
<div class="alert-label-title">{{ $t("overall.project") }}</div>
|
|
|
|
|
<div class="alert-label-value">
|
|
|
|
|
{{
|
|
|
|
|
alertLabelData &&
|
|
|
|
|
alertLabelData.project &&
|
|
|
|
|
alertLabelData.project.name
|
|
|
|
|
? alertLabelData.project.name
|
|
|
|
|
: "--"
|
|
|
|
|
}}
|
|
|
|
|
</div>
|
2021-05-14 17:50:06 +08:00
|
|
|
</div>
|
|
|
|
|
<div class="alert-label-box">
|
2022-04-20 17:16:07 +08:00
|
|
|
<div class="alert-label-title">{{ $t("overall.module") }}</div>
|
2021-10-27 16:49:58 +08:00
|
|
|
<div class="alert-label-value">
|
2022-04-20 17:16:07 +08:00
|
|
|
<i
|
|
|
|
|
style="cursor: pointer"
|
|
|
|
|
class="nz-icon nz-icon-overview-module monitorColor"
|
|
|
|
|
/>
|
|
|
|
|
<span>{{
|
|
|
|
|
alertLabelData &&
|
|
|
|
|
alertLabelData.module &&
|
|
|
|
|
alertLabelData.module.name
|
|
|
|
|
? alertLabelData.module.name
|
|
|
|
|
: "--"
|
|
|
|
|
}}</span>
|
2021-10-27 16:49:58 +08:00
|
|
|
</div>
|
2021-05-14 17:50:06 +08:00
|
|
|
</div>
|
|
|
|
|
<div class="alert-label-box">
|
2022-04-20 17:16:07 +08:00
|
|
|
<div class="alert-label-title">{{ $t("overall.asset") }}</div>
|
2021-10-26 17:47:49 +08:00
|
|
|
<div class="alert-label-value">
|
2022-04-20 17:16:07 +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">
|
2022-04-20 17:16:07 +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">
|
2022-04-20 17:16:07 +08:00
|
|
|
<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">
|
|
|
|
|
{{ $t("project.topology.alert") }}({{ $t("asset.pingActive") }})
|
|
|
|
|
</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>
|
2022-03-01 11:04:16 +08:00
|
|
|
</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">
|
2022-04-20 17:16:07 +08:00
|
|
|
<div class="alert-label-title">{{ $t("overall.state") }}</div>
|
2021-10-26 18:09:39 +08:00
|
|
|
<div class="alert-label-value">
|
2022-04-20 17:16:07 +08:00
|
|
|
<span style="width: auto">
|
|
|
|
|
<span class="endpoint-cell-left"
|
|
|
|
|
><i class="nz-icon nz-icon-Metrics active" />
|
|
|
|
|
{{ $t("project.endpoint.metrics") }}
|
|
|
|
|
</span>
|
|
|
|
|
<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>
|
2022-04-20 17:16:07 +08:00
|
|
|
<span
|
|
|
|
|
v-else-if="
|
|
|
|
|
alertLabelData && alertLabelData.configs[0].state === 1
|
|
|
|
|
"
|
|
|
|
|
>
|
2021-10-26 17:47:49 +08:00
|
|
|
<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">
|
2022-04-20 17:16:07 +08:00
|
|
|
<span class="endpoint-cell-left" style="margin-left: 10px"
|
|
|
|
|
><i class="nz-icon nz-icon-logs active" />
|
|
|
|
|
{{ $t("project.endpoint.logs") }}
|
|
|
|
|
</span>
|
|
|
|
|
<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>
|
2022-04-20 17:16:07 +08:00
|
|
|
<span
|
|
|
|
|
v-else-if="
|
|
|
|
|
alertLabelData && alertLabelData.configs[1].state === 1
|
|
|
|
|
"
|
|
|
|
|
>
|
2021-10-26 17:47:49 +08:00
|
|
|
<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
|
|
|
|
2022-04-20 17:16:07 +08:00
|
|
|
<div class="alert-label-info" v-if="type === 'dc'" v-my-loading="loading">
|
2021-09-14 14:19:38 +08:00
|
|
|
<div class="alert-label-box">
|
|
|
|
|
<div class="alert-label-title">ID</div>
|
2022-04-20 17:16:07 +08:00
|
|
|
<div class="alert-label-value">
|
|
|
|
|
{{ alertLabelData && alertLabelData.id ? alertLabelData.id : "--" }}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="alert-label-box name-labe">
|
2022-04-24 13:49:34 +08:00
|
|
|
<div class="alert-label-title">{{$t('overall.name')}}</div>
|
2022-04-20 17:16:07 +08:00
|
|
|
<div class="alert-label-value">
|
|
|
|
|
{{ alertLabelData && alertLabelData.name ? alertLabelData.name : "--" }}
|
|
|
|
|
</div>
|
2021-09-14 14:19:38 +08:00
|
|
|
</div>
|
|
|
|
|
<div class="alert-label-box">
|
2022-04-20 17:16:07 +08:00
|
|
|
<div class="alert-label-title">{{ $t("overall.location") }}</div>
|
|
|
|
|
<div class="alert-label-value">
|
|
|
|
|
{{
|
|
|
|
|
alertLabelData && alertLabelData.location && alertLabelData.location
|
|
|
|
|
? alertLabelData.location
|
|
|
|
|
: "--"
|
|
|
|
|
}}
|
|
|
|
|
</div>
|
2021-09-14 14:19:38 +08:00
|
|
|
</div>
|
|
|
|
|
<div class="alert-label-box">
|
2022-04-20 17:16:07 +08:00
|
|
|
<div class="alert-label-title">{{ $t("overall.cabinet") }}</div>
|
2021-10-26 17:47:49 +08:00
|
|
|
<div class="alert-label-value">
|
2022-04-20 17:16:07 +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">
|
2022-04-20 17:16:07 +08:00
|
|
|
<div class="alert-label-title">{{ $t("overall.asset") }}</div>
|
2021-10-26 17:47:49 +08:00
|
|
|
<div class="alert-label-value">
|
2022-04-20 17:16:07 +08:00
|
|
|
<i
|
|
|
|
|
class="nz-icon nz-icon-overview-project monitorColor color23BF9A"
|
|
|
|
|
/>
|
|
|
|
|
<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">
|
2022-04-20 17:16:07 +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">
|
2022-04-20 17:16:07 +08:00
|
|
|
<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">
|
|
|
|
|
{{ $t("project.topology.alert") }}({{ $t("asset.pingActive") }})
|
|
|
|
|
</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>
|
2022-03-01 11:04:16 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<alertDaysInfo
|
|
|
|
|
v-show="!trendLoading"
|
|
|
|
|
:alertDaysData="alertDaysData"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
2021-09-14 14:19:38 +08:00
|
|
|
</div>
|
|
|
|
|
<div class="alert-label-box">
|
2022-04-20 17:16:07 +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">
|
2022-04-20 17:16:07 +08:00
|
|
|
<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>
|
2022-06-20 15:37:09 +08:00
|
|
|
|
|
|
|
|
<!-- type === 'user' -->
|
|
|
|
|
<div class="alert-label-info" v-if="type === 'user'" v-my-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 name-labe">
|
|
|
|
|
<div class="alert-label-title">{{$t('overall.name')}}</div>
|
|
|
|
|
<div class="alert-label-value">
|
|
|
|
|
{{ alertLabelData && alertLabelData.name ? alertLabelData.name : "--" }}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="alert-label-box">
|
|
|
|
|
<div class="alert-label-title">{{ $t("overall.login.name") }}</div>
|
|
|
|
|
<div class="alert-label-value">
|
|
|
|
|
{{ alertLabelData && alertLabelData.username ? alertLabelData.username : "--" }}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="alert-label-box">
|
|
|
|
|
<div class="alert-label-title">{{ $t("profile.role") }}</div>
|
|
|
|
|
<div class="alert-label-value">
|
|
|
|
|
{{ alertLabelData && alertLabelData.roles ? alertLabelData.roles[0].name : "--" }}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="alert-label-box">
|
|
|
|
|
<div class="alert-label-title">{{ $t("profile.email") }}</div>
|
|
|
|
|
<div class="alert-label-value">
|
|
|
|
|
{{ alertLabelData && alertLabelData.email ? alertLabelData.email : "--" }}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="alert-label-box">
|
|
|
|
|
<div class="alert-label-title">{{ $t("overall.soure") }}</div>
|
|
|
|
|
<div class="alert-label-value">
|
|
|
|
|
{{ alertLabelData && alertLabelData.source ? alertLabelData.source : "--" }}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="alert-label-box">
|
|
|
|
|
<div class="alert-label-title">{{ $t("config.operationlog.state") }}</div>
|
|
|
|
|
<div class="alert-label-value">
|
|
|
|
|
<div
|
|
|
|
|
v-if="alertLabelData"
|
|
|
|
|
:style="alertLabelData.status === '1' ? `background: ${userColor}` : `background: ${unUserColor}`"
|
|
|
|
|
class="active-icon"
|
|
|
|
|
></div>
|
|
|
|
|
{{ alertLabelData && alertLabelData.status === "1" ? $t("overall.enabled") : "--" }}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="alert-label-box">
|
|
|
|
|
<div class="alert-label-title">{{ $t("config.user.language") }}</div>
|
|
|
|
|
<div class="alert-label-value" v-if="alertLabelData">
|
|
|
|
|
{{alertLabelData.lang === "en" ? $t("overall.english") : $t("overall.chinese") }}
|
|
|
|
|
</div>
|
|
|
|
|
<div class="alert-label-value" v-else>
|
|
|
|
|
{{"--" }}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="alert-label-box">
|
|
|
|
|
<div class="alert-label-title">{{ $t("profile.lastLoginIp") }}</div>
|
|
|
|
|
<div class="alert-label-value">
|
|
|
|
|
{{ alertLabelData && alertLabelData.lastLoginIp ? alertLabelData.lastLoginIp : "--" }}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="alert-label-box">
|
|
|
|
|
<div class="alert-label-title">{{ $t("profile.lastLoginTime") }}</div>
|
|
|
|
|
<div class="alert-label-value">
|
|
|
|
|
{{ alertLabelData && alertLabelData.lastLoginTime ? alertLabelData.lastLoginTime : "--" }}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2020-09-28 16:27:03 +08:00
|
|
|
</div>
|
2020-07-27 18:26:44 +08:00
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
2022-06-20 15:37:09 +08:00
|
|
|
import trendMixin from './trendMixins'
|
2022-04-06 14:54:03 +08:00
|
|
|
|
2021-03-19 18:52:19 +08:00
|
|
|
export default {
|
2022-06-20 15:37:09 +08:00
|
|
|
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,
|
2022-06-20 15:37:09 +08:00
|
|
|
alertTableDialog: Boolean
|
2021-03-19 18:52:19 +08:00
|
|
|
},
|
2022-06-20 15:37:09 +08:00
|
|
|
data () {
|
2021-03-19 18:52:19 +08:00
|
|
|
return {
|
|
|
|
|
alertLabelData: null,
|
2021-11-02 16:07:50 +08:00
|
|
|
loading: true,
|
2022-04-01 15:43:14 +08:00
|
|
|
heightList: 0,
|
2022-04-06 14:54:03 +08:00
|
|
|
boxWidth: 0,
|
|
|
|
|
severityDataWeight: this.$store.getters.severityDataWeight,
|
2022-06-20 15:37:09 +08:00
|
|
|
alertColor: '#23bf9a',
|
|
|
|
|
userColor: '#1e9e09',
|
|
|
|
|
unUserColor: '#bbbbbb'
|
|
|
|
|
}
|
2021-05-14 17:50:06 +08:00
|
|
|
},
|
|
|
|
|
watch: {
|
|
|
|
|
id: {
|
|
|
|
|
immediate: true,
|
|
|
|
|
deep: true,
|
2022-06-20 15:37:09 +08:00
|
|
|
handler (n) {
|
|
|
|
|
this.init()
|
|
|
|
|
}
|
2021-05-14 17:50:06 +08:00
|
|
|
},
|
|
|
|
|
that: {
|
|
|
|
|
immediate: true,
|
|
|
|
|
deep: true,
|
2022-06-20 15:37:09 +08:00
|
|
|
handler (n) {}
|
2021-05-14 17:50:06 +08:00
|
|
|
},
|
|
|
|
|
LRTriangle: {
|
|
|
|
|
immediate: true,
|
|
|
|
|
deep: true,
|
2022-06-20 15:37:09 +08:00
|
|
|
handler (n) {}
|
|
|
|
|
}
|
2021-03-19 18:52:19 +08:00
|
|
|
},
|
|
|
|
|
computed: {
|
2022-06-20 15:37:09 +08:00
|
|
|
calcPosition () {
|
2021-03-19 18:52:19 +08:00
|
|
|
return function (position) {
|
2022-04-20 17:16:07 +08:00
|
|
|
const clientHeight =
|
|
|
|
|
document.body.clientHeight < document.documentElement.clientHeight
|
|
|
|
|
? document.body.clientHeight
|
2022-06-20 15:37:09 +08:00
|
|
|
: document.documentElement.clientHeight
|
2022-04-20 17:16:07 +08:00
|
|
|
const clientWidth =
|
|
|
|
|
document.body.clientWidth < document.documentElement.clientWidth
|
|
|
|
|
? document.body.clientWidth
|
2022-06-20 15:37:09 +08:00
|
|
|
: document.documentElement.clientWidth
|
|
|
|
|
let leftOffSetView = 0
|
|
|
|
|
let leftOffSet = this.detailList ? -80 : 10
|
|
|
|
|
let topOffSet = this.detailList ? 60 : 22
|
|
|
|
|
let topOffSetView = 0
|
2022-04-01 15:43:14 +08:00
|
|
|
let labelPosition = {
|
|
|
|
|
top: 0,
|
|
|
|
|
left: 0,
|
2022-06-20 15:37:09 +08:00
|
|
|
right: 0
|
|
|
|
|
}
|
2022-04-01 15:43:14 +08:00
|
|
|
if (this.alertTableDialog) {
|
2022-04-20 17:16:07 +08:00
|
|
|
let dialog = document.querySelector(
|
2022-06-20 15:37:09 +08:00
|
|
|
'#dialog-alert-massage .el-dialog'
|
|
|
|
|
)
|
2022-04-01 15:43:14 +08:00
|
|
|
if (!dialog) {
|
2022-06-20 15:37:09 +08:00
|
|
|
dialog = document.querySelector('#viewGraphDialog .el-dialog')
|
2021-03-19 18:52:19 +08:00
|
|
|
}
|
2021-11-02 10:17:26 +08:00
|
|
|
const dialogHeight = dialog.getBoundingClientRect()
|
2022-04-20 16:57:14 +08:00
|
|
|
leftOffSet = leftOffSet - 3 * dialogHeight.x
|
2022-04-01 15:43:14 +08:00
|
|
|
leftOffSetView = dialogHeight.x
|
|
|
|
|
topOffSet = topOffSet - dialogHeight.y
|
|
|
|
|
topOffSetView = topOffSet
|
|
|
|
|
}
|
|
|
|
|
if (position.top > clientHeight / 2) {
|
2022-06-20 15:37:09 +08:00
|
|
|
if (this.type === 'user') {
|
|
|
|
|
labelPosition = {
|
|
|
|
|
// user info 距离
|
|
|
|
|
left: `${position.left + position.width / 3 + leftOffSet}px`,
|
|
|
|
|
top: `${position.top - this.heightList - topOffSetView}px`
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
labelPosition = {
|
|
|
|
|
left: `${position.left + position.width + leftOffSet}px`,
|
|
|
|
|
top: `${position.top - this.heightList - topOffSetView}px`
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-03-19 18:52:19 +08:00
|
|
|
} else {
|
2022-06-20 15:37:09 +08:00
|
|
|
if (this.type === 'user') {
|
|
|
|
|
// user info 距离
|
|
|
|
|
labelPosition = {
|
|
|
|
|
left: `${position.left + position.width / 3 + leftOffSet}px`,
|
|
|
|
|
top: `${position.top + topOffSet}px`
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
labelPosition = {
|
|
|
|
|
left: `${position.left + position.width + leftOffSet}px`,
|
|
|
|
|
top: `${position.top + topOffSet}px`
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-10-15 18:20:32 +08:00
|
|
|
}
|
2022-04-01 15:43:14 +08:00
|
|
|
if (position.left > clientWidth / 2) {
|
2022-06-20 15:37:09 +08:00
|
|
|
delete labelPosition.left
|
2022-04-01 15:43:14 +08:00
|
|
|
|
2022-04-20 17:16:07 +08:00
|
|
|
labelPosition.right =
|
2022-06-20 15:37:09 +08:00
|
|
|
clientWidth - position.left - leftOffSetView + 'px'
|
2022-04-01 15:43:14 +08:00
|
|
|
}
|
2022-06-20 15:37:09 +08:00
|
|
|
return labelPosition
|
|
|
|
|
}
|
2020-09-28 16:27:03 +08:00
|
|
|
},
|
2022-06-20 15:37:09 +08:00
|
|
|
calcHeight () {
|
|
|
|
|
const self = this
|
2021-03-19 18:52:19 +08:00
|
|
|
return function (position) {
|
2022-04-20 17:16:07 +08:00
|
|
|
const clientHeight =
|
|
|
|
|
document.body.clientHeight < document.documentElement.clientHeight
|
|
|
|
|
? document.body.clientHeight
|
2022-06-20 15:37:09 +08:00
|
|
|
: document.documentElement.clientHeight
|
2022-04-20 17:16:07 +08:00
|
|
|
const elHeight =
|
2022-06-20 15:37:09 +08:00
|
|
|
self.type === 'asset' ? 318 : self.type === 'project' ? 70 : 70
|
2021-03-19 18:52:19 +08:00
|
|
|
if (position.top + elHeight > clientHeight) {
|
2022-06-20 15:37:09 +08:00
|
|
|
return 'alert-labelUp'
|
2020-07-28 11:45:37 +08:00
|
|
|
} else {
|
2022-06-20 15:37:09 +08:00
|
|
|
return 'alert-label'
|
2020-07-28 11:45:37 +08:00
|
|
|
}
|
2022-06-20 15:37:09 +08:00
|
|
|
}
|
|
|
|
|
}
|
2021-03-19 18:52:19 +08:00
|
|
|
},
|
|
|
|
|
methods: {
|
2022-06-20 15:37:09 +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
|
|
|
|
|
this.alertColor = this.returnColor(res.data.alert)
|
2021-05-14 17:50:06 +08:00
|
|
|
} else {
|
2022-06-20 15:37:09 +08:00
|
|
|
this.$message.error(res.msg)
|
2021-05-14 17:50:06 +08:00
|
|
|
}
|
2022-06-20 15:37:09 +08:00
|
|
|
})
|
2021-05-14 17:50:06 +08:00
|
|
|
}
|
2022-06-20 15:37:09 +08:00
|
|
|
if (this.type === 'project') {
|
|
|
|
|
this.$get('monitor/project/' + this.id).then((res) => {
|
|
|
|
|
if (res.msg === 'success') {
|
|
|
|
|
this.loading = false
|
|
|
|
|
this.alertLabelData = res.data
|
|
|
|
|
this.alertColor = this.returnColor(res.data.alert)
|
2021-05-14 17:50:06 +08:00
|
|
|
} else {
|
2022-06-20 15:37:09 +08:00
|
|
|
this.$message.error(res.msg)
|
2021-05-14 17:50:06 +08:00
|
|
|
}
|
2022-06-20 15:37:09 +08:00
|
|
|
})
|
2021-05-14 17:50:06 +08:00
|
|
|
}
|
2022-06-20 15:37:09 +08:00
|
|
|
if (this.type === 'module') {
|
|
|
|
|
this.$get('monitor/module/' + this.id).then((res) => {
|
|
|
|
|
if (res.msg === 'success') {
|
|
|
|
|
this.loading = false
|
|
|
|
|
this.alertLabelData = res.data
|
|
|
|
|
this.alertColor = this.returnColor(res.data.alert)
|
2021-05-14 17:50:06 +08:00
|
|
|
} else {
|
2022-06-20 15:37:09 +08:00
|
|
|
this.$message.error(res.msg)
|
2021-05-14 17:50:06 +08:00
|
|
|
}
|
2022-06-20 15:37:09 +08:00
|
|
|
})
|
2021-05-14 17:50:06 +08:00
|
|
|
}
|
2022-06-20 15:37:09 +08:00
|
|
|
if (this.type === 'endpoint') {
|
|
|
|
|
this.$get('monitor/endpoint/' + this.id).then((res) => {
|
|
|
|
|
if (res.msg === 'success') {
|
|
|
|
|
this.loading = false
|
|
|
|
|
this.alertLabelData = res.data
|
|
|
|
|
this.alertColor = this.returnColor(res.data.alert)
|
2021-05-14 17:50:06 +08:00
|
|
|
} else {
|
2022-06-20 15:37:09 +08:00
|
|
|
this.$message.error(res.msg)
|
2021-05-14 17:50:06 +08:00
|
|
|
}
|
2022-06-20 15:37:09 +08:00
|
|
|
})
|
2021-05-14 17:50:06 +08:00
|
|
|
}
|
2022-06-20 15:37:09 +08:00
|
|
|
if (this.type === 'dc') {
|
|
|
|
|
this.$get('dc/' + this.id).then((res) => {
|
|
|
|
|
if (res.msg === 'success') {
|
|
|
|
|
this.loading = false
|
|
|
|
|
this.alertLabelData = res.data
|
|
|
|
|
this.alertColor = this.returnColor(res.data.alert)
|
2021-09-14 14:19:38 +08:00
|
|
|
} else {
|
2022-06-20 15:37:09 +08:00
|
|
|
this.$message.error(res.msg)
|
2021-09-14 14:19:38 +08:00
|
|
|
}
|
2022-06-20 15:37:09 +08:00
|
|
|
})
|
2021-09-14 14:19:38 +08:00
|
|
|
}
|
2022-06-20 15:37:09 +08:00
|
|
|
if (this.type === 'user') {
|
|
|
|
|
this.loading = false
|
|
|
|
|
this.alertLabelData = this.that
|
|
|
|
|
}
|
|
|
|
|
const weekDays = this.getWeeksTime()
|
2022-03-01 11:04:16 +08:00
|
|
|
if (this.trendTimer) {
|
2022-06-20 15:37:09 +08:00
|
|
|
clearTimeout(this.trendTimer)
|
|
|
|
|
this.trendTimer = null
|
2022-03-01 11:04:16 +08:00
|
|
|
}
|
|
|
|
|
this.trendTimer = setTimeout(() => {
|
2022-06-20 15:37:09 +08:00
|
|
|
this.trendLoading = true
|
2022-03-01 11:04:16 +08:00
|
|
|
const params = {
|
2022-06-20 15:37:09 +08:00
|
|
|
type: 'total',
|
|
|
|
|
dimension: 'priority',
|
|
|
|
|
step: 'd'
|
|
|
|
|
}
|
|
|
|
|
params[this.type + 'Id'] = this.id
|
|
|
|
|
this.$get('/stat/alertMessage/trend', params).then((res) => {
|
2022-03-10 13:34:24 +08:00
|
|
|
if (!res.data) {
|
2022-06-20 15:37:09 +08:00
|
|
|
return
|
2022-03-10 13:34:24 +08:00
|
|
|
}
|
2022-04-20 17:16:07 +08:00
|
|
|
const alertDaysData = res.data.result
|
|
|
|
|
? res.data.result[0].values
|
2022-06-20 15:37:09 +08:00
|
|
|
: []
|
|
|
|
|
const newWeekDays = JSON.parse(JSON.stringify(weekDays))
|
2022-04-20 17:16:07 +08:00
|
|
|
alertDaysData.forEach((item) => {
|
|
|
|
|
item.values.forEach((time) => {
|
2022-06-20 15:37:09 +08:00
|
|
|
const findItem = newWeekDays.find((days) => days.time == time[0])
|
2022-03-01 11:04:16 +08:00
|
|
|
if (findItem) {
|
2022-06-20 15:37:09 +08:00
|
|
|
findItem[item.metric.priority] = time[1]
|
2022-03-01 11:04:16 +08:00
|
|
|
}
|
2022-06-20 15:37:09 +08:00
|
|
|
})
|
|
|
|
|
})
|
2022-03-01 11:04:16 +08:00
|
|
|
setTimeout(() => {
|
2022-06-20 15:37:09 +08:00
|
|
|
this.alertDaysData = newWeekDays
|
|
|
|
|
this.trendLoading = false
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
})
|
2021-05-14 17:50:06 +08:00
|
|
|
},
|
2022-06-20 15:37:09 +08:00
|
|
|
alertActiveStr () {
|
|
|
|
|
return this.$t('overall.active')
|
2020-07-27 18:26:44 +08:00
|
|
|
},
|
2022-06-20 15:37:09 +08:00
|
|
|
alertStateStr (num) {
|
2021-03-19 18:52:19 +08:00
|
|
|
if (num == 1) {
|
2022-06-20 15:37:09 +08:00
|
|
|
return this.$t('asset.inStock')
|
2021-03-19 18:52:19 +08:00
|
|
|
} else {
|
2022-06-20 15:37:09 +08:00
|
|
|
return this.$t('asset.notInStock')
|
2021-03-19 18:52:19 +08:00
|
|
|
}
|
2022-04-06 14:54:03 +08:00
|
|
|
},
|
2022-06-20 15:37:09 +08:00
|
|
|
selectIcon (type) {
|
2022-04-06 14:54:03 +08:00
|
|
|
switch (type) {
|
2022-06-20 15:37:09 +08:00
|
|
|
case 'asset':
|
|
|
|
|
return 'nz-icon-overview-project'
|
|
|
|
|
case 'dc':
|
|
|
|
|
return 'nz-icon-Datacenter2'
|
|
|
|
|
case 'project':
|
|
|
|
|
return 'nz-icon-project'
|
|
|
|
|
case 'module':
|
|
|
|
|
return 'nz-icon-overview-module'
|
|
|
|
|
case 'endpoint':
|
|
|
|
|
return 'nz-icon-overview-endpoint'
|
|
|
|
|
case 'alertrule':
|
|
|
|
|
return 'nz-icon-Alertrule'
|
|
|
|
|
case 'user':
|
|
|
|
|
return 'nz-icon-user1'
|
2022-04-06 14:54:03 +08:00
|
|
|
}
|
2022-06-20 15:37:09 +08:00
|
|
|
return 'nz-icon-module5'
|
2022-04-06 14:54:03 +08:00
|
|
|
},
|
2022-06-20 15:37:09 +08:00
|
|
|
returnColor (obj) {
|
|
|
|
|
let color = ''
|
2022-04-06 14:54:03 +08:00
|
|
|
if (!obj) {
|
2022-06-20 15:37:09 +08:00
|
|
|
return '#23bf9a'
|
2022-04-06 14:54:03 +08:00
|
|
|
} else {
|
2022-04-20 17:16:07 +08:00
|
|
|
this.severityDataWeight.forEach((severity) => {
|
2022-06-20 15:37:09 +08:00
|
|
|
const num = obj.find((alert) => alert.priority === severity.name)
|
2022-04-06 14:54:03 +08:00
|
|
|
if (num && !color && num.num > 0) {
|
2022-06-20 15:37:09 +08:00
|
|
|
color = severity.color
|
2022-04-06 14:54:03 +08:00
|
|
|
}
|
2022-06-20 15:37:09 +08:00
|
|
|
})
|
2022-04-06 14:54:03 +08:00
|
|
|
if (!color) {
|
2022-06-20 15:37:09 +08:00
|
|
|
color = '#23bf9a'
|
2022-04-06 14:54:03 +08:00
|
|
|
}
|
2022-06-20 15:37:09 +08:00
|
|
|
return color
|
2022-04-06 14:54:03 +08:00
|
|
|
}
|
2022-06-20 15:37:09 +08:00
|
|
|
}
|
2021-03-19 18:52:19 +08:00
|
|
|
},
|
2022-06-20 15:37:09 +08:00
|
|
|
mounted () {
|
2022-03-01 11:04:16 +08:00
|
|
|
if (this.$refs.alertLabels) {
|
2022-06-20 15:37:09 +08:00
|
|
|
this.heightList = this.$refs.alertLabels.getBoundingClientRect().height
|
|
|
|
|
this.boxWidth = this.$refs.alertLabels.getBoundingClientRect().width
|
2022-03-01 11:04:16 +08:00
|
|
|
} else {
|
2022-06-20 15:37:09 +08:00
|
|
|
this.heightList = 0
|
|
|
|
|
this.boxWidth = 0
|
2022-03-01 11:04:16 +08:00
|
|
|
}
|
2021-11-02 16:07:50 +08:00
|
|
|
},
|
2022-06-20 15:37:09 +08:00
|
|
|
beforeDestroy () {}
|
|
|
|
|
}
|
2020-07-27 18:26:44 +08:00
|
|
|
</script>
|
2022-04-20 17:16:07 +08:00
|
|
|
<style>
|
|
|
|
|
</style>
|