Show protocol enable state and which nodes have each protocol installed.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
orohi
2026-07-29 04:18:09 +03:00
co-authored by Cursor
parent 6510de0214
commit 1ad5125bf4
12 changed files with 745 additions and 67 deletions
+18 -8
View File
@@ -148,15 +148,21 @@ func (s *Server) nodeView(w http.ResponseWriter, r *http.Request) {
http.NotFound(w, r)
return
}
nodeProtocols, err := db.ListNodeProtocols(s.DB, id)
if err != nil {
http.Error(w, "db error", http.StatusInternalServerError)
return
}
s.render(w, "node_view.html", pageData{
"Title": n.Name,
"UserName": s.Auth.CurrentName(r),
"Active": "nodes",
"Node": n,
"Compose": nodeinstall.ComposeYAML(n),
"ManualScript": nodeinstall.ManualInstallScript(n),
"Flash": r.URL.Query().Get("ok"),
"Error": r.URL.Query().Get("err"),
"Title": n.Name,
"UserName": s.Auth.CurrentName(r),
"Active": "nodes",
"Node": n,
"NodeProtocols": nodeProtocols,
"Compose": nodeinstall.ComposeYAML(n),
"ManualScript": nodeinstall.ManualInstallScript(n),
"Flash": r.URL.Query().Get("ok"),
"Error": r.URL.Query().Get("err"),
})
}
@@ -197,6 +203,10 @@ func (s *Server) nodeCheck(w http.ResponseWriter, r *http.Request) {
return
}
_ = db.MarkNodeSeen(s.DB, id, hr.Version, models.NodeStatusOnline)
// Panel is source of truth — push desired protocols to the agent.
if err := s.syncNodeConfig(n); err != nil {
log.Printf("push config to node %s: %v", id, err)
}
http.Redirect(w, r, "/admin/nodes/"+id.String()+"?ok=online", http.StatusSeeOther)
}