Skip to content

Modern Docker Management, Designed for Everyone

chore: cleanup metric cards

Kyle Mendell9528cf6f63d6
diff --git a/frontend/src/lib/components/meter-metric.svelte b/frontend/src/lib/components/meter-metric.svelte
index 2b7a529ad..a25ef324c 100644
--- a/frontend/src/lib/components/meter-metric.svelte
+++ b/frontend/src/lib/components/meter-metric.svelte
@@ -1,6 +1,6 @@
<script lang="ts">
- import * as Card from '$lib/components/ui/card/index.js';
import Meter from '$lib/components/ui/meter/meter.svelte';
+ import type { icons, Icon as IconType } from '@lucide/svelte';
interface MetricDataPoint {
date: Date;
@@ -11,25 +11,24 @@
title: string;
description?: string;
currentValue: number;
- data: MetricDataPoint[];
unit?: string;
formatValue?: (value: number) => string;
- color?: string;
maxValue?: number;
+ icon: typeof IconType;
}
let {
title,
description,
currentValue,
- data,
unit = '',
formatValue = (v) => `${v.toFixed(1)}${unit}`,
- color = 'var(--chart-1)',
- maxValue = 100
+ maxValue = 100,
+ icon
}: Props = $props();
const percentage = $derived((currentValue / maxValue) * 100);
+ const Icon = icon;
</script>
<div
@@ -43,7 +42,7 @@
<div
class="flex h-10 w-10 items-center justify-center rounded-full bg-gradient-to-br from-primary to-primary/80 shadow-lg shadow-primary/25"
>
- <div class="text-sm font-bold text-primary-foreground">📊</div>
+ <Icon />
</div>
<div>
<div class="text-sm font-semibold text-gray-900 dark:text-gray-100">{title}</div>
diff --git a/frontend/src/routes/dashboard/+page.svelte b/frontend/src/routes/dashboard/+page.svelte
index c8a9218bf..05d3493d3 100644
--- a/frontend/src/routes/dashboard/+page.svelte
+++ b/frontend/src/routes/dashboard/+page.svelte
@@ -11,7 +11,10 @@
Monitor,
PlayCircle,
StopCircle,
- Trash2
+ Trash2,
+ MemoryStick,
+ Cpu,
+ Container
} from '@lucide/svelte';
import * as Alert from '$lib/components/ui/alert/index.js';
import { capitalizeFirstLetter } from '$lib/utils/string.utils';
@@ -27,7 +30,6 @@
import DropdownCard from '$lib/components/dropdown-card.svelte';
import MeterMetric from '$lib/components/meter-metric.svelte';
import DockerIcon from '$lib/icons/docker-icon.svelte';
- import GitHubIcon from '$lib/icons/github-icon.svelte';
import type { SystemStats } from '$lib/models/system-stats';
import type { ContainerInfo } from '$lib/models/container-info';
import type { SearchPaginationSortRequest } from '$lib/types/pagination.type';
@@ -399,11 +401,10 @@
<div class="grid grid-cols-2 gap-4 md:grid-cols-4">
<MeterMetric
title="Running Containers"
+ icon={Container}
description="Active containers"
currentValue={runningContainers}
- data={historicalData.containers}
formatValue={(v) => v.toString()}
- color="var(--chart-1)"
maxValue={dashboardStates.containers?.length || 10}
unit="containers"
/>
@@ -411,11 +412,10 @@
{#if currentStats?.cpuUsage !== undefined}
<MeterMetric
title="CPU Usage"
+ icon={Cpu}
description="Processor utilization"
currentValue={currentStats.cpuUsage}
- data={historicalData.cpu}
unit="%"
- color="var(--chart-2)"
maxValue={100}
/>
{/if}
@@ -423,25 +423,23 @@
{#if currentStats?.memoryUsage !== undefined && currentStats?.memoryTotal !== undefined}
<MeterMetric
title="Memory Usage"
+ icon={MemoryStick}
description="RAM utilization"
currentValue={(currentStats.memoryUsage / currentStats.memoryTotal) * 100}
- data={historicalData.memory}
unit="%"
formatValue={(v) => `${v.toFixed(1)}`}
- color="var(--chart-3)"
maxValue={100}
/>
{/if}
{#if currentStats?.diskUsage !== undefined && currentStats?.diskTotal !== undefined}
<MeterMetric
+ icon={HardDrive}
title="Disk Usage"
description="Storage utilization"
currentValue={(currentStats.diskUsage / currentStats.diskTotal) * 100}
- data={historicalData.disk}
unit="%"
formatValue={(v) => `${v.toFixed(1)}`}
- color="var(--chart-4)"
maxValue={100}
/>
{/if}
@@ -602,24 +600,6 @@
</div>
</section>
- <section class="mt-10 border-t pt-4">
- <div class="text-muted-foreground flex items-center justify-between text-sm">
- <div class="flex items-center">
- <a
- href="https://github.com/ofkm/arcane"
- target="_blank"
- rel="noopener noreferrer"
- class="hover:text-foreground transition-colors"
- title="GitHub"
- >
- <GitHubIcon class="size-4 fill-current" />
- <span class="sr-only">GitHub</span>
- </a>
- </div>
- <div></div>
- </div>
- </section>
-
<PruneConfirmationDialog
bind:open={dashboardStates.isPruneDialogOpen}
isPruning={isLoading.pruning}