master_server_handlers_ui.go 654 B

1234567891011121314151617181920212223242526272829
  1. package weed_server
  2. import (
  3. "net/http"
  4. "github.com/chrislusf/raft"
  5. ui "github.com/chrislusf/seaweedfs/weed/server/master_ui"
  6. "github.com/chrislusf/seaweedfs/weed/stats"
  7. "github.com/chrislusf/seaweedfs/weed/util"
  8. )
  9. func (ms *MasterServer) uiStatusHandler(w http.ResponseWriter, r *http.Request) {
  10. infos := make(map[string]interface{})
  11. infos["Version"] = util.VERSION
  12. args := struct {
  13. Version string
  14. Topology interface{}
  15. RaftServer raft.Server
  16. Stats map[string]interface{}
  17. Counters *stats.ServerStats
  18. }{
  19. util.VERSION,
  20. ms.Topo.ToMap(),
  21. ms.Topo.RaftServer,
  22. infos,
  23. serverStats,
  24. }
  25. ui.StatusTpl.Execute(w, args)
  26. }