Skip to content

Modern Docker Management, Designed for Everyone

feat: show volume size in table (#685)

Kyle Mendelldd5bba94cfbd
diff --git a/backend/internal/api/volume_handler.go b/backend/internal/api/volume_handler.go
index baae82cef..9b7159416 100644
--- a/backend/internal/api/volume_handler.go
+++ b/backend/internal/api/volume_handler.go
@@ -39,7 +39,7 @@ func (h *VolumeHandler) List(c *gin.Context) {
params.Limit = 20
}
- volumes, paginationResp, err := h.volumeService.ListVolumesPaginated(c.Request.Context(), params)
+ volumes, paginationResp, counts, err := h.volumeService.ListVolumesPaginated(c.Request.Context(), params)
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{
"success": false,
@@ -57,6 +57,7 @@ func (h *VolumeHandler) List(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{
"success": true,
"data": volumes,
+ "counts": counts,
"pagination": paginationResp,
})
}
diff --git a/backend/internal/dto/volume_dto.go b/backend/internal/dto/volume_dto.go
index e14423eed..29f3c1798 100644
--- a/backend/internal/dto/volume_dto.go
+++ b/backend/internal/dto/volume_dto.go
@@ -2,6 +2,11 @@ package dto
import "github.com/docker/docker/api/types/volume"
+type VolumeUsageData struct {
+ Size int64 `json:"size"`
+ RefCount int64 `json:"refCount"`
+}
+
type VolumeDto struct {
ID string `json:"id"`
Name string `json:"name"`
@@ -12,10 +17,12 @@ type VolumeDto struct {
Labels map[string]string `json:"labels"`
CreatedAt string `json:"createdAt"`
InUse bool `json:"inUse"`
+ UsageData *VolumeUsageData `json:"usageData,omitempty"`
+ Size int64 `json:"size"`
}
-func NewVolumeDto(v volume.Volume, inUse bool) VolumeDto {
- return VolumeDto{
+func NewVolumeDto(v volume.Volume) VolumeDto {
+ dto := VolumeDto{
ID: v.Name,
Name: v.Name,
Driver: v.Driver,
@@ -24,8 +31,23 @@ func NewVolumeDto(v volume.Volume, inUse bool) VolumeDto {
Options: v.Options,
Labels: v.Labels,
CreatedAt: v.CreatedAt,
- InUse: inUse,
}
+
+ if v.UsageData != nil {
+ dto.UsageData = &VolumeUsageData{
+ Size: v.UsageData.Size,
+ RefCount: v.UsageData.RefCount,
+ }
+ dto.Size = v.UsageData.Size
+ if v.UsageData.RefCount >= 1 {
+ dto.InUse = true
+ } else {
+ dto.InUse = false
+ }
+
+ }
+
+ return dto
}
type VolumeUsageCounts struct {
diff --git a/backend/internal/services/volume_service.go b/backend/internal/services/volume_service.go
index 75a82c790..c73db8967 100644
--- a/backend/internal/services/volume_service.go
+++ b/backend/internal/services/volume_service.go
@@ -3,15 +3,15 @@ package services
import (
"context"
"fmt"
+ "log/slog"
"strings"
- "github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/filters"
"github.com/docker/docker/api/types/volume"
- "github.com/docker/docker/client"
"github.com/ofkm/arcane-backend/internal/database"
"github.com/ofkm/arcane-backend/internal/dto"
"github.com/ofkm/arcane-backend/internal/models"
+ "github.com/ofkm/arcane-backend/internal/utils/docker"
"github.com/ofkm/arcane-backend/internal/utils/pagination"
)
@@ -29,30 +29,6 @@ func NewVolumeService(db *database.DB, dockerService *DockerClientService, event
}
}
-func (s *VolumeService) containersUsingVolume(ctx context.Context, dockerClient *client.Client, name string) (bool, []string, error) {
- containers, err := dockerClient.ContainerList(ctx, container.ListOptions{All: true})
- if err != nil {
- return false, nil, fmt.Errorf("failed to list containers: %w", err)
- }
-
- inUse := false
- var using []string
- for _, c := range containers {
- info, err := dockerClient.ContainerInspect(ctx, c.ID)
- if err != nil {
- continue
- }
- for _, m := range info.Mounts {
- if m.Type == "volume" && m.Name == name {
- inUse = true
- using = append(using, c.ID)
- break
- }
- }
- }
- return inUse, using, nil
-}
-
func (s *VolumeService) GetVolumeByName(ctx context.Context, name string) (*dto.VolumeDto, error) {
dockerClient, err := s.dockerService.CreateConnection(ctx)
if err != nil {
@@ -65,9 +41,24 @@ func (s *VolumeService) GetVolumeByName(ctx context.Context, name string) (*dto.
return nil, fmt.Errorf("volume not found: %w", err)
}
- inUse, _, _ := s.containersUsingVolume(ctx, dockerClient, vol.Name)
+ if usageVolumes, duErr := docker.GetVolumeUsageData(ctx, dockerClient); duErr == nil {
+ for _, uv := range usageVolumes {
+ if uv.Name == vol.Name && uv.UsageData != nil {
+ vol.UsageData = uv.UsageData
+ slog.DebugContext(ctx, "attached volume usage data",
+ slog.String("volume", vol.Name),
+ slog.Int64("size_bytes", uv.UsageData.Size),
+ slog.Int64("ref_count", uv.UsageData.RefCount))
+ break
+ }
+ }
+ } else {
+ slog.WarnContext(ctx, "failed to load volume usage data",
+ slog.String("volume", vol.Name),
+ slog.String("error", duErr.Error()))
+ }
- v := dto.NewVolumeDto(vol, inUse)
+ v := dto.NewVolumeDto(vol)
return &v, nil
}
@@ -94,10 +85,14 @@ func (s *VolumeService) CreateVolume(ctx context.Context, options volume.CreateO
"name": vol.Name,
}
if logErr := s.eventService.LogVolumeEvent(ctx, models.EventTypeVolumeCreate, vol.Name, vol.Name, user.ID, user.Username, "0", metadata); logErr != nil {
- fmt.Printf("Could not log volume creation action: %s\n", logErr)
+ slog.WarnContext(ctx, "could not log volume creation action",
+ slog.String("volume", vol.Name),
+ slog.String("error", logErr.Error()))
}
- dtoVol := dto.NewVolumeDto(vol, false)
+ docker.InvalidateVolumeUsageCache()
+
+ dtoVol := dto.NewVolumeDto(vol)
return &dtoVol, nil
}
@@ -118,9 +113,14 @@ func (s *VolumeService) DeleteVolume(ctx context.Context, name string, force boo
"force": force,
}
if logErr := s.eventService.LogVolumeEvent(ctx, models.EventTypeVolumeDelete, name, name, user.ID, user.Username, "0", metadata); logErr != nil {
- fmt.Printf("Could not log volume deletion action: %s\n", logErr)
+ slog.WarnContext(ctx, "could not log volume deletion action",
+ slog.String("volume", name),
+ slog.String("error", logErr.Error()))
}
+ //
+ docker.InvalidateVolumeUsageCache()
+
return nil
}
@@ -161,9 +161,12 @@ func (s *VolumeService) PruneVolumesWithOptions(ctx context.Context, all bool) (
"spaceReclaimed": report.SpaceReclaimed,
}
if logErr := s.eventService.LogVolumeEvent(ctx, models.EventTypeVolumeDelete, "", "bulk_prune", systemUser.ID, systemUser.Username, "0", metadata); logErr != nil {
- fmt.Printf("Could not log volume prune action: %s\n", logErr)
+ slog.WarnContext(ctx, "could not log volume prune action",
+ slog.String("error", logErr.Error()))
}
+ docker.InvalidateVolumeUsageCache()
+
return &dto.VolumePruneReportDto{
VolumesDeleted: report.VolumesDeleted,
SpaceReclaimed: report.SpaceReclaimed,
@@ -177,128 +180,147 @@ func (s *VolumeService) GetVolumeUsage(ctx context.Context, name string) (bool,
}
defer dockerClient.Close()
- if _, err := dockerClient.VolumeInspect(ctx, name); err != nil {
- return false, nil, fmt.Errorf("volume not found: %w", err)
- }
-
- inUse, usingContainers, err := s.containersUsingVolume(ctx, dockerClient, name)
- if err != nil {
- return false, nil, err
- }
- return inUse, usingContainers, nil
-}
-
-func (s *VolumeService) ListVolumesPaginated(ctx context.Context, params pagination.QueryParams) ([]dto.VolumeDto, pagination.Response, error) {
- dockerClient, err := s.dockerService.CreateConnection(ctx)
+ vol, err := dockerClient.VolumeInspect(ctx, name)
if err != nil {
- return nil, pagination.Response{}, fmt.Errorf("failed to connect to Docker: %w", err)
+ return false, nil, fmt.Errorf("volume not found: %w", err)
}
- defer dockerClient.Close()
- // Get all containers ONCE
- containers, err := dockerClient.ContainerList(ctx, container.ListOptions{All: true})
- if err != nil {
- return nil, pagination.Response{}, fmt.Errorf("failed to list containers: %w", err)
+ usageVolumes, duErr := docker.GetVolumeUsageData(ctx, dockerClient)
+ if duErr != nil {
+ return false, nil, fmt.Errorf("failed to get volume usage data: %w", duErr)
}
- // Build inUse map in a single pass
- inUseMap := make(map[string]bool)
- for _, c := range containers {
- for _, m := range c.Mounts {
- if m.Type == "volume" && m.Name != "" {
- inUseMap[m.Name] = true
- }
+ for _, uv := range usageVolumes {
+ if uv.Name == vol.Name && uv.UsageData != nil {
+ inUse := uv.UsageData.RefCount >= 1
+ return inUse, nil, nil
}
}
- // List all volumes
- volListBody, err := dockerClient.VolumeList(ctx, volume.ListOptions{})
- if err != nil {
- return nil, pagination.Response{}, fmt.Errorf("failed to list Docker volumes: %w", err)
- }
+ return false, nil, nil
+}
- volumes := make([]volume.Volume, 0, len(volListBody.Volumes))
- for _, v := range volListBody.Volumes {
+func (s *VolumeService) enrichVolumesWithUsageData(volumes []*volume.Volume, usageVolumes []volume.Volume) []volume.Volume {
+ result := make([]volume.Volume, 0, len(volumes))
+ for _, v := range volumes {
if v != nil {
- volumes = append(volumes, *v)
- }
- }
+ for _, uv := range usageVolumes {
+ if uv.Name == v.Name && uv.UsageData != nil {
+ v.UsageData = uv.UsageData
+ break
+ }
+ }
- // Build DTOs using the inUse map (O(1) lookup)
- items := make([]dto.VolumeDto, 0, len(volumes))
- for _, v := range volumes {
- items = append(items, dto.NewVolumeDto(v, inUseMap[v.Name]))
+ result = append(result, *v)
+ }
}
+ return result
+}
- config := pagination.Config[dto.VolumeDto]{
+func (s *VolumeService) buildVolumePaginationConfig() pagination.Config[dto.VolumeDto] {
+ return pagination.Config[dto.VolumeDto]{
SearchAccessors: []pagination.SearchAccessor[dto.VolumeDto]{
func(v dto.VolumeDto) (string, error) { return v.Name, nil },
func(v dto.VolumeDto) (string, error) { return v.Driver, nil },
func(v dto.VolumeDto) (string, error) { return v.Mountpoint, nil },
func(v dto.VolumeDto) (string, error) { return v.Scope, nil },
},
- SortBindings: []pagination.SortBinding[dto.VolumeDto]{
- {
- Key: "name",
- Fn: func(a, b dto.VolumeDto) int {
- return strings.Compare(a.Name, b.Name)
- },
- },
- {
- Key: "driver",
- Fn: func(a, b dto.VolumeDto) int {
- return strings.Compare(a.Driver, b.Driver)
- },
- },
- {
- Key: "mountpoint",
- Fn: func(a, b dto.VolumeDto) int {
- return strings.Compare(a.Mountpoint, b.Mountpoint)
- },
- },
- {
- Key: "scope",
- Fn: func(a, b dto.VolumeDto) int {
- return strings.Compare(a.Scope, b.Scope)
- },
- },
- {
- Key: "created",
- Fn: func(a, b dto.VolumeDto) int {
- return strings.Compare(a.CreatedAt, b.CreatedAt)
- },
- },
- {
- Key: "inUse",
- Fn: func(a, b dto.VolumeDto) int {
- if a.InUse == b.InUse {
- return 0
- }
- if a.InUse {
- return -1
- }
- return 1
- },
+ SortBindings: s.buildVolumeSortBindings(),
+ FilterAccessors: s.buildVolumeFilterAccessors(),
+ }
+}
+
+func (s *VolumeService) buildVolumeSortBindings() []pagination.SortBinding[dto.VolumeDto] {
+ return []pagination.SortBinding[dto.VolumeDto]{
+ {
+ Key: "name",
+ Fn: func(a, b dto.VolumeDto) int { return strings.Compare(a.Name, b.Name) },
+ },
+ {
+ Key: "driver",
+ Fn: func(a, b dto.VolumeDto) int { return strings.Compare(a.Driver, b.Driver) },
+ },
+ {
+ Key: "mountpoint",
+ Fn: func(a, b dto.VolumeDto) int { return strings.Compare(a.Mountpoint, b.Mountpoint) },
+ },
+ {
+ Key: "scope",
+ Fn: func(a, b dto.VolumeDto) int { return strings.Compare(a.Scope, b.Scope) },
+ },
+ {
+ Key: "created",
+ Fn: func(a, b dto.VolumeDto) int { return strings.Compare(a.CreatedAt, b.CreatedAt) },
+ },
+ {
+ Key: "inUse",
+ Fn: func(a, b dto.VolumeDto) int {
+ if a.InUse == b.InUse {
+ return 0
+ }
+ if a.InUse {
+ return -1
+ }
+ return 1
},
},
- FilterAccessors: []pagination.FilterAccessor[dto.VolumeDto]{
- {
- Key: "inUse",
- Fn: func(v dto.VolumeDto, filterValue string) bool {
- if filterValue == "true" {
- return v.InUse
- }
- if filterValue == "false" {
- return !v.InUse
- }
- return true
- },
+ {
+ Key: "size",
+ Fn: s.compareVolumeSizes,
+ },
+ }
+}
+
+func (s *VolumeService) compareVolumeSizes(a, b dto.VolumeDto) int {
+ aSize := int64(-1)
+ bSize := int64(-1)
+ if a.UsageData != nil {
+ aSize = a.UsageData.Size
+ }
+ if b.UsageData != nil {
+ bSize = b.UsageData.Size
+ }
+ if aSize == bSize {
+ return 0
+ }
+ if aSize < bSize {
+ return -1
+ }
+ return 1
+}
+
+func (s *VolumeService) buildVolumeFilterAccessors() []pagination.FilterAccessor[dto.VolumeDto] {
+ return []pagination.FilterAccessor[dto.VolumeDto]{
+ {
+ Key: "inUse",
+ Fn: func(v dto.VolumeDto, filterValue string) bool {
+ if filterValue == "true" {
+ return v.InUse
+ }
+ if filterValue == "false" {
+ return !v.InUse
+ }
+ return true
},
},
}
+}
- result := pagination.SearchOrderAndPaginate(items, params, config)
+func (s *VolumeService) calculateVolumeUsageCounts(items []dto.VolumeDto) dto.VolumeUsageCounts {
+ counts := dto.VolumeUsageCounts{
+ Total: len(items),
+ }
+ for _, v := range items {
+ if v.InUse {
+ counts.Inuse++
+ } else {
+ counts.Unused++
+ }
+ }
+ return counts
+}
+func (s *VolumeService) buildPaginationResponse(result pagination.FilterResult[dto.VolumeDto], params pagination.QueryParams) pagination.Response {
totalPages := int64(0)
if params.Limit > 0 {
totalPages = (int64(result.TotalCount) + int64(params.Limit) - 1) / int64(params.Limit)
@@ -309,13 +331,45 @@ func (s *VolumeService) ListVolumesPaginated(ctx context.Context, params paginat
page = (params.Start / params.Limit) + 1
}
- paginationResp := pagination.Response{
+ return pagination.Response{
TotalPages: totalPages,
TotalItems: int64(result.TotalCount),
CurrentPage: page,
ItemsPerPage: params.Limit,
GrandTotalItems: int64(result.TotalAvailable),
}
+}
+
+func (s *VolumeService) ListVolumesPaginated(ctx context.Context, params pagination.QueryParams) ([]dto.VolumeDto, pagination.Response, dto.VolumeUsageCounts, error) {
+ dockerClient, err := s.dockerService.CreateConnection(ctx)
+ if err != nil {
+ return nil, pagination.Response{}, dto.VolumeUsageCounts{}, fmt.Errorf("failed to connect to Docker: %w", err)
+ }
+ defer dockerClient.Close()
+
+ volListBody, err := dockerClient.VolumeList(ctx, volume.ListOptions{})
+ if err != nil {
+ return nil, pagination.Response{}, dto.VolumeUsageCounts{}, fmt.Errorf("failed to list Docker volumes: %w", err)
+ }
+
+ usageVolumes, duErr := docker.GetVolumeUsageData(ctx, dockerClient)
+ if duErr != nil {
+ slog.WarnContext(ctx, "failed to load volume usage data",
+ slog.String("error", duErr.Error()))
+ usageVolumes = nil
+ }
+
+ volumes := s.enrichVolumesWithUsageData(volListBody.Volumes, usageVolumes)
+
+ items := make([]dto.VolumeDto, 0, len(volumes))
+ for _, v := range volumes {
+ items = append(items, dto.NewVolumeDto(v))
+ }
+
+ config := s.buildVolumePaginationConfig()
+ result := pagination.SearchOrderAndPaginate(items, params, config)
+ counts := s.calculateVolumeUsageCounts(items)
+ paginationResp := s.buildPaginationResponse(result, params)
- return result.Items, paginationResp, nil
+ return result.Items, paginationResp, counts, nil
}
diff --git a/backend/internal/utils/docker/volume_utils.go b/backend/internal/utils/docker/volume_utils.go
new file mode 100644
index 000000000..a98f0ae31
--- /dev/null
+++ b/backend/internal/utils/docker/volume_utils.go
@@ -0,0 +1,77 @@
+package docker
+
+import (
+ "context"
+ "fmt"
+ "log/slog"
+ "sync"
+ "time"
+
+ "github.com/docker/docker/api/types"
+ "github.com/docker/docker/api/types/volume"
+ "github.com/docker/docker/client"
+)
+
+var (
+ volumeUsageCache []volume.Volume
+ volumeUsageCacheMutex sync.RWMutex
+ volumeUsageCacheTime time.Time
+ volumeUsageCacheTTL = 30 * time.Second
+)
+
+func GetVolumeUsageData(ctx context.Context, dockerClient *client.Client) ([]volume.Volume, error) {
+ volumeUsageCacheMutex.RLock()
+ if time.Since(volumeUsageCacheTime) < volumeUsageCacheTTL && volumeUsageCache != nil {
+ cached := volumeUsageCache
+ volumeUsageCacheMutex.RUnlock()
+ slog.DebugContext(ctx, "returning cached volume usage data", slog.Int("volume_count", len(cached)))
+ return cached, nil
+ }
+ volumeUsageCacheMutex.RUnlock()
+
+ volumeUsageCacheMutex.Lock()
+ defer volumeUsageCacheMutex.Unlock()
+
+ if time.Since(volumeUsageCacheTime) < volumeUsageCacheTTL && volumeUsageCache != nil {
+ slog.DebugContext(ctx, "returning cached volume usage data after lock", slog.Int("volume_count", len(volumeUsageCache)))
+ return volumeUsageCache, nil
+ }
+ diskUsage, err := dockerClient.DiskUsage(ctx, types.DiskUsageOptions{
+ Types: []types.DiskUsageObject{types.VolumeObject},
+ })
+ if err != nil {
+ return nil, fmt.Errorf("failed to get disk usage: %w", err)
+ }
+
+ slog.DebugContext(ctx, "disk usage returned volumes", slog.Int("volume_count", len(diskUsage.Volumes)))
+
+ if diskUsage.Volumes == nil {
+ return []volume.Volume{}, nil
+ }
+
+ volumes := make([]volume.Volume, 0, len(diskUsage.Volumes))
+ for _, v := range diskUsage.Volumes {
+ if v != nil {
+ volumes = append(volumes, *v)
+ }
+ }
+
+ volumeUsageCache = volumes
+ volumeUsageCacheTime = time.Now()
+ slog.DebugContext(ctx, "refreshed volume usage cache", slog.Int("volume_count", len(volumes)))
+
+ return volumes, nil
+}
+
+func InvalidateVolumeUsageCache() {
+ volumeUsageCacheMutex.Lock()
+ defer volumeUsageCacheMutex.Unlock()
+ volumeUsageCache = nil
+ volumeUsageCacheTime = time.Time{}
+}
+
+func SetVolumeUsageCacheTTL(ttl time.Duration) {
+ volumeUsageCacheMutex.Lock()
+ defer volumeUsageCacheMutex.Unlock()
+ volumeUsageCacheTTL = ttl
+}
diff --git a/frontend/src/lib/components/stat-card.svelte b/frontend/src/lib/components/stat-card.svelte
index 17cbae440..9056aceb0 100644
--- a/frontend/src/lib/components/stat-card.svelte
+++ b/frontend/src/lib/components/stat-card.svelte
@@ -24,7 +24,12 @@
}: Props = $props();
</script>
-<div class={cn('group flex items-center justify-between gap-3 rounded-lg border bg-card p-4 transition-colors hover:bg-accent/50', className)}>
+<div
+ class={cn(
+ 'bg-card hover:bg-accent/50 group flex items-center justify-between gap-3 rounded-lg border p-4 transition-colors',
+ className
+ )}
+>
<div class="flex-1 space-y-1">
<p class="text-muted-foreground text-xs font-medium uppercase tracking-wide">{title}</p>
<p class="text-xl font-bold tabular-nums">{value}</p>
diff --git a/frontend/src/lib/types/volume.type.ts b/frontend/src/lib/types/volume.type.ts
index 31e6602fb..05390e3eb 100644
--- a/frontend/src/lib/types/volume.type.ts
+++ b/frontend/src/lib/types/volume.type.ts
@@ -1,3 +1,8 @@
+export interface VolumeUsageData {
+ size: number;
+ refCount: number;
+}
+
export interface VolumeSummaryDto {
id: string;
name: string;
@@ -8,6 +13,8 @@ export interface VolumeSummaryDto {
labels: Record<string, string>;
createdAt: string;
inUse: boolean;
+ usageData?: VolumeUsageData;
+ size: number;
}
export interface VolumeDetailDto extends VolumeSummaryDto {
diff --git a/frontend/src/routes/volumes/volume-table.svelte b/frontend/src/routes/volumes/volume-table.svelte
index d898bf8fa..9d88ca231 100644
--- a/frontend/src/routes/volumes/volume-table.svelte
+++ b/frontend/src/routes/volumes/volume-table.svelte
@@ -20,8 +20,10 @@
import { UniversalMobileCard } from '$lib/components/arcane-table/index.js';
import DatabaseIcon from '@lucide/svelte/icons/database';
import CalendarIcon from '@lucide/svelte/icons/calendar';
+ import HardDriveIcon from '@lucide/svelte/icons/hard-drive';
import { m } from '$lib/paraglide/messages';
import { volumeService } from '$lib/services/volume-service';
+ import bytes from 'bytes';
let {
volumes = $bindable(),
@@ -108,6 +110,12 @@
sortable: true,
cell: StatusCell
},
+ {
+ accessorKey: 'size',
+ title: m.images_size(),
+ sortable: true,
+ cell: SizeCell
+ },
{ accessorKey: 'createdAt', title: m.common_created(), sortable: true, cell: CreatedCell },
{ accessorKey: 'driver', title: m.common_driver(), sortable: true }
] satisfies ColumnSpec<VolumeSummaryDto>[];
@@ -115,6 +123,7 @@
const mobileFields = [
{ id: 'id', label: m.common_id(), defaultVisible: true },
{ id: 'status', label: m.common_status(), defaultVisible: true },
+ { id: 'size', label: m.images_size(), defaultVisible: true },
{ id: 'createdAt', label: m.common_created(), defaultVisible: true },
{ id: 'driver', label: m.common_driver(), defaultVisible: true }
];
@@ -136,6 +145,14 @@
{/if}
{/snippet}
+{#snippet SizeCell({ item }: { item: VolumeSummaryDto })}
+ {#if item.size >= 0}
+ <span class="text-sm tabular-nums">{bytes.format(item.size)}</span>
+ {:else}
+ <span class="text-muted-foreground text-sm">-</span>
+ {/if}
+{/snippet}
+
{#snippet CreatedCell({ value }: { value: unknown })}
{format(new Date(String(value)), 'PP p')}
{/snippet}
@@ -172,6 +189,14 @@
icon: DatabaseIcon,
iconVariant: 'gray' as const,
show: mobileFieldVisibility.driver ?? true
+ },
+ {
+ label: m.images_size(),
+ getValue: (item: VolumeSummaryDto) =>
+ item.usageData && item.usageData.size >= 0 ? bytes.format(item.usageData.size) : '-',
+ icon: HardDriveIcon,
+ iconVariant: 'gray' as const,
+ show: (mobileFieldVisibility.size ?? true) && !!item.usageData
}
]}
footer={(mobileFieldVisibility.createdAt ?? true)