хз хз хз
This commit is contained in:
parent
5dd2454c19
commit
6259916170
2 changed files with 7 additions and 2 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue