2015-03-20 01:39:22 +08:00
|
|
|
package weed_server
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
|
2015-04-17 03:18:06 +08: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-20 01:39:22 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
func (ms *MasterServer) uiStatusHandler(w http.ResponseWriter, r *http.Request) {
|
2015-03-23 03:50:04 +08:00
|
|
|
infos := make(map[string]interface{})
|
|
|
|
infos["Version"] = util.VERSION
|
2015-03-20 01:39:22 +08:00
|
|
|
args := struct {
|
|
|
|
Version string
|
|
|
|
Topology interface{}
|
2015-03-25 01:52:14 +08:00
|
|
|
Leader string
|
2015-03-20 01:39:22 +08:00
|
|
|
Peers interface{}
|
2015-03-24 15:09:20 +08:00
|
|
|
Stats map[string]interface{}
|
2015-03-23 03:50:04 +08:00
|
|
|
Counters *stats.ServerStats
|
2015-03-20 01:39:22 +08:00
|
|
|
}{
|
|
|
|
util.VERSION,
|
|
|
|
ms.Topo.ToMap(),
|
2015-03-25 01:52:14 +08:00
|
|
|
ms.Topo.RaftServer.Leader(),
|
2015-03-20 01:39:22 +08:00
|
|
|
ms.Topo.RaftServer.Peers(),
|
2015-03-23 03:50:04 +08:00
|
|
|
infos,
|
|
|
|
serverStats,
|
2015-03-20 01:39:22 +08:00
|
|
|
}
|
|
|
|
ui.StatusTpl.Execute(w, args)
|
|
|
|
}
|