Overhaul of the highlight system

This commit is contained in:
iv_vuytsik
2026-01-21 03:16:52 +03:00
parent ce7e39debf
commit 87a1a628d3
13 changed files with 481 additions and 259 deletions

View File

@@ -1,6 +1,7 @@
'use client'
import React from 'react'
import * as statusColors from '../../lib/statusColors'
interface DetectorInfoType {
detector_id: number
@@ -52,9 +53,9 @@ const NotificationDetectorInfo: React.FC<NotificationDetectorInfoProps> = ({ det
}
const getStatusColor = (status: string) => {
if (status === '#b3261e') return 'text-red-400'
if (status === '#fd7c22') return 'text-orange-400'
if (status === '#4caf50') return 'text-green-400'
if (status === statusColors.STATUS_COLOR_CRITICAL) return 'text-red-400'
if (status === statusColors.STATUS_COLOR_WARNING) return 'text-orange-400'
if (status === statusColors.STATUS_COLOR_NORMAL || status === '#4caf50') return 'text-green-400'
return 'text-gray-400'
}
@@ -147,9 +148,13 @@ const NotificationDetectorInfo: React.FC<NotificationDetectorInfoProps> = ({ det
style={{ backgroundColor: detectorInfo.status }}
></div>
<span className={`text-sm font-medium ${getStatusColor(detectorInfo.status)}`}>
{detectorInfo.status === '#b3261e' ? 'Критический' :
detectorInfo.status === '#fd7c22' ? 'Предупреждение' :
detectorInfo.status === '#4caf50' ? 'Нормальный' : 'Неизвестно'}
{detectorInfo.status === statusColors.STATUS_COLOR_CRITICAL
? 'Критический'
: detectorInfo.status === statusColors.STATUS_COLOR_WARNING
? 'Предупреждение'
: detectorInfo.status === statusColors.STATUS_COLOR_NORMAL || detectorInfo.status === '#4caf50'
? 'Нормальный'
: 'Неизвестно'}
</span>
</div>
</div>
@@ -181,4 +186,4 @@ const NotificationDetectorInfo: React.FC<NotificationDetectorInfoProps> = ({ det
)
}
export default NotificationDetectorInfo
export default NotificationDetectorInfo