Allow renaming SSH hosts in Settings (#12)

Claude-Session: https://claude.ai/code/session_01BbJV5nm8KPVH1oNJYKpnoF

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Samuel James 2026-06-20 07:23:22 -04:00 committed by GitHub
parent 20ebd3891b
commit 7de7c1c84e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -453,7 +453,8 @@ function SshHostsSection() {
try { try {
const draft = drafts[host.id] ?? {} const draft = drafts[host.id] ?? {}
const { config, secrets } = buildPayload(fieldsWithJumpHost(), draft) const { config, secrets } = buildPayload(fieldsWithJumpHost(), draft)
const { integration } = await api.updateIntegration(host.id, { config, secrets }) const name = draft.__name?.trim()
const { integration } = await api.updateIntegration(host.id, { ...(name ? { name } : {}), config, secrets })
setHosts((prev) => (prev ?? []).map((h) => (h.id === integration.id ? integration : h))) setHosts((prev) => (prev ?? []).map((h) => (h.id === integration.id ? integration : h)))
setStatusMsg((prev) => ({ ...prev, [host.id]: 'Saved' })) setStatusMsg((prev) => ({ ...prev, [host.id]: 'Saved' }))
} catch (err) { } catch (err) {
@ -597,7 +598,11 @@ function SshHostsSection() {
boxShadow: online ? '0 0 6px rgba(46,204,113,0.6)' : 'none', boxShadow: online ? '0 0 6px rgba(46,204,113,0.6)' : 'none',
}} }}
/> />
<span style={{ fontSize: '13px', color: '#E8E6E0', fontWeight: 600 }}>{host.name}</span> <input
value={draft.__name ?? host.name}
onChange={(e) => setDraftField(host.id, '__name', e.target.value)}
style={{ fontSize: '13px', color: '#E8E6E0', fontWeight: 600, backgroundColor: 'transparent', border: 'none', outline: 'none', padding: 0, width: '180px' }}
/>
</div> </div>
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
{statusMsg[host.id] && <span style={{ fontSize: '11px', color: '#7A7D85' }}>{statusMsg[host.id]}</span>} {statusMsg[host.id] && <span style={{ fontSize: '11px', color: '#7A7D85' }}>{statusMsg[host.id]}</span>}