feat: Host CRUD complete — edit, full form fields, connect, toast

- Add UpdateHost handler + PUT /hosts/:id route
- CreateHost now accepts all fields (port, username, auth, notes)
- host_modal.html: full form with port, username, auth type toggle, edit mode
- host_list.html: edit button dispatches edit-host event with host data
- Connect button links to /terminal?host={id} for pre-selection
- Terminal page reads selected host from query param
- Toast notification system via Alpine.js events
- Add default template function for fallback values
This commit is contained in:
swanadiva
2026-07-07 15:51:57 +07:00
parent 3df8416d9b
commit 301115b74d
8 changed files with 285 additions and 58 deletions
+7 -5
View File
@@ -28,12 +28,14 @@ func Terminal(c *fiber.Ctx) error {
}
}
hostsJSON, _ := json.Marshal(available)
selectedHost := c.Query("host", "")
data := fiber.Map{
"View": "terminal",
"Title": "Terminal",
"NavItems": navItems,
"Hosts": available,
"HostsJSON": string(hostsJSON),
"View": "terminal",
"Title": "Terminal",
"NavItems": navItems,
"Hosts": available,
"HostsJSON": string(hostsJSON),
"SelectedHost": selectedHost,
}
if c.Get("HX-Request") != "" {
return c.Render("terminal_content", data)