Skip to content

Modern Docker Management, Designed for Everyone

refactor: remove image size from dashboard

Kyle Mendella0f8defe6dd9
diff --git a/frontend/src/routes/dashboard/+page.svelte b/frontend/src/routes/dashboard/+page.svelte
index 3ed13e816..86b9809bb 100644
--- a/frontend/src/routes/dashboard/+page.svelte
+++ b/frontend/src/routes/dashboard/+page.svelte
@@ -18,7 +18,7 @@
} from '@lucide/svelte';
import * as Alert from '$lib/components/ui/alert/index.js';
import { capitalizeFirstLetter } from '$lib/utils/string.utils';
- import { formatBytes } from '$lib/utils/bytes.util';
+ // Size display removed on dashboard
import { toast } from 'svelte-sonner';
import PruneConfirmationDialog from '$lib/components/dialogs/prune-confirmation-dialog.svelte';
import { handleApiResultWithCallbacks } from '$lib/utils/api.util';
@@ -86,11 +86,9 @@
? dashboardStates.containers.filter((c: ContainerInfo) => c.State !== 'running').length
: 0)
);
- const totalImageSize = $derived(
- dashboardStates.images?.reduce((sum, image) => sum + (image.Size || 0), 0) ?? 0
- );
const totalImages = $derived(dockerInfoRef?.images ?? dashboardStates.images?.length ?? 0);
const currentStats = $derived(dashboardStates.systemStats || liveSystemStats);
+ // Size totals removed; only show image count on dashboard
function addToHistoricalData(stats: SystemStats) {
const now = new Date();
@@ -639,8 +637,7 @@
{:else}
<p class="text-sm font-medium">Docker Images</p>
<p class="text-xs text-muted-foreground">
- {dashboardStates.dockerInfo?.images || 0} images •
- {formatBytes(totalImageSize)}
+ {dashboardStates.dockerInfo?.images || 0} images
</p>
{/if}
</div>
@@ -651,7 +648,6 @@
</DropdownCard>
</section>
- <!-- Resources -->
<section>
<h2 class="mb-4 text-lg font-semibold tracking-tight">Resources</h2>
<div class="grid grid-cols-1 gap-6 lg:grid-cols-2">
@@ -662,7 +658,6 @@
{getContainerDisplayName}
total={totalContainers}
/>
-
<DashboardImageTable
images={dashboardStates.images}
isLoading={isLoading.loadingImages}
diff --git a/frontend/src/routes/dashboard/+page.ts b/frontend/src/routes/dashboard/+page.ts
index cca3419cb..109be49fb 100644
--- a/frontend/src/routes/dashboard/+page.ts
+++ b/frontend/src/routes/dashboard/+page.ts
@@ -3,69 +3,69 @@ import type { SearchPaginationSortRequest } from '$lib/types/pagination.type';
import type { PageLoad } from './$types';
export const load: PageLoad = async () => {
- const containerRequestOptions: SearchPaginationSortRequest = {
- pagination: {
- page: 1,
- limit: 5
- },
- sort: {
- column: 'created',
- direction: 'desc' as const
- }
- },
- imageRequestOptions: SearchPaginationSortRequest = {
- pagination: {
- page: 1,
- limit: 5
- },
- sort: {
- column: 'Created',
- direction: 'desc' as const
- }
- };
+ const containerRequestOptions: SearchPaginationSortRequest = {
+ pagination: {
+ page: 1,
+ limit: 5
+ },
+ sort: {
+ column: 'created',
+ direction: 'desc' as const
+ }
+ },
+ imageRequestOptions: SearchPaginationSortRequest = {
+ pagination: {
+ page: 1,
+ limit: 5
+ },
+ sort: {
+ column: 'Created',
+ direction: 'desc' as const
+ }
+ };
- try {
- const [dockerInfoResult, containersResult, imagesResult, settingsResult] =
- await Promise.allSettled([
- systemAPI.getDockerInfo(),
- environmentAPI.getContainers(
- containerRequestOptions.pagination,
- containerRequestOptions.sort,
- containerRequestOptions.search,
- containerRequestOptions.filters
- ),
- environmentAPI.getImages(
- imageRequestOptions.pagination,
- imageRequestOptions.sort,
- imageRequestOptions.search,
- imageRequestOptions.filters
- ),
- settingsAPI.getSettings()
- ]);
+ try {
+ const [dockerInfoResult, containersResult, imagesResult, settingsResult] =
+ await Promise.allSettled([
+ systemAPI.getDockerInfo(),
+ environmentAPI.getContainers(
+ containerRequestOptions.pagination,
+ containerRequestOptions.sort,
+ containerRequestOptions.search,
+ containerRequestOptions.filters
+ ),
+ environmentAPI.getImages(
+ imageRequestOptions.pagination,
+ imageRequestOptions.sort,
+ imageRequestOptions.search,
+ imageRequestOptions.filters
+ ),
+ settingsAPI.getSettings()
+ ]);
- const dockerInfo = dockerInfoResult.status === 'fulfilled' ? dockerInfoResult.value : null;
- const containers = containersResult.status === 'fulfilled' ? containersResult.value : [];
- const images = imagesResult.status === 'fulfilled' ? imagesResult.value : [];
- const settings = settingsResult.status === 'fulfilled' ? settingsResult.value : null;
+ const dockerInfo = dockerInfoResult.status === 'fulfilled' ? dockerInfoResult.value : null;
+ const containers = containersResult.status === 'fulfilled' ? containersResult.value : [];
+ const images = imagesResult.status === 'fulfilled' ? imagesResult.value : [];
+ const settings = settingsResult.status === 'fulfilled' ? settingsResult.value : null;
- return {
- dockerInfo,
- containers,
- images,
- settings,
- containerRequestOptions,
- imageRequestOptions
- };
- } catch (error) {
- console.error('Error loading dashboard data:', error);
- return {
- dockerInfo: null,
- containers: [],
- images: [],
- settings: null,
- containerRequestOptions,
- imageRequestOptions,
- error: error instanceof Error ? error.message : String(error)
- };
- }
+ return {
+ dockerInfo,
+ containers,
+ images,
+ settings,
+ containerRequestOptions,
+ imageRequestOptions
+ };
+ } catch (error) {
+ console.error('Error loading dashboard data:', error);
+ return {
+ dockerInfo: null,
+ containers: [],
+ images: [],
+ settings: null,
+ containerRequestOptions,
+ imageRequestOptions,
+ error: error instanceof Error ? error.message : String(error)
+ };
+ }
};
diff --git a/frontend/src/routes/dashboard/dash-image-table.svelte b/frontend/src/routes/dashboard/dash-image-table.svelte
index 9dc1b5c45..25c3cc0d7 100644
--- a/frontend/src/routes/dashboard/dash-image-table.svelte
+++ b/frontend/src/routes/dashboard/dash-image-table.svelte
@@ -6,7 +6,6 @@
import * as Card from '$lib/components/ui/card/index.js';
import * as Table from '$lib/components/ui/table';
import StatusBadge from '$lib/components/badges/status-badge.svelte';
- import { formatBytes } from '$lib/utils/bytes.util';
import type { SearchPaginationSortRequest, Paginated } from '$lib/types/pagination.type';
interface ImageWithId extends EnhancedImageInfo {
@@ -17,12 +16,14 @@
images,
isLoading,
onRefresh,
- total = images.length
+ total = images.length,
+ totalBytes
}: {
images: EnhancedImageInfo[];
isLoading: boolean;
onRefresh: (options: SearchPaginationSortRequest) => Promise<Paginated<ImageWithId>>;
total?: number;
+ totalBytes?: number;
} = $props();
let requestOptions = $state<SearchPaginationSortRequest>({
@@ -48,6 +49,8 @@
itemsPerPage: 5
}
});
+
+ // Size display removed on dashboard; keep sorting by size to show largest but do not render sizes
</script>
<Card.Root class="relative flex flex-col rounded-lg border shadow-sm">
@@ -59,10 +62,12 @@
</Card.Title>
<Card.Description class="pb-2">Top 5 Largest Images</Card.Description>
</div>
- <Button variant="ghost" size="sm" href="/images" disabled={isLoading}>
- View All
- <ArrowRight class="ml-2 size-4" />
- </Button>
+ <div class="flex items-center gap-3">
+ <Button variant="ghost" size="sm" href="/images" disabled={isLoading}>
+ View All
+ <ArrowRight class="ml-2 size-4" />
+ </Button>
+ </div>
</div>
</Card.Header>
<Card.Content class="flex-1 p-0">
@@ -85,8 +90,7 @@
columns={[
{ label: 'Name', sortColumn: 'RepoTags' },
{ label: 'Status', sortColumn: 'InUse' },
- { label: 'Tag', sortColumn: 'tag' },
- { label: 'Size', sortColumn: 'Size' }
+ { label: 'Tag', sortColumn: 'tag' }
]}
filterPlaceholder="Search images..."
noResultsMessage="No images found"
@@ -119,7 +123,7 @@
<span class="text-muted-foreground italic">&lt;none&gt;</span>
{/if}
</Table.Cell>
- <Table.Cell class="py-3 md:py-3.5">{formatBytes(item.Size || 0)}</Table.Cell>
+ <!-- Size column removed on dashboard -->
{/snippet}
</ArcaneTable>
{#if images.length > 5}
diff --git a/frontend/src/routes/images/+page.svelte b/frontend/src/routes/images/+page.svelte
index fffbde3d5..eb5d3bae8 100644
--- a/frontend/src/routes/images/+page.svelte
+++ b/frontend/src/routes/images/+page.svelte
@@ -7,6 +7,7 @@
import * as Card from '$lib/components/ui/card/index.js';
import { toast } from 'svelte-sonner';
import ImagePullSheet from '$lib/components/sheets/image-pull-sheet.svelte';
+ import { sumImageDisplayedBytes } from '$lib/utils/images.util';
import { formatBytes } from '$lib/utils/bytes.util';
import * as Dialog from '$lib/components/ui/dialog/index.js';
import { handleApiResultWithCallbacks } from '$lib/utils/api.util';
@@ -38,6 +39,7 @@
let isConfirmPruneDialogOpen = $state(false);
const totalSize = $derived(images?.reduce((acc, img) => acc + (img.Size || 0), 0) || 0);
+ const totalDisplayedSize = $derived(formatBytes(sumImageDisplayedBytes(images)));
async function loadImages() {
try {
diff --git a/frontend/src/routes/images/image-table.svelte b/frontend/src/routes/images/image-table.svelte
index c2633678e..6cd1b015c 100644
--- a/frontend/src/routes/images/image-table.svelte
+++ b/frontend/src/routes/images/image-table.svelte
@@ -311,7 +311,9 @@
>{item.Id?.substring(7, 19) || 'N/A'}</code
>
</Table.Cell>
- <Table.Cell>{formatBytes(item.Size || 0)}</Table.Cell>
+ <Table.Cell class="py-3 md:py-3.5"
+ >{formatBytes(item.Size ?? item.VirtualSize ?? 0)}</Table.Cell
+ >
<Table.Cell>{new Date((item.Created || 0) * 1000).toLocaleDateString()}</Table.Cell>
<Table.Cell>
{#if item.InUse}