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

Cluster Volumes

Total Volumes
{fmt.Sprintf("%d", data.TotalVolumes)}
Active Volumes
{fmt.Sprintf("%d", countActiveVolumes(data.Volumes))}
Data Centers
{fmt.Sprintf("%d", countUniqueDataCenters(data.Volumes))}
Total Size
{formatBytes(data.TotalSize)}
Volume Details
if len(data.Volumes) > 0 {
Showing {fmt.Sprintf("%d", (data.CurrentPage-1)*data.PageSize + 1)} to {fmt.Sprintf("%d", minInt(data.CurrentPage*data.PageSize, data.TotalVolumes))} of {fmt.Sprintf("%d", data.TotalVolumes)} volumes
if data.TotalPages > 1 {
Page {fmt.Sprintf("%d", data.CurrentPage)} of {fmt.Sprintf("%d", data.TotalPages)}
}
if data.TotalPages > 1 {
} } else {
No Volumes Found

No volumes are currently available in the cluster.

}
Last updated: {data.LastUpdated.Format("2006-01-02 15:04:05")}
} func countActiveVolumes(volumes []dash.VolumeInfo) int { count := 0 for _, volume := range volumes { if volume.Status == "active" { count++ } } return count } func countUniqueDataCenters(volumes []dash.VolumeInfo) int { dcMap := make(map[string]bool) for _, volume := range volumes { dcMap[volume.DataCenter] = true } return len(dcMap) } templ getSortIcon(column, currentSort, currentOrder string) { if column != currentSort { } else if currentOrder == "asc" { } else { } } func minInt(a, b int) int { if a < b { return a } return b } func maxInt(a, b int) int { if a > b { return a } return b }