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.

39 lines
953 B

10 years ago
6 years ago
7 years ago
10 years ago
10 years ago
10 years ago
  1. package weed_server
  2. import (
  3. "net/http"
  4. "path/filepath"
  5. "time"
  6. "github.com/chrislusf/seaweedfs/weed/pb/volume_server_pb"
  7. ui "github.com/chrislusf/seaweedfs/weed/server/volume_server_ui"
  8. "github.com/chrislusf/seaweedfs/weed/stats"
  9. "github.com/chrislusf/seaweedfs/weed/util"
  10. )
  11. func (vs *VolumeServer) uiStatusHandler(w http.ResponseWriter, r *http.Request) {
  12. infos := make(map[string]interface{})
  13. infos["Up Time"] = time.Now().Sub(startTime).String()
  14. var ds []*volume_server_pb.DiskStatus
  15. for _, loc := range vs.store.Locations {
  16. if dir, e := filepath.Abs(loc.Directory); e == nil {
  17. ds = append(ds, stats.NewDiskStatus(dir))
  18. }
  19. }
  20. args := struct {
  21. Version string
  22. Masters []string
  23. Volumes interface{}
  24. DiskStatuses interface{}
  25. Stats interface{}
  26. Counters *stats.ServerStats
  27. }{
  28. util.VERSION,
  29. vs.MasterNodes,
  30. vs.store.Status(),
  31. ds,
  32. infos,
  33. serverStats,
  34. }
  35. ui.StatusTpl.Execute(w, args)
  36. }