diff --git a/weed/server/filer_ui/filer.html b/weed/server/filer_ui/filer.html
new file mode 100644
index 000000000..84dc4d4d6
--- /dev/null
+++ b/weed/server/filer_ui/filer.html
@@ -0,0 +1,182 @@
+
+
+
+ SeaweedFS Filer
+
+
+
+
+
+
+
+
+
+
+
+ {{if .ShouldDisplayLoadMore}}
+
+ {{end}}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/weed/server/filer_ui/templates.go b/weed/server/filer_ui/templates.go
index 648b97f22..f9ef064bc 100644
--- a/weed/server/filer_ui/templates.go
+++ b/weed/server/filer_ui/templates.go
@@ -1,6 +1,7 @@
package filer_ui
import (
+ _ "embed"
"github.com/dustin/go-humanize"
"html/template"
"net/url"
@@ -18,178 +19,7 @@ var funcMap = template.FuncMap{
"printpath": printpath,
}
-var StatusTpl = template.Must(template.New("status").Funcs(funcMap).Parse(`
-
-
- SeaweedFS Filer
-
-
-
-
-
-
-
-
-
-
-
- {{if .ShouldDisplayLoadMore}}
-
- {{end}}
-
-
-
-
-
-
-
-
-
-
-
-
-`))
+var StatusTpl = template.Must(template.New("status").Funcs(funcMap).Parse(filerHtml))
diff --git a/weed/server/master_ui/master.html b/weed/server/master_ui/master.html
new file mode 100644
index 000000000..e0241d66d
--- /dev/null
+++ b/weed/server/master_ui/master.html
@@ -0,0 +1,110 @@
+
+
+
+ SeaweedFS {{ .Version }}
+
+
+
+
+
+
+
+
+
Cluster status
+
+
+
+ Volume Size Limit |
+ {{ .VolumeSizeLimitMB }}MB |
+
+
+ Free |
+ {{ .Topology.Free }} |
+
+
+ Max |
+ {{ .Topology.Max }} |
+
+ {{ with .RaftServer }}
+
+ Leader |
+ {{ .Leader }} |
+
+
+ Other Masters |
+
+
+ |
+
+ {{ end }}
+
+
+
+
+
+
System Stats
+
+
+ Concurrent Connections |
+ {{ .Counters.Connections.WeekCounter.Sum }} |
+
+ {{ range $key, $val := .Stats }}
+
+ {{ $key }} |
+ {{ $val }} |
+
+ {{ end }}
+
+
+
+
+
+
Topology
+
+
+
+ Data Center |
+ Rack |
+ RemoteAddr |
+ #Volumes |
+ Volume Ids |
+ #ErasureCodingShards |
+ Max |
+
+
+
+ {{ 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 }} |
+
+ {{ end }}
+ {{ end }}
+ {{ end }}
+
+
+
+
+
+
+
diff --git a/weed/server/master_ui/templates.go b/weed/server/master_ui/templates.go
index 31b6353e9..415022b97 100644
--- a/weed/server/master_ui/templates.go
+++ b/weed/server/master_ui/templates.go
@@ -1,115 +1,11 @@
package master_ui
import (
+ _ "embed"
"html/template"
)
-var StatusTpl = template.Must(template.New("status").Parse(`
-
-
- SeaweedFS {{ .Version }}
-
-
-
-
-
+//go:embed master.html
+var masterHtml string
-
-
-
Cluster status
-
-
-
- Volume Size Limit |
- {{ .VolumeSizeLimitMB }}MB |
-
-
- Free |
- {{ .Topology.Free }} |
-
-
- Max |
- {{ .Topology.Max }} |
-
- {{ with .RaftServer }}
-
- Leader |
- {{ .Leader }} |
-
-
- Other Masters |
- |
-
- {{ end }}
-
-
-
-
-
-
System Stats
-
-
- Concurrent Connections |
- {{ .Counters.Connections.WeekCounter.Sum }} |
-
- {{ range $key, $val := .Stats }}
-
- {{ $key }} |
- {{ $val }} |
-
- {{ end }}
-
-
-
-
-
-
Topology
-
-
-
- Data Center |
- Rack |
- RemoteAddr |
- #Volumes |
- Volume Ids |
- #ErasureCodingShards |
- Max |
-
-
-
- {{ 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 }} |
-
- {{ end }}
- {{ end }}
- {{ end }}
-
-
-
-
-
-
-
-`))
+var StatusTpl = template.Must(template.New("status").Parse(masterHtml))
diff --git a/weed/server/volume_server_ui/templates.go b/weed/server/volume_server_ui/templates.go
index 79f1a14a0..8034d8218 100644
--- a/weed/server/volume_server_ui/templates.go
+++ b/weed/server/volume_server_ui/templates.go
@@ -1,6 +1,7 @@
package volume_server_ui
import (
+ _ "embed"
"fmt"
"github.com/chrislusf/seaweedfs/weed/util"
"html/template"
@@ -26,191 +27,7 @@ var funcMap = template.FuncMap{
"percentFrom": percentFrom,
}
-var StatusTpl = template.Must(template.New("status").Funcs(funcMap).Parse(`
-
-
- SeaweedFS {{ .Version }}
-
-
-
-
-
-
-
-
-
-
-
-
-
Disk Stats
-
-
-
- Path |
- Disk |
- Total |
- Free |
- Usage |
-
-
-
- {{ range .DiskStatuses }}
-
- {{ .Dir }} |
- {{ .DiskType }} |
- {{ bytesToHumanReadable .All }} |
- {{ bytesToHumanReadable .Free }} |
- {{ percentFrom .All .Used}}% |
-
- {{ end }}
-
-
-
-
-
-
System Stats
-
-
- Masters |
- {{.Masters}} |
-
-
- Weekly # ReadRequests |
- {{ .Counters.ReadRequests.WeekCounter.ToList | join }} |
-
-
- Daily # ReadRequests |
- {{ .Counters.ReadRequests.DayCounter.ToList | join }} |
-
-
- Hourly # ReadRequests |
- {{ .Counters.ReadRequests.HourCounter.ToList | join }} |
-
-
- Last Minute # ReadRequests |
- {{ .Counters.ReadRequests.MinuteCounter.ToList | join }} |
-
- {{ range $key, $val := .Stats }}
-
- {{ $key }} |
- {{ $val }} |
-
- {{ end }}
-
-
-
-
-
-
Volumes
-
-
-
- Id |
- Collection |
- Disk |
- Data Size |
- Files |
- Trash |
- TTL |
- ReadOnly |
-
-
-
- {{ range .Volumes }}
-
- {{ .Id }} |
- {{ .Collection }} |
- {{ .DiskType }} |
- {{ bytesToHumanReadable .Size }} |
- {{ .FileCount }} |
- {{ .DeleteCount }} / {{bytesToHumanReadable .DeletedByteCount}} |
- {{ .Ttl }} |
- {{ .ReadOnly }} |
-
- {{ end }}
-
-
-
-
-
-
Remote Volumes
-
-
-
- Id |
- Collection |
- Size |
- Files |
- Trash |
- Remote |
- Key |
-
-
-
- {{ range .RemoteVolumes }}
-
- {{ .Id }} |
- {{ .Collection }} |
- {{ bytesToHumanReadable .Size }} |
- {{ .FileCount }} |
- {{ .DeleteCount }} / {{bytesToHumanReadable .DeletedByteCount}} |
- {{ .RemoteStorageName }} |
- {{ .RemoteStorageKey }} |
-
- {{ end }}
-
-
-
-
-
-
Erasure Coding Shards
-
-
-
- Id |
- Collection |
- Shard Size |
- Shards |
- CreatedAt |
-
-
-
- {{ range .EcVolumes }}
-
- {{ .VolumeId }} |
- {{ .Collection }} |
- {{ bytesToHumanReadable .ShardSize }} |
- {{ .ShardIdList }} |
- {{ .CreatedAt.Format "02 Jan 06 15:04 -0700" }} |
-
- {{ end }}
-
-
-
+//go:embed volume.html
+var volumeHtml string
-
-
-
-`))
+var StatusTpl = template.Must(template.New("status").Funcs(funcMap).Parse(volumeHtml))
diff --git a/weed/server/volume_server_ui/volume.html b/weed/server/volume_server_ui/volume.html
new file mode 100644
index 000000000..973b0bfbe
--- /dev/null
+++ b/weed/server/volume_server_ui/volume.html
@@ -0,0 +1,194 @@
+
+
+
+ SeaweedFS {{ .Version }}
+
+
+
+
+
+
+
+
+
+
+
+
+
Disk Stats
+
+
+
+ Path |
+ Disk |
+ Total |
+ Free |
+ Usage |
+
+
+
+ {{ range .DiskStatuses }}
+
+ {{ .Dir }} |
+ {{ .DiskType }} |
+ {{ bytesToHumanReadable .All }} |
+ {{ bytesToHumanReadable .Free }} |
+ {{ percentFrom .All .Used}}% |
+
+ {{ end }}
+
+
+
+
+
+
System Stats
+
+
+ Masters |
+ {{.Masters}} |
+
+
+ Weekly # ReadRequests |
+ {{ .Counters.ReadRequests.WeekCounter.ToList | join }}
+ |
+
+
+ Daily # ReadRequests |
+ {{ .Counters.ReadRequests.DayCounter.ToList | join }}
+ |
+
+
+ Hourly # ReadRequests |
+ {{ .Counters.ReadRequests.HourCounter.ToList | join }}
+ |
+
+
+ Last Minute # ReadRequests |
+ {{ .Counters.ReadRequests.MinuteCounter.ToList | join }}
+ |
+
+ {{ range $key, $val := .Stats }}
+
+ {{ $key }} |
+ {{ $val }} |
+
+ {{ end }}
+
+
+
+
+
+
Volumes
+
+
+
+ Id |
+ Collection |
+ Disk |
+ Data Size |
+ Files |
+ Trash |
+ TTL |
+ ReadOnly |
+
+
+
+ {{ range .Volumes }}
+
+ {{ .Id }} |
+ {{ .Collection }} |
+ {{ .DiskType }} |
+ {{ bytesToHumanReadable .Size }} |
+ {{ .FileCount }} |
+ {{ .DeleteCount }} / {{bytesToHumanReadable .DeletedByteCount}} |
+ {{ .Ttl }} |
+ {{ .ReadOnly }} |
+
+ {{ end }}
+
+
+
+
+
+
Remote Volumes
+
+
+
+ Id |
+ Collection |
+ Size |
+ Files |
+ Trash |
+ Remote |
+ Key |
+
+
+
+ {{ range .RemoteVolumes }}
+
+ {{ .Id }} |
+ {{ .Collection }} |
+ {{ bytesToHumanReadable .Size }} |
+ {{ .FileCount }} |
+ {{ .DeleteCount }} / {{bytesToHumanReadable .DeletedByteCount}} |
+ {{ .RemoteStorageName }} |
+ {{ .RemoteStorageKey }} |
+
+ {{ end }}
+
+
+
+
+
+
Erasure Coding Shards
+
+
+
+ Id |
+ Collection |
+ Shard Size |
+ Shards |
+ CreatedAt |
+
+
+
+ {{ range .EcVolumes }}
+
+ {{ .VolumeId }} |
+ {{ .Collection }} |
+ {{ bytesToHumanReadable .ShardSize }} |
+ {{ .ShardIdList }} |
+ {{ .CreatedAt.Format "02 Jan 06 15:04 -0700" }} |
+
+ {{ end }}
+
+
+
+
+
+
+