You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
777 B

10 years ago
10 years ago
  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 uint
  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. }