seaweedfs/weed/server/master_server_handlers_ui.go

31 lines
672 B
Go
Raw Normal View History

2015-03-19 17:39:22 +00:00
package weed_server
import (
"net/http"
"github.com/chrislusf/seaweedfs/weed/stats"
"github.com/chrislusf/seaweedfs/weed/util"
ui "github.com/chrislusf/seaweedfs/weed/server/master_ui"
2015-03-19 17:39:22 +00:00
)
func (ms *MasterServer) uiStatusHandler(w http.ResponseWriter, r *http.Request) {
2015-03-22 19:50:04 +00:00
infos := make(map[string]interface{})
infos["Version"] = util.VERSION
2015-03-19 17:39:22 +00:00
args := struct {
Version string
Topology interface{}
2015-03-24 17:52:14 +00:00
Leader string
2015-03-19 17:39:22 +00:00
Peers interface{}
2015-03-24 07:09:20 +00:00
Stats map[string]interface{}
2015-03-22 19:50:04 +00:00
Counters *stats.ServerStats
2015-03-19 17:39:22 +00:00
}{
util.VERSION,
ms.Topo.ToMap(),
2015-03-24 17:52:14 +00:00
ms.Topo.RaftServer.Leader(),
2015-03-19 17:39:22 +00:00
ms.Topo.RaftServer.Peers(),
2015-03-22 19:50:04 +00:00
infos,
serverStats,
2015-03-19 17:39:22 +00:00
}
ui.StatusTpl.Execute(w, args)
}