diff --git a/src/pages/EquipmentPage.tsx b/src/pages/EquipmentPage.tsx index f0ca200..1da3f33 100644 --- a/src/pages/EquipmentPage.tsx +++ b/src/pages/EquipmentPage.tsx @@ -632,6 +632,7 @@ function WorkstationCard({ const [updateMsg, setUpdateMsg] = useState(null) const [testResults, setTestResults] = useState>({}) const [testingDeviceId, setTestingDeviceId] = useState(null) + const [showPing, setShowPing] = useState(false) const [pingHost, setPingHost] = useState('') const [pinging, setPinging] = useState(false) const [pingResult, setPingResult] = useState<{ ok: boolean; output?: string; error?: string } | null>(null) @@ -959,35 +960,47 @@ function WorkstationCard({ {/* Ping tool — only when agent is online */} {ws.isOnline && (
-

Пинг через агента

-
- setPingHost(e.target.value)} - onKeyDown={e => e.key === 'Enter' && pingNow()} - placeholder="192.168.1.1 или hostname" - className="input text-sm font-mono flex-1 py-1.5" - /> - -
- {pingResult && ( -
- {pingResult.ok && pingResult.output ? ( -
{pingResult.output.trim()}
- ) : ( -

{pingResult.error ?? 'Ошибка'}

+ + {showPing && ( +
+
+ setPingHost(e.target.value)} + onKeyDown={e => e.key === 'Enter' && pingNow()} + placeholder="192.168.1.1 или hostname" + className="input text-sm font-mono flex-1 py-1.5" + autoFocus + /> + +
+ {pingResult && ( +
+ {pingResult.ok && pingResult.output ? ( +
{pingResult.output.trim()}
+ ) : ( +

{pingResult.error ?? 'Ошибка'}

+ )} +
)}
)}