fix format of internal node URLs in master UI templates
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>SeaweedFS {{ .Version }}</title>
|
||||
<link rel="stylesheet" href="/seaweedfsstatic/bootstrap/3.3.1/css/bootstrap.min.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="page-header">
|
||||
@@ -33,14 +35,14 @@
|
||||
{{ with .RaftServer }}
|
||||
<tr>
|
||||
<th>Leader</th>
|
||||
<td><a href="http://{{ .Leader }}">{{ .Leader }}</a></td>
|
||||
<td><a href="{{ url .Leader }}">{{ .Leader }}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Other Masters</th>
|
||||
<td class="col-sm-5">
|
||||
<ul class="list-unstyled">
|
||||
{{ range $k, $p := .GetConfiguration.Configuration.Servers }}
|
||||
<li><a href="http://{{ $p.ID }}/ui/index.html">{{ $p.ID }}</a></li>
|
||||
<li><a href="{{ url $p.ID }}/ui/index.html">{{ $p.ID }}</a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</td>
|
||||
@@ -99,9 +101,9 @@
|
||||
<tr>
|
||||
<td><code>{{ $dc.Id }}</code></td>
|
||||
<td>{{ $rack.Id }}</td>
|
||||
<td><a href="http://{{ $dn.Url }}/ui/index.html">{{ $dn.Url }}</a>
|
||||
<td><a href="{{ url $dn.Url }}/ui/index.html">{{ $dn.Url }}</a>
|
||||
{{ if ne $dn.PublicUrl $dn.Url }}
|
||||
/ <a href="http://{{ $dn.PublicUrl }}/ui/index.html">{{ $dn.PublicUrl }}</a>
|
||||
/ <a href="{{ url $dn.PublicUrl }}/ui/index.html">{{ $dn.PublicUrl }}</a>
|
||||
{{ end }}
|
||||
</td>
|
||||
<td>{{ $dn.Volumes }}</td>
|
||||
@@ -118,4 +120,5 @@
|
||||
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -4,6 +4,8 @@ import (
|
||||
_ "embed"
|
||||
"html/template"
|
||||
"strings"
|
||||
|
||||
"github.com/seaweedfs/seaweedfs/weed/pb"
|
||||
)
|
||||
|
||||
//go:embed master.html
|
||||
@@ -16,7 +18,7 @@ var templateFunctions = template.FuncMap{
|
||||
"url": func(input string) string {
|
||||
|
||||
if !strings.HasPrefix(input, "http://") && !strings.HasPrefix(input, "https://") {
|
||||
return "http://" + input
|
||||
return "http://" + pb.ServerAddress(input).ToHttpAddress()
|
||||
}
|
||||
|
||||
return input
|
||||
@@ -25,4 +27,4 @@ var templateFunctions = template.FuncMap{
|
||||
|
||||
var StatusTpl = template.Must(template.New("status").Funcs(templateFunctions).Parse(masterHtml))
|
||||
|
||||
var StatusNewRaftTpl = template.Must(template.New("status").Parse(masterNewRaftHtml))
|
||||
var StatusNewRaftTpl = template.Must(template.New("status").Funcs(templateFunctions).Parse(masterNewRaftHtml))
|
||||
|
||||
Reference in New Issue
Block a user