Browse Source

weed master: redirect to leader for default admin UI

fix https://github.com/chrislusf/seaweedfs/issues/898
pull/914/head
Chris Lu 6 years ago
parent
commit
a32797518b
  1. 2
      weed/server/master_server.go
  2. 2
      weed/server/master_ui/templates.go

2
weed/server/master_server.go

@ -79,7 +79,7 @@ func NewMasterServer(r *mux.Router, port int, metaFolder string,
if !disableHttp {
handleStaticResources2(r)
r.HandleFunc("/", ms.uiStatusHandler)
r.HandleFunc("/", ms.proxyToLeader(ms.uiStatusHandler))
r.HandleFunc("/ui/index.html", ms.uiStatusHandler)
r.HandleFunc("/dir/assign", ms.proxyToLeader(ms.guard.WhiteList(ms.dirAssignHandler)))
r.HandleFunc("/dir/lookup", ms.proxyToLeader(ms.guard.WhiteList(ms.dirLookupHandler)))

2
weed/server/master_ui/templates.go

@ -41,7 +41,7 @@ var StatusTpl = template.Must(template.New("status").Parse(`<!DOCTYPE html>
<td class="col-sm-2 field-label"><label>Other Masters:</label></td>
<td class="col-sm-10"><ul class="list-unstyled">
{{ range $k, $p := .Peers }}
<li><a href="http://{{ $p.Name }}">{{ $p.Name }}</a></li>
<li><a href="http://{{ $p.Name }}/ui/index.html">{{ $p.Name }}</a></li>
{{ end }}
</ul></td>
</tr>

Loading…
Cancel
Save