2015-03-19 17:39:22 +00:00
|
|
|
package weed_server
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
|
2015-04-16 19:18:06 +00:00
|
|
|
"github.com/chrislusf/seaweedfs/go/stats"
|
|
|
|
"github.com/chrislusf/seaweedfs/go/util"
|
|
|
|
ui "github.com/chrislusf/seaweedfs/go/weed/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)
|
|
|
|
}
|