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)}
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 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 }
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 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) }