изменение логики работы поиска датчиков из дашборд и истории тревог по конкретному этажу

This commit is contained in:
2026-02-05 22:21:25 +03:00
parent 6caf1c9dbb
commit bad3b63911
13 changed files with 2861 additions and 793 deletions

View File

@@ -61,14 +61,14 @@ const AlertsList: React.FC<AlertsListProps> = ({ alerts, onAcknowledgeToggle, in
return
}
const sensorSerialNumber = await navigateToSensor(
const result = await navigateToSensor(
sensorId,
alert.floor || null,
viewType
)
if (sensorSerialNumber) {
router.push(`/navigation?focusSensorId=${encodeURIComponent(sensorSerialNumber)}`)
if (result) {
router.push(`/navigation?focusSensorId=${encodeURIComponent(result.sensorSerialNumber)}&modelPath=${encodeURIComponent(result.modelPath)}`)
}
}

View File

@@ -103,7 +103,6 @@ const AlertsList: React.FC<AlertsListProps> = ({ alerts, onAcknowledgeToggle, in
<th style={interSemiboldStyle} className="text-left text-white text-sm py-3">Детектор</th>
<th style={interSemiboldStyle} className="text-left text-white text-sm py-3">Статус</th>
<th style={interSemiboldStyle} className="text-left text-white text-sm py-3">Сообщение</th>
<th style={interSemiboldStyle} className="text-left text-white text-sm py-3">Местоположение</th>
<th style={interSemiboldStyle} className="text-left text-white text-sm py-3">Приоритет</th>
<th style={interSemiboldStyle} className="text-left text-white text-sm py-3">Подтверждено</th>
<th style={interSemiboldStyle} className="text-left text-white text-sm py-3">Время</th>
@@ -133,9 +132,6 @@ const AlertsList: React.FC<AlertsListProps> = ({ alerts, onAcknowledgeToggle, in
<td style={interRegularStyle} className="py-4 text-sm text-white">
{item.message}
</td>
<td style={interRegularStyle} className="py-4 text-sm text-white">
{item.location || '-'}
</td>
<td className="py-4">
<span
className="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium text-white"
@@ -194,7 +190,7 @@ const AlertsList: React.FC<AlertsListProps> = ({ alerts, onAcknowledgeToggle, in
))}
{filteredAlerts.length === 0 && (
<tr>
<td colSpan={8} className="py-8 text-center text-gray-400">
<td colSpan={7} className="py-8 text-center text-gray-400">
Записей не найдено
</td>
</tr>