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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user