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.

30 lines
686 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. }{
  20. util.Version(),
  21. ms.Topo.ToMap(),
  22. ms.Topo.RaftServer,
  23. infos,
  24. serverStats,
  25. }
  26. ui.StatusTpl.Execute(w, args)
  27. }