master_server_handlers_ui.go 686 B

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