diff options
| author | Chris Lu <chris.lu@gmail.com> | 2016-06-02 18:09:14 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2016-06-02 18:09:14 -0700 |
| commit | 5ce6bbf07672bf3f3c8d26cd2ce0e3e853a47c44 (patch) | |
| tree | 2e4dd2ad0a618ab2b7cdebcdb9c503526c31e2e8 /weed/server/volume_server_handlers_ui.go | |
| parent | caeffa3998adc060fa66c4cd77af971ff2d26c57 (diff) | |
| download | seaweedfs-5ce6bbf07672bf3f3c8d26cd2ce0e3e853a47c44.tar.xz seaweedfs-5ce6bbf07672bf3f3c8d26cd2ce0e3e853a47c44.zip | |
directory structure change to work with glide
glide has its own requirements. My previous workaround caused me some
code checkin errors. Need to fix this.
Diffstat (limited to 'weed/server/volume_server_handlers_ui.go')
| -rw-r--r-- | weed/server/volume_server_handlers_ui.go | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/weed/server/volume_server_handlers_ui.go b/weed/server/volume_server_handlers_ui.go new file mode 100644 index 000000000..7923c95c0 --- /dev/null +++ b/weed/server/volume_server_handlers_ui.go @@ -0,0 +1,38 @@ +package weed_server + +import ( + "net/http" + "path/filepath" + "time" + + "github.com/chrislusf/seaweedfs/weed/stats" + "github.com/chrislusf/seaweedfs/weed/util" + ui "github.com/chrislusf/seaweedfs/weed/server/volume_server_ui" +) + +func (vs *VolumeServer) uiStatusHandler(w http.ResponseWriter, r *http.Request) { + infos := make(map[string]interface{}) + infos["Up Time"] = time.Now().Sub(startTime).String() + var ds []*stats.DiskStatus + for _, loc := range vs.store.Locations { + if dir, e := filepath.Abs(loc.Directory); e == nil { + ds = append(ds, stats.NewDiskStatus(dir)) + } + } + args := struct { + Version string + Master string + Volumes interface{} + DiskStatuses interface{} + Stats interface{} + Counters *stats.ServerStats + }{ + util.VERSION, + vs.masterNode, + vs.store.Status(), + ds, + infos, + serverStats, + } + ui.StatusTpl.Execute(w, args) +} |
