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
670 B

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