diff --git a/weed/server/master_server_handlers_ui.go b/weed/server/master_server_handlers_ui.go index 9ad234877..f241df87f 100644 --- a/weed/server/master_server_handlers_ui.go +++ b/weed/server/master_server_handlers_ui.go @@ -3,26 +3,25 @@ package weed_server import ( "net/http" + "github.com/chrislusf/raft" + ui "github.com/chrislusf/seaweedfs/weed/server/master_ui" "github.com/chrislusf/seaweedfs/weed/stats" "github.com/chrislusf/seaweedfs/weed/util" - ui "github.com/chrislusf/seaweedfs/weed/server/master_ui" ) func (ms *MasterServer) uiStatusHandler(w http.ResponseWriter, r *http.Request) { infos := make(map[string]interface{}) infos["Version"] = util.VERSION args := struct { - Version string - Topology interface{} - Leader string - Peers interface{} - Stats map[string]interface{} - Counters *stats.ServerStats + Version string + Topology interface{} + RaftServer raft.Server + Stats map[string]interface{} + Counters *stats.ServerStats }{ util.VERSION, ms.Topo.ToMap(), - ms.Topo.RaftServer.Leader(), - ms.Topo.RaftServer.Peers(), + ms.Topo.RaftServer, infos, serverStats, } diff --git a/weed/server/master_ui/templates.go b/weed/server/master_ui/templates.go index e9ee2d8d2..bfce617c5 100644 --- a/weed/server/master_ui/templates.go +++ b/weed/server/master_ui/templates.go @@ -33,6 +33,7 @@ var StatusTpl = template.Must(template.New("status").Parse(` Max {{ .Topology.Max }} + {{ with .RaftServer }} Leader {{ .Leader }} @@ -45,6 +46,7 @@ var StatusTpl = template.Must(template.New("status").Parse(` {{ end }} + {{ end }}