фикс пинга 2
This commit is contained in:
parent
2643c84aa6
commit
00101ff6b3
2 changed files with 4 additions and 1 deletions
|
|
@ -25,6 +25,7 @@ import {
|
|||
Typography,
|
||||
message,
|
||||
} from 'antd'
|
||||
import { useQueryClient } from '@tanstack/react-query'
|
||||
import dayjs from 'dayjs'
|
||||
import { useState } from 'react'
|
||||
import { useNavigate, useParams } from 'react-router-dom'
|
||||
|
|
@ -386,6 +387,7 @@ export function DeviceDetailPage() {
|
|||
const { data: device, isLoading } = useDevice(objId, deviceId)
|
||||
const deleteDevice = useDeleteDevice(objId)
|
||||
|
||||
const qc = useQueryClient()
|
||||
const [editOpen, setEditOpen] = useState(false)
|
||||
const [activeTab, setActiveTab] = useState('info')
|
||||
const [liveStatus, setLiveStatus] = useState<{ status: string; ping_ms: number | null } | null>(null)
|
||||
|
|
@ -394,6 +396,7 @@ export function DeviceDetailPage() {
|
|||
onDeviceStatus: (ev) => {
|
||||
if (ev.device_id === deviceId) {
|
||||
setLiveStatus({ status: ev.status, ping_ms: ev.ping_ms })
|
||||
qc.invalidateQueries({ queryKey: ['device', objId, deviceId] })
|
||||
}
|
||||
},
|
||||
})
|
||||
|
|
|
|||
|
|
@ -457,7 +457,7 @@ export function ObjectDetailPage({ defaultMode = 'inventory' }: { defaultMode?:
|
|||
? <Tooltip title="Мониторинг включен"><span style={{ color: '#faad14' }}>⟳</span></Tooltip>
|
||||
: null
|
||||
|
||||
const showLastSeen = d.status !== 'online' && d.last_seen && d.last_ping_at !== d.last_seen
|
||||
const showLastSeen = d.last_seen && d.last_ping_at !== d.last_seen
|
||||
|
||||
return (
|
||||
<Space size={6} align="start">
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue