master_server_handlers_ui.go 779 B

1234567891011121314151617181920212223242526272829303132
  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. VolumeSizeLimitMB uint32
  20. }{
  21. util.Version(),
  22. ms.Topo.ToMap(),
  23. ms.Topo.RaftServer,
  24. infos,
  25. serverStats,
  26. ms.option.VolumeSizeLimitMB,
  27. }
  28. ui.StatusTpl.Execute(w, args)
  29. }