feat: TUI Host Forms (add/edit) - Task 17

- HostFormTab with textinput fields for all host fields
- Add (Ctrl+N) and Edit (Ctrl+E) from host list
- Save to JSON storage, auto-reload on save
- Esc to cancel, navigable form with keyboard
This commit is contained in:
swanadiva
2026-06-23 15:05:08 +07:00
parent 809ac1d2e8
commit 3dc482e353
6 changed files with 440 additions and 11 deletions
+13
View File
@@ -62,6 +62,19 @@ func (t *HostListTab) Update(msg tea.Msg) (Tab, tea.Cmd) {
}
}
case "ctrl+n":
return t, func() tea.Msg {
return openHostFormMsg{}
}
case "ctrl+e":
if len(t.hosts) > 0 {
host := t.hosts[t.selectedIndex]
return t, func() tea.Msg {
return openHostFormMsg{editing: host}
}
}
case "q", "ctrl+c":
return t, func() tea.Msg {
return quitMsg{}