From 625991617061ab679998841b8043d2b2ef3d62b9 Mon Sep 17 00:00:00 2001 From: dv Date: Mon, 4 May 2026 16:00:00 +0300 Subject: [PATCH] =?UTF-8?q?=D1=85=D0=B7=20=D1=85=D0=B7=20=D1=85=D0=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/DiscoveryDrawer.tsx | 5 +++++ frontend/src/pages/ObjectDetail.tsx | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/DiscoveryDrawer.tsx b/frontend/src/components/DiscoveryDrawer.tsx index c4404ed..6f7ad65 100644 --- a/frontend/src/components/DiscoveryDrawer.tsx +++ b/frontend/src/components/DiscoveryDrawer.tsx @@ -139,6 +139,11 @@ export function DiscoveryDrawer({ open, onClose, objectName, taskId, onComplete setInfraFound((prev) => [...prev, { type: data.type, ip: data.ip }]) } else if (ev.event === 'disc_device_ping') { + setCurrentAction((prev) => { + if (prev) return prev + const status = data.status === 'online' ? 'online' : 'offline' + return `Проверка доступности ${data.ip}: ${status}` + }) setDevicePings((prev) => { const item = { ip: data.ip, diff --git a/frontend/src/pages/ObjectDetail.tsx b/frontend/src/pages/ObjectDetail.tsx index 2dfe379..decf613 100644 --- a/frontend/src/pages/ObjectDetail.tsx +++ b/frontend/src/pages/ObjectDetail.tsx @@ -178,12 +178,12 @@ export function ObjectDetailPage({ defaultMode = 'inventory' }: { defaultMode?: const discoveryRunning = discoverMutation.isPending || !!discoveryTaskId || !!discoveryStatus.data?.running useEffect(() => { - if (discoveryStatus.data?.running) { + if (discoveryStatus.data?.running && !discoveryOpen) { setDiscoveryTaskId(discoveryStatus.data.task_id) } else if (discoveryStatus.data && discoveryTaskId === discoveryStatus.data.task_id) { setDiscoveryTaskId(null) } - }, [discoveryStatus.data, discoveryTaskId]) + }, [discoveryStatus.data, discoveryTaskId, discoveryOpen]) const handleDiscover = async () => { if (discoveryRunning) {