Skip to content

Commit 0805c33

Browse files
author
giulio.savini
committed
fix: light mode contrast for container stats CPU/memory monitor (#2341)
1 parent 6f74709 commit 0805c33

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

frontend/src/routes/(app)/containers/components/ContainerLogStatMonitor.svelte

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@
1818
1919
let { icon, label, value, detail, history, tone = 'cpu', loading = false, disabled = false, testId }: Props = $props();
2020
21-
const barColorClass = $derived(tone === 'cpu' ? 'bg-sky-400/75' : 'bg-emerald-400/75');
22-
const iconColorClass = $derived(tone === 'cpu' ? 'text-sky-300' : 'text-emerald-300');
21+
const barColorClass = $derived(
22+
tone === 'cpu' ? 'bg-sky-500/75 dark:bg-sky-400/75' : 'bg-emerald-500/75 dark:bg-emerald-400/75'
23+
);
24+
const iconColorClass = $derived(tone === 'cpu' ? 'text-sky-600 dark:text-sky-300' : 'text-emerald-600 dark:text-emerald-300');
2325
const Icon = $derived(icon);
2426
</script>
2527

@@ -32,15 +34,15 @@
3234
>
3335
<div class="grid grid-cols-[minmax(0,1fr)_auto] items-start gap-x-3">
3436
<div class="flex min-w-0 items-center gap-2">
35-
<div class="bg-background/70 flex size-7 shrink-0 items-center justify-center rounded-md border border-white/8">
37+
<div class="bg-background/70 border-border/60 flex size-7 shrink-0 items-center justify-center rounded-md border">
3638
<Icon class={cn('size-4', disabled ? 'text-muted-foreground' : iconColorClass)} />
3739
</div>
3840
<div class="min-w-0">
39-
<div class="text-[11px] font-medium tracking-normal text-white/70">{label}</div>
41+
<div class="text-muted-foreground text-[11px] font-medium tracking-normal">{label}</div>
4042
{#if loading}
4143
<Skeleton class="mt-1 h-5 w-20" />
4244
{:else}
43-
<div class={cn('truncate text-sm font-semibold tabular-nums', disabled ? 'text-muted-foreground' : 'text-white')}>
45+
<div class={cn('truncate text-sm font-semibold tabular-nums', disabled ? 'text-muted-foreground' : 'text-foreground')}>
4446
{value}
4547
</div>
4648
{/if}
@@ -50,19 +52,19 @@
5052
{#if loading}
5153
<Skeleton class="mt-0.5 h-4 w-16 justify-self-end" />
5254
{:else}
53-
<div class="shrink-0 justify-self-end pl-2 text-right text-[11px] text-white/55 tabular-nums">{detail}</div>
55+
<div class="text-muted-foreground shrink-0 justify-self-end pl-2 text-right text-[11px] tabular-nums">{detail}</div>
5456
{/if}
5557
</div>
5658

5759
{#if loading}
5860
<Skeleton class="h-8 w-full" />
5961
{:else}
60-
<div class="bg-background/60 flex h-8 items-end gap-[3px] overflow-hidden rounded-md border border-white/8 px-1.5 py-1">
62+
<div class="bg-background/60 border-border/60 flex h-8 items-end gap-[3px] overflow-hidden rounded-md border px-1.5 py-1">
6163
{#each history as sample, index (`${tone}-${index}`)}
6264
<ArcaneTooltip.Root>
6365
<ArcaneTooltip.Trigger class="flex h-full min-w-0 flex-1 items-end self-stretch">
6466
<div
65-
class={cn('min-w-0 flex-1 rounded-[2px] transition-opacity', disabled ? 'bg-white/8' : barColorClass)}
67+
class={cn('min-w-0 flex-1 rounded-[2px] transition-opacity', disabled ? 'bg-muted' : barColorClass)}
6668
style={`height: ${Math.max(disabled ? 12 : Math.min(Math.max(sample.percent, 6), 100), 6)}%; opacity: ${disabled ? 0.35 : 0.45 + Math.min(sample.percent, 100) / 180};`}
6769
></div>
6870
</ArcaneTooltip.Trigger>

0 commit comments

Comments
 (0)