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:
parent
20ebd3891b
commit
7de7c1c84e
1 changed files with 7 additions and 2 deletions
|
|
@ -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>}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue