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

Object Store Buckets

Total Buckets
{fmt.Sprintf("%d", data.TotalBuckets)}
Total Storage
{formatBytes(data.TotalSize)}
Active Buckets
{fmt.Sprintf("%d", countActiveBuckets(data.Buckets))}
Last Updated
{data.LastUpdated.Format("15:04:05")}
Object Store Buckets
for _, bucket := range data.Buckets { } if len(data.Buckets) == 0 { }
Name Created Objects Size Quota Status Actions
{bucket.Name} {bucket.CreatedAt.Format("2006-01-02 15:04")} {fmt.Sprintf("%d", bucket.ObjectCount)} {formatBytes(bucket.Size)} if bucket.Quota > 0 {
{formatBytes(bucket.Quota)} if bucket.QuotaEnabled {
{fmt.Sprintf("%.1f%% used", float64(bucket.Size)/float64(bucket.Quota)*100)}
} else {
Disabled
}
} else { No quota }
{bucket.Status}
No Object Store buckets found

Create your first bucket to get started with S3 storage.

Last updated: {data.LastUpdated.Format("2006-01-02 15:04:05")}
} // Helper functions for template func getBucketStatusColor(status string) string { switch status { case "active": return "success" case "error": return "danger" case "warning": return "warning" default: return "secondary" } } func countActiveBuckets(buckets []dash.S3Bucket) int { count := 0 for _, bucket := range buckets { if bucket.Status == "active" { count++ } } return count } func getQuotaStatusColor(used, quota int64, enabled bool) string { if !enabled || quota <= 0 { return "secondary" } percentage := float64(used) / float64(quota) * 100 if percentage >= 90 { return "danger" } else if percentage >= 75 { return "warning" } else { return "success" } } func getQuotaInMB(quotaBytes int64) int64 { if quotaBytes < 0 { quotaBytes = -quotaBytes // Handle disabled quotas (negative values) } return quotaBytes / (1024 * 1024) }