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

Cluster Collections

Total Collections
{fmt.Sprintf("%d", data.TotalCollections)}
Active Collections
{fmt.Sprintf("%d", countActiveCollections(data.Collections))}
Total Volumes
{fmt.Sprintf("%d", data.TotalVolumes)}
Total Files
{fmt.Sprintf("%d", data.TotalFiles)}
Total Storage Size
{formatBytes(data.TotalSize)}
Data Centers
{fmt.Sprintf("%d", countUniqueCollectionDataCenters(data.Collections))}
Collection Details
if len(data.Collections) > 0 {
for _, collection := range data.Collections { }
Collection Name Data Center Volumes Files Size Disk Types Status Actions
{collection.Name} {collection.DataCenter}
{fmt.Sprintf("%d", collection.VolumeCount)}
{fmt.Sprintf("%d", collection.FileCount)}
{formatBytes(collection.TotalSize)}
for i, diskType := range collection.DiskTypes { if i > 0 { } {diskType} } if len(collection.DiskTypes) == 0 { Unknown } {collection.Status}
} else {
No Collections Found

No collections are currently configured in the cluster.

}
Last updated: {data.LastUpdated.Format("2006-01-02 15:04:05")}
} func countActiveCollections(collections []dash.CollectionInfo) int { count := 0 for _, collection := range collections { if collection.Status == "active" { count++ } } return count } func countUniqueCollectionDataCenters(collections []dash.CollectionInfo) int { dcMap := make(map[string]bool) for _, collection := range collections { dcMap[collection.DataCenter] = true } return len(dcMap) } func getDiskTypeColor(diskType string) string { switch diskType { case "ssd": return "primary" case "hdd", "": return "secondary" default: return "info" } } func formatDiskTypes(diskTypes []string) string { if len(diskTypes) == 0 { return "Unknown" } if len(diskTypes) == 1 { return diskTypes[0] } // For multiple disk types, join with comma result := "" for i, diskType := range diskTypes { if i > 0 { result += ", " } result += diskType } return result }