package app import ( "fmt" "time" "github.com/seaweedfs/seaweedfs/weed/admin/dash" ) templ VolumeDetails(data dash.VolumeDetailsData) {

Volume Details

Volume Information
{fmt.Sprintf("%d", data.Volume.Id)}
{data.Volume.DataCenter}
{data.Volume.Rack}
if data.Volume.Collection == "" { default } else { {data.Volume.Collection} }
{fmt.Sprintf("%03d", data.Volume.ReplicaPlacement)}
if data.Volume.DiskType == "" { hdd } else { {data.Volume.DiskType} }
{fmt.Sprintf("v%d", data.Volume.Version)}
Volume Statistics & Health
{formatBytes(int64(data.Volume.Size - data.Volume.DeletedByteCount))}
Active Bytes
{formatBytes(int64(data.Volume.DeletedByteCount))}
Deleted Bytes
{fmt.Sprintf("%d", data.Volume.FileCount)}
Active Files
{fmt.Sprintf("%d", data.Volume.DeleteCount)}
Deleted Files
if data.Volume.FileCount > 0 && data.Volume.Size > 0 {
Storage Efficiency {fmt.Sprintf("%.1f%%", float64(data.Volume.Size-data.Volume.DeletedByteCount)/float64(data.Volume.Size)*100)}
}
if data.Volume.ReadOnly { Read Only if data.Volume.Size >= data.VolumeSizeLimit {
Size limit exceeded
} } else if data.VolumeSizeLimit > data.Volume.Size { Read/Write } else { Size Limit Reached }
#{fmt.Sprintf("%d", data.Volume.CompactRevision)}
Vacuum Revision
if data.Volume.ModifiedAtSecond > 0 { {formatTimestamp(data.Volume.ModifiedAtSecond)} } else { Never modified }
Last Modified
if data.Volume.Ttl > 0 {
{formatTTL(data.Volume.Ttl)}
Time To Live
} if data.Volume.RemoteStorageName != "" {
{data.Volume.RemoteStorageName}
Remote Storage
if data.Volume.RemoteStorageKey != "" {
{data.Volume.RemoteStorageKey}
Storage Key
} }
if len(data.Replicas) > 0 {
Replicas ({fmt.Sprintf("%d", data.ReplicationCount)})
for _, replica := range data.Replicas { }
Server Data Center Rack Size File Count Status Actions
{data.Volume.Server} Primary {data.Volume.DataCenter} {data.Volume.Rack} {formatBytes(int64(data.Volume.Size))} {fmt.Sprintf("%d", data.Volume.FileCount)} Active Current Volume
{replica.Server} {replica.DataCenter} {replica.Rack} {formatBytes(int64(replica.Size))} {fmt.Sprintf("%d", replica.FileCount)} Replica View
}
Actions
Use these actions to perform maintenance operations on the volume.
Last updated: {data.LastUpdated.Format("2006-01-02 15:04:05")}
} func formatTimestamp(unixTimestamp int64) string { if unixTimestamp <= 0 { return "Never" } t := time.Unix(unixTimestamp, 0) return t.Format("2006-01-02 15:04:05") } func formatTTL(ttlSeconds uint32) string { if ttlSeconds == 0 { return "No TTL" } duration := time.Duration(ttlSeconds) * time.Second // Convert to human readable format days := int(duration.Hours()) / 24 hours := int(duration.Hours()) % 24 minutes := int(duration.Minutes()) % 60 if days > 0 { if hours > 0 { return fmt.Sprintf("%dd %dh", days, hours) } return fmt.Sprintf("%d days", days) } else if hours > 0 { if minutes > 0 { return fmt.Sprintf("%dh %dm", hours, minutes) } return fmt.Sprintf("%d hours", hours) } else if minutes > 0 { return fmt.Sprintf("%d minutes", minutes) } else { return fmt.Sprintf("%d seconds", int(duration.Seconds())) } }