fix: collapse ping section by default, expand on click
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -632,6 +632,7 @@ function WorkstationCard({
|
||||
const [updateMsg, setUpdateMsg] = useState<string | null>(null)
|
||||
const [testResults, setTestResults] = useState<Record<string, { ok: boolean; msg: string } | null>>({})
|
||||
const [testingDeviceId, setTestingDeviceId] = useState<string | null>(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,7 +960,16 @@ function WorkstationCard({
|
||||
{/* Ping tool — only when agent is online */}
|
||||
{ws.isOnline && (
|
||||
<div className="pt-2 border-t border-slate-100 dark:border-slate-700">
|
||||
<p className="text-xs text-slate-400 dark:text-slate-500 mb-2">Пинг через агента</p>
|
||||
<button
|
||||
onClick={() => { setShowPing(v => !v); setPingResult(null) }}
|
||||
className="flex items-center gap-1.5 text-xs text-slate-400 hover:text-slate-600 dark:hover:text-slate-300 transition-colors"
|
||||
>
|
||||
<Network size={12} />
|
||||
Пинг через агента
|
||||
{showPing ? <ChevronDown size={11} /> : <ChevronRight size={11} />}
|
||||
</button>
|
||||
{showPing && (
|
||||
<div className="mt-2">
|
||||
<div className="flex gap-2">
|
||||
<input
|
||||
value={pingHost}
|
||||
@@ -967,6 +977,7 @@ function WorkstationCard({
|
||||
onKeyDown={e => e.key === 'Enter' && pingNow()}
|
||||
placeholder="192.168.1.1 или hostname"
|
||||
className="input text-sm font-mono flex-1 py-1.5"
|
||||
autoFocus
|
||||
/>
|
||||
<button
|
||||
onClick={pingNow}
|
||||
@@ -996,6 +1007,8 @@ function WorkstationCard({
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{showPairModal && (
|
||||
<PairCodeModal
|
||||
|
||||
Reference in New Issue
Block a user