package app import ( "fmt" "github.com/seaweedfs/seaweedfs/weed/admin/dash" ) templ EcVolumeDetails(data dash.EcVolumeDetailsData) {

EC Volume Details

Volume Information
if !data.IsComplete { }
Volume ID: {fmt.Sprintf("%d", data.VolumeID)}
Collection: if data.Collection != "" { {data.Collection} } else { default }
Status: if data.IsComplete { Complete ({data.TotalShards}/14 shards) } else { Incomplete ({data.TotalShards}/14 shards) }
Missing Shards: for i, shardID := range data.MissingShards { if i > 0 { , } {fmt.Sprintf("%02d", shardID)} }
Data Centers: for i, dc := range data.DataCenters { if i > 0 { , } {dc} }
Servers: {fmt.Sprintf("%d servers", len(data.Servers))}
Last Updated: {data.LastUpdated.Format("2006-01-02 15:04:05")}
Shard Distribution

{fmt.Sprintf("%d", data.TotalShards)}

Total Shards

{fmt.Sprintf("%d", len(data.DataCenters))}

Data Centers

{fmt.Sprintf("%d", len(data.Servers))}

Servers
Present Shards:
for _, shard := range data.Shards { {fmt.Sprintf("%02d", shard.ShardID)} }
if len(data.MissingShards) > 0 {
Missing Shards:
for _, shardID := range data.MissingShards { {fmt.Sprintf("%02d", shardID)} }
}
Shard Details
if len(data.Shards) > 0 { } else {
No EC shards found

This volume may not be EC encoded yet.

}
} // Helper function to convert bytes to human readable format (uint64 version) func bytesToHumanReadableUint64(bytes uint64) string { const unit = 1024 if bytes < unit { return fmt.Sprintf("%dB", bytes) } div, exp := uint64(unit), 0 for n := bytes / unit; n >= unit; n /= unit { div *= unit exp++ } return fmt.Sprintf("%.1f%cB", float64(bytes)/float64(div), "KMGTPE"[exp]) }