Browse Source

[ui] add ui to status page

pull/114/head
chrislusf 10 years ago
parent
commit
f56339f38d
  1. 2
      go/weed/weed_server/master_server_handlers_ui.go
  2. 4
      go/weed/weed_server/master_ui/templates.go

2
go/weed/weed_server/master_server_handlers_ui.go

@ -14,12 +14,14 @@ func (ms *MasterServer) uiStatusHandler(w http.ResponseWriter, r *http.Request)
args := struct { args := struct {
Version string Version string
Topology interface{} Topology interface{}
Leader string
Peers interface{} Peers interface{}
Stats map[string]interface{} Stats map[string]interface{}
Counters *stats.ServerStats Counters *stats.ServerStats
}{ }{
util.VERSION, util.VERSION,
ms.Topo.ToMap(), ms.Topo.ToMap(),
ms.Topo.RaftServer.Leader(),
ms.Topo.RaftServer.Peers(), ms.Topo.RaftServer.Peers(),
infos, infos,
serverStats, serverStats,

4
go/weed/weed_server/master_ui/templates.go

@ -29,6 +29,10 @@ var StatusTpl = template.Must(template.New("status").Parse(`<!DOCTYPE html>
<th>Max</th> <th>Max</th>
<td>{{ .Topology.Max }}</td> <td>{{ .Topology.Max }}</td>
</tr> </tr>
<tr>
<th>Leader</th>
<td><a href="http://{{ .Leader }}">{{ .Leader }}</a></td>
</tr>
<tr> <tr>
<td class="col-sm-2 field-label"><label>Peers:</label></td> <td class="col-sm-2 field-label"><label>Peers:</label></td>
<td class="col-sm-10"><ul class="list-unstyled"> <td class="col-sm-10"><ul class="list-unstyled">

Loading…
Cancel
Save