From b5f30946194f5c774b11e0bf510d14224eeb5804 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sun, 22 Feb 2026 13:47:29 -0800 Subject: [PATCH] fix format of internal node URLs in master UI templates --- weed/server/master_ui/masterNewRaft.html | 213 ++++++++++++----------- weed/server/master_ui/templates.go | 6 +- 2 files changed, 112 insertions(+), 107 deletions(-) diff --git a/weed/server/master_ui/masterNewRaft.html b/weed/server/master_ui/masterNewRaft.html index 24271b503..5f16d73a1 100644 --- a/weed/server/master_ui/masterNewRaft.html +++ b/weed/server/master_ui/masterNewRaft.html @@ -1,121 +1,124 @@ + SeaweedFS {{ .Version }} + -
- +
+ + +
+
+

Cluster status

+ + + + + + + + + + + + + + + {{ with .RaftServer }} + + + + + + + + + {{ end }} + +
Volume Size Limit{{ .VolumeSizeLimitMB }}MB
Free{{ .Topology.Free }}
Max{{ .Topology.Max }}
Leader{{ .Leader }}
Other Masters +
    + {{ range $k, $p := .GetConfiguration.Configuration.Servers }} +
  • {{ $p.ID }}
  • + {{ end }} +
+
+
-
-
-

Cluster status

- +
+

System Stats

+
+ + + + + {{ range $key, $val := .Stats }} + + + + + {{ end }} +
Concurrent Connections{{ .Counters.Connections.WeekCounter.Sum }}
{{ $key }}{{ $val }}
+

Raft Stats

+ + + + + + + + + +
applied_index{{ .RaftServer.Stats.applied_index }}
last_log_term{{ .RaftServer.Stats.last_log_term }}
+
+
+ +
+

Topology

+ + + + + + + + + + + + - - - - - - - - - - - - - {{ with .RaftServer }} - - - - - - - + + + - - {{ end }} + + + + + + + {{ end }} + {{ end }} + {{ end }}
Data CenterRackRemoteAddr#VolumesVolume Ids#ErasureCodingShardsMax
Volume Size Limit{{ .VolumeSizeLimitMB }}MB
Free{{ .Topology.Free }}
Max{{ .Topology.Max }}
Leader{{ .Leader }}
Other Masters -
    - {{ range $k, $p := .GetConfiguration.Configuration.Servers }} -
  • {{ $p.ID }}
  • + {{ range $dc_index, $dc := .Topology.DataCenters }} + {{ range $rack_index, $rack := $dc.Racks }} + {{ range $dn_index, $dn := $rack.DataNodes }} +
{{ $dc.Id }}{{ $rack.Id }}{{ $dn.Url }} + {{ if ne $dn.PublicUrl $dn.Url }} + / {{ $dn.PublicUrl }} {{ end }} - -
{{ $dn.Volumes }}{{ $dn.VolumeIds}}{{ $dn.EcShards }}{{ $dn.Max }}
-
-

System Stats

- - - - - - {{ range $key, $val := .Stats }} - - - - - {{ end }} -
Concurrent Connections{{ .Counters.Connections.WeekCounter.Sum }}
{{ $key }}{{ $val }}
-

Raft Stats

- - - - - - - - - -
applied_index{{ .RaftServer.Stats.applied_index }}
last_log_term{{ .RaftServer.Stats.last_log_term }}
-
- -
-

Topology

- - - - - - - - - - - - - - {{ range $dc_index, $dc := .Topology.DataCenters }} - {{ range $rack_index, $rack := $dc.Racks }} - {{ range $dn_index, $dn := $rack.DataNodes }} - - - - - - - - - - {{ end }} - {{ end }} - {{ end }} - -
Data CenterRackRemoteAddr#VolumesVolume Ids#ErasureCodingShardsMax
{{ $dc.Id }}{{ $rack.Id }}{{ $dn.Url }} - {{ if ne $dn.PublicUrl $dn.Url }} - / {{ $dn.PublicUrl }} - {{ end }} - {{ $dn.Volumes }}{{ $dn.VolumeIds}}{{ $dn.EcShards }}{{ $dn.Max }}
-
- -
- + + \ No newline at end of file diff --git a/weed/server/master_ui/templates.go b/weed/server/master_ui/templates.go index d32c5efdf..ad557b7b9 100644 --- a/weed/server/master_ui/templates.go +++ b/weed/server/master_ui/templates.go @@ -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))