Files
archie/internal/webui/api_capabilities.go
T

29 lines
1.0 KiB
Go

package webui
import "net/http"
// handleCapabilities reports which dashboard sections this process can serve
// and which the caller may use, so the browser hides the rest.
func (s *Server) handleCapabilities(w http.ResponseWriter, r *http.Request) {
writeJSON(w, map[string]any{
"sections": map[string]bool{
"chat": s.Chat != nil && s.Chat.Contract != nil,
"logs": s.LogFeed != nil,
"skills": s.Skills != nil,
"curators": s.Curators != nil,
"channels": s.Channels != nil,
"captures": s.Captures != nil,
"mappings": s.Mappings != nil,
"bindings": s.Bindings != nil,
// The workflows page draws its statistics from the task store
// and its definition list from the local registry, so it is
// worth showing with only the former.
"workflows": true,
// Configuration renders from whichever source is wired, and only
// the system org operates the instance: every other org's
// settings pages would offer saves the control plane refuses.
"settings": instanceViewer(r),
},
})
}