Add hostname editing feature to agent detail page

- Create enhanced agent detail template with all stats and hostname edit form
- Add UpdateHostname method to store for agent hostname updates
- Add UpdateAgentHostname handler in UI for web form submissions
- Add UpdateHostname endpoint in API handler for JSON requests
- Register new POST /agents/{id}/hostname route for hostname updates
- Improve agent detail page layout with Settings and Danger Zone sections
- Add error handling for missing agents and empty hostname values
This commit is contained in:
Ducky SSH User
2025-12-20 06:51:27 +00:00
parent 0a37b04506
commit 761b91b031
5 changed files with 107 additions and 6 deletions

View File

@@ -45,6 +45,7 @@ func main() {
protectedRoutes.Use(authMgr.Middleware)
protectedRoutes.Get("/", uiHandler.Dashboard)
protectedRoutes.Get("/agents/{id}", uiHandler.AgentDetail)
protectedRoutes.Post("/agents/{id}/hostname", uiHandler.UpdateAgentHostname)
protectedRoutes.Post("/logout", uiHandler.Logout)
protectedRoutes.Post("/api/agents/remove-stale", uiHandler.RemoveStaleAgents)
protectedRoutes.Post("/api/agents/{id}/delete", uiHandler.DeleteAgent)