Modern Docker Management, Designed for Everyone
Go composecontainer-managementcontainersdockerdocker-composedocker-managementgoself-hostedsveltekittypescriptweb-ui
fix: UI consistency and layout updates (#185)
Kyle Mendell1b852257b9e1
diff --git a/src/lib/components/badges/status-badge.svelte b/src/lib/components/badges/status-badge.svelteindex b8ae43006..49ff2f915 100644--- a/src/lib/components/badges/status-badge.svelte+++ b/src/lib/components/badges/status-badge.svelte@@ -1,41 +1,42 @@<script lang="ts">- interface Props {- text: string;- variant?: 'red' | 'purple' | 'green' | 'blue' | 'gray' | 'amber';- }-- let { text, variant = 'gray' }: Props = $props();-- // Updated variant classes based on provided RGBA values and Tailwind colors (dark mode removed)- let variantClasses = $derived(- {- // red: bg: rgba(239, 68, 68, 0.15), color: rgb(185, 28, 28), border: rgba(239, 68, 68, 0.15)- // Closest Tailwind: bg-red-500/15, text-red-700, border-red-700- red: 'bg-red-500/15 text-red-700 border border-red-700/20',-- // purple: bg: rgba(139, 92, 246, 0.15), color: rgb(107, 33, 168), border: rgba(139, 92, 246, 0.15)- // Closest Tailwind: bg-purple-500/15, text-purple-700, border-purple-700- purple: 'bg-purple-500/15 text-purple-700 border border-purple-700/20',+ import { cn } from '$lib/utils';- // green: bg: rgba(34, 197, 94, 0.2), color: rgb(63, 185, 80), border: rgba(34, 197, 94, 0.2)- // Closest Tailwind: bg-green-500/20, text-green-600, border-green-600- green: 'bg-green-500/20 text-green-600 border border-green-600/20',+ type Variant = 'red' | 'purple' | 'green' | 'blue' | 'gray' | 'amber' | 'pink' | 'indigo' | 'cyan' | 'lime' | 'emerald' | 'teal' | 'sky' | 'violet' | 'fuchsia' | 'rose' | 'orange';- // blue: bg: rgba(59, 130, 246, 0.15), color: rgb(37, 99, 235), border: rgba(59, 130, 246, 0.15)- // Closest Tailwind: bg-blue-500/15, text-blue-700, border-blue-700- blue: 'bg-blue-500/15 text-blue-700 border border-blue-700/20',-- // gray: bg: rgba(156, 163, 175, 0.15), color: rgb(75, 85, 99), border: rgba(156, 163, 175, 0.15)- // Closest Tailwind: bg-gray-400/15, text-gray-600, border-gray-600- gray: 'bg-gray-400/15 text-gray-600 border border-gray-600-20',-- // amber: bg: rgba(234, 179, 8, 0.2), color: rgb(210, 153, 34), border: rgba(234, 179, 8, 0.2)- // Closest Tailwind: bg-amber-500/20, text-amber-600, border-amber-600- amber: 'bg-amber-500/20 text-amber-600 border border-amber-600/20'- }[variant]- );+ let {+ text,+ variant = 'gray',+ class: className = '',+ ...restProps+ } = $props<{+ text: string;+ variant?: Variant;+ class?: string;+ }>();++ const typedVariant: Variant = variant;++ const variantStyles = {+ red: 'bg-red-500/15 text-red-700 border border-red-700/20',+ purple: 'bg-purple-500/15 text-purple-700 border border-purple-700/20',+ green: 'bg-green-500/20 text-green-600 border border-green-600/20',+ blue: 'bg-blue-500/15 text-blue-700 border border-blue-700/20',+ gray: 'bg-gray-400/15 text-gray-600 border border-gray-600-20',+ amber: 'bg-amber-500/20 text-amber-600 border border-amber-600/20',+ pink: 'bg-pink-500/15 text-pink-700 border border-pink-700/20',+ indigo: 'bg-indigo-500/15 text-indigo-700 border border-indigo-700/20',+ cyan: 'bg-cyan-500/15 text-cyan-700 border border-cyan-700/20',+ lime: 'bg-lime-500/15 text-lime-700 border border-lime-700/20',+ emerald: 'bg-emerald-500/20 text-emerald-700 border border-emerald-700/20',+ teal: 'bg-teal-500/15 text-teal-700 border border-teal-700/20',+ sky: 'bg-sky-500/15 text-sky-700 border border-sky-700/20',+ violet: 'bg-violet-500/15 text-violet-700 border border-violet-700/20',+ fuchsia: 'bg-fuchsia-500/15 text-fuchsia-700 border border-fuchsia-700/20',+ rose: 'bg-rose-500/15 text-rose-700 border border-rose-700/20',+ orange: 'bg-orange-500/15 text-orange-700 border border-orange-700/20'+ };</script>-<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium {variantClasses}">+<span class={cn('inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium', variantStyles[typedVariant], className)} {...restProps}>{text}</span>diff --git a/src/lib/components/maturity-item.svelte b/src/lib/components/maturity-item.sveltenew file mode 100644index 000000000..47b366399--- /dev/null+++ b/src/lib/components/maturity-item.svelte@@ -0,0 +1,86 @@+<script lang="ts">+ import * as Tooltip from '$lib/components/ui/tooltip/index.js';+ import { CircleCheck, CircleFadingArrowUp, CircleArrowUp } from '@lucide/svelte';++ interface Props {+ maturity?:+ | {+ updatesAvailable: boolean;+ status: string;+ version?: string;+ date?: string;+ }+ | undefined;+ }++ let { maturity = undefined }: Props = $props();+</script>++{#if maturity}+ <Tooltip.Provider>+ <Tooltip.Root>+ <Tooltip.Trigger>+ <span class="inline-flex items-center justify-center align-middle mr-2 size-4">+ {#if !maturity.updatesAvailable}+ <CircleCheck class="text-green-500 size-4" fill="none" stroke="currentColor" strokeWidth="2" />+ {:else if maturity.status === 'Not Matured'}+ <CircleFadingArrowUp class="text-yellow-500 size-4" fill="none" stroke="currentColor" stroke-width="2" />+ {:else}+ <CircleArrowUp class="text-blue-500 size-4" fill="none" stroke="currentColor" stroke-width="2" />+ {/if}+ </span>+ </Tooltip.Trigger>+ <Tooltip.Content side="right" class="p-3 max-w-[200px] relative tooltip-with-arrow" align="center">+ <div class="space-y-2">+ <div class="flex items-center gap-2">+ {#if !maturity.updatesAvailable}+ <CircleCheck class="text-green-500 size-5" fill="none" stroke="currentColor" strokeWidth="2" />+ <span class="font-medium">Image Up to Date</span>+ {:else if maturity.status === 'Not Matured'}+ <CircleFadingArrowUp class="text-yellow-500 size-5" fill="none" stroke="currentColor" stroke-width="2" />+ <span class="font-medium">Update Available (Not Matured)</span>+ {:else}+ <CircleArrowUp class="text-blue-500 size-5" fill="none" stroke="currentColor" stroke-width="2" />+ <span class="font-medium">Matured Update Available</span>+ {/if}+ </div>++ <div class="pt-1 border-t border-gray-200 dark:border-gray-700 justify-between">+ <div class="flex justify-between text-xs">+ <span class="text-muted-foreground">Version:</span>+ <span class="font-medium">{maturity.version || 'N/A'}</span>+ </div>++ <div class="flex justify-between text-xs mt-1">+ <span class="text-muted-foreground">Released:</span>+ <span>{maturity.date || 'Unknown'}</span>+ </div>++ <div class="flex justify-between text-xs mt-1">+ <span class="text-muted-foreground">Status:</span>+ <span class={maturity.status === 'Matured' ? 'text-green-500' : 'text-amber-500'}>+ {maturity.status || 'Unknown'}+ </span>+ </div>+ </div>+ </div>+ </Tooltip.Content>+ </Tooltip.Root>+ </Tooltip.Provider>+{:else}+ <Tooltip.Provider>+ <Tooltip.Root>+ <Tooltip.Trigger>+ <span class="inline-flex items-center justify-center mr-2 opacity-30 size-4">+ <svg class="text-gray-500 size-4" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24">+ <circle cx="12" cy="12" r="10" />+ <path d="M9 12l2 2 4-4" />+ </svg>+ </span>+ </Tooltip.Trigger>+ <Tooltip.Content side="right" class="p-2 relative tooltip-with-arrow" align="center">+ <span class="text-xs">Maturity status not available.</span>+ </Tooltip.Content>+ </Tooltip.Root>+ </Tooltip.Provider>+{/if}diff --git a/src/lib/components/navbar.svelte b/src/lib/components/navbar.svelteindex 785d3dd0e..d41007e77 100644--- a/src/lib/components/navbar.svelte+++ b/src/lib/components/navbar.svelte@@ -52,8 +52,8 @@const updateAvailable = $derived(versionInformation?.updateAvailable);</script>-<!-- Mobile menu button -->-<Button variant="ghost" size="icon" class="md:hidden fixed top-4 right-4 z-50 shadow-sm bg-background" onclick={() => (isOpen = !isOpen)} aria-label={isOpen ? 'Close menu' : 'Open menu'}>+<!-- Mobile menu button - Enhanced with better positioning and shadow -->+<Button variant="ghost" size="icon" class="md:hidden fixed top-4 right-4 z-50 shadow-md bg-background/95 backdrop-blur-sm border" onclick={() => (isOpen = !isOpen)} aria-label={isOpen ? 'Close menu' : 'Open menu'}>{#if isOpen}<X size={18} />{:else}@@ -61,102 +61,116 @@{/if}</Button>-<div class={cn('fixed md:sticky top-0 left-0 h-screen md:h-dvh transition-all duration-300 ease-in-out', 'bg-card border-r shadow-sm z-40', 'flex flex-col', isCollapsed ? 'w-[70px]' : 'w-64', isOpen ? 'translate-x-0' : '-translate-x-full md:translate-x-0')}>- <div class={cn('flex items-center h-14 transition-all duration-300', isCollapsed ? 'justify-center px-2' : 'gap-3 px-5 p-4')}>- <div class="shrink-0">- <img src="/img/arcane.svg" alt="Arcane" class="size-15" width="30" height="30" />+<!-- Main sidebar container - Enhanced with smoother transitions and better shadows -->+<div class={cn('fixed md:sticky top-0 left-0 h-screen md:h-dvh transition-all duration-300 ease-in-out', 'bg-card border-r shadow-md z-40', 'flex flex-col', isCollapsed ? 'w-[70px]' : 'w-64', isOpen ? 'translate-x-0' : '-translate-x-full md:translate-x-0')}>+ <!-- Logo header - Enhanced spacing and alignment -->+ <div class={cn('flex items-center h-16 transition-all duration-300', isCollapsed ? 'justify-center px-2' : 'gap-3 px-5')}>+ <div class="shrink-0 flex items-center justify-center">+ <img src="/img/arcane.svg" alt="Arcane" class={cn('transition-all duration-300', isCollapsed ? 'size-15' : 'size-15')} width={isCollapsed ? '24' : '28'} height={isCollapsed ? '24' : '28'} /></div>{#if !isCollapsed}<div class="flex flex-col justify-center"><span class="text-lg font-bold tracking-tight leading-none">Arcane</span>- <span class="text-xs text-muted-foreground">v{versionInformation.currentVersion}</span>+ <span class="text-xs text-muted-foreground">v{versionInformation?.currentVersion}</span></div>{/if}</div><Separator />- <div class="hidden md:flex justify-end px-2 -mt-1 mb-1 relative">- <Button variant="outline" size="icon" class="rounded-full bg-background absolute right-0 translate-x-1/2 size-6" onclick={toggleCollapse} aria-label={isCollapsed ? 'Expand sidebar' : 'Collapse sidebar'}>+ <!-- Collapse toggle button - Enhanced positioning and animation -->+ <div class="hidden md:flex justify-end px-2 -mt-[9px] mb-1.5 relative">+ <Button variant="outline" size="icon" class="rounded-full bg-background/95 backdrop-blur-sm absolute right-0 translate-x-1/2 size-[22px] shadow-sm border transition-transform duration-300 hover:scale-110" onclick={toggleCollapse} aria-label={isCollapsed ? 'Expand sidebar' : 'Collapse sidebar'}>{#if isCollapsed}- <ChevronRight size={14} />+ <ChevronRight size={12} />{:else}- <ChevronLeft size={14} />+ <ChevronLeft size={12} />{/if}</Button></div>- <nav class={cn('p-2 flex-1 overflow-y-auto overflow-x-hidden', isCollapsed && 'py-2 px-1')}>+ <!-- Navigation menu - Enhanced with better spacing and transitions -->+ <nav class={cn('p-2 flex-1 overflow-y-auto overflow-x-hidden custom-scrollbar', isCollapsed && 'py-2 px-1')}>{#each items as item (item.href)}{@const isActive = page.url.pathname === item.href || (page.url.pathname.startsWith(item.href) && item.href !== '/')}{@const Icon = item.icon}<ahref={item.href}- class={cn('flex items-center justify-between rounded-md text-sm font-medium transition-all', isCollapsed ? 'px-2 py-2 my-1 flex-col gap-1' : 'px-3 py-2 my-0.5', 'transition-colors group', isActive ? 'bg-primary/10 text-primary' : 'text-muted-foreground hover:bg-muted hover:text-foreground')}+ class={cn('flex items-center justify-between rounded-lg text-sm font-medium', isCollapsed ? 'px-2 py-3 my-1 flex-col gap-1' : 'px-3 py-2.5 my-0.5', 'transition-all duration-200 group', isActive ? 'bg-primary/12 text-primary shadow-sm' : 'text-muted-foreground hover:bg-muted/70 hover:text-foreground')}aria-current={isActive ? 'page' : undefined}title={isCollapsed ? item.label : undefined}><div class={cn('flex items-center', isCollapsed ? 'justify-center' : 'gap-3')}>- <div class={cn('p-1 rounded-md', isActive ? 'bg-primary/10' : 'bg-transparent group-hover:bg-muted-foreground/10')}>- <Icon size={16} class={cn(isActive ? 'text-primary' : 'text-muted-foreground group-hover:text-foreground')} />+ <div class={cn('p-1.5 rounded-md transition-colors duration-200', isActive ? 'bg-primary/15' : 'bg-transparent group-hover:bg-muted-foreground/10')}>+ <Icon size={16} class={cn('transition-colors duration-200', isActive ? 'text-primary' : 'text-muted-foreground group-hover:text-foreground')} /></div>{#if !isCollapsed}- <span>{item.label}</span>+ <span class="truncate">{item.label}</span>{/if}</div>- {#if !isCollapsed}- {#if isActive}- <ChevronRight size={16} class="text-primary opacity-60" />- {/if}+ {#if !isCollapsed && isActive}+ <ChevronRight size={14} class="text-primary opacity-70" />{/if}</a>{/each}</nav>+ <!-- Update notification - Enhanced with better visibility -->{#if updateAvailable}<Separator />- <div class={cn('transition-all px-3 py-2', isCollapsed ? 'text-center' : '')}>+ <div class={cn('transition-all px-3 py-3', isCollapsed ? 'text-center' : '', 'bg-blue-500/10 dark:bg-blue-500/5 my-1 mx-2 rounded-md')}>{#if !isCollapsed}- <a href={versionInformation.releaseUrl} target="_blank" rel="noopener noreferrer" class="flex items-center justify-between text-blue-500 hover:underline text-sm">+ <a href={versionInformation.releaseUrl} target="_blank" rel="noopener noreferrer" class="flex items-center justify-between text-blue-600 dark:text-blue-400 hover:underline text-sm font-medium"><span>Update available</span><span class="flex items-center">v{versionInformation.newestVersion}- <ExternalLink class="ml-1 size-3" />+ <ExternalLink class="ml-1 size-3.5" /></span></a>{:else}- <a href={versionInformation.releaseUrl} target="_blank" rel="noopener noreferrer" title="Update available: v{versionInformation.newestVersion}" class="flex justify-center text-blue-500">+ <a href={versionInformation.releaseUrl} target="_blank" rel="noopener noreferrer" title="Update available: v{versionInformation.newestVersion}" class="flex justify-center text-blue-600 dark:text-blue-400"><ExternalLink class="size-4" /></a>{/if}</div>{/if}+ <!-- User controls section - Enhanced with better spacing and hover effects --><div class="mt-auto p-2"><Separator class="mb-2" />+{#if user && user.displayName && !isCollapsed}- <div class="px-3 py-2 text-sm text-muted-foreground truncate" title={user.displayName}>- {user.displayName}+ <div class="px-3 py-2.5 text-sm font-medium text-muted-foreground truncate flex items-center gap-2" title={user.displayName}>+ <div class="size-6 rounded-full bg-primary/15 text-primary flex items-center justify-center">+ {user.displayName.charAt(0).toUpperCase()}+ </div>+ <span class="truncate">{user.displayName}</span></div>{/if}- <Button variant="ghost" class={cn('w-full flex items-center text-sm font-medium transition-colors text-muted-foreground hover:bg-muted hover:text-foreground', isCollapsed ? 'justify-center px-2 py-2' : 'justify-start gap-3 px-3 py-2')} title={isCollapsed ? 'Toggle theme' : 'Toggle theme'} onclick={toggleMode}>- {#if mode.current === 'dark'}- <Sun size={16} />- {:else}- <Moon size={16} />- {/if}+ <!-- Theme toggle button - Enhanced with better hover effects -->+ <Button variant="ghost" class={cn('w-full flex items-center text-sm font-medium transition-colors text-muted-foreground hover:bg-muted hover:text-foreground rounded-lg', isCollapsed ? 'justify-center px-2 py-3' : 'justify-start gap-3 px-3 py-2.5')} title={isCollapsed ? 'Toggle theme' : 'Toggle theme'} onclick={toggleMode}>+ <div class={cn('p-1 rounded-md transition-colors', 'bg-transparent group-hover:bg-muted-foreground/10')}>+ {#if mode.current === 'dark'}+ <Sun size={16} />+ {:else}+ <Moon size={16} />+ {/if}+ </div>{#if !isCollapsed}<span>Toggle theme</span>{/if}</Button>+ <!-- Logout button - Enhanced with better hover effects --><form action="/auth/logout" method="POST">- <Button variant="ghost" class={cn('w-full flex items-center text-sm font-medium transition-colors text-muted-foreground hover:bg-muted hover:text-foreground', isCollapsed ? 'justify-center px-2 py-2' : 'justify-start gap-3 px-3 py-2')} title={isCollapsed ? 'Logout' : undefined} type="submit">- <LogOut size={16} />+ <Button variant="ghost" class={cn('w-full flex items-center text-sm font-medium transition-colors text-muted-foreground hover:bg-muted hover:text-foreground rounded-lg', isCollapsed ? 'justify-center px-2 py-3' : 'justify-start gap-3 px-3 py-2.5')} title={isCollapsed ? 'Logout' : undefined} type="submit">+ <div class={cn('p-1 rounded-md transition-colors', 'bg-transparent group-hover:bg-muted-foreground/10')}>+ <LogOut size={16} />+ </div>{#if !isCollapsed}<span>Logout</span>{/if}@@ -165,6 +179,31 @@</div></div>+<!-- Mobile backdrop - Enhanced with smoother blur effect -->{#if isOpen}- <button type="button" class="md:hidden fixed inset-0 w-full h-full bg-background/80 backdrop-blur-sm z-30 border-none" aria-label="Close menu" onclick={() => (isOpen = false)} transition:fly={{ duration: 150, y: -5 }}></button>+ <button type="button" class="md:hidden fixed inset-0 w-full h-full bg-background/60 backdrop-blur-sm z-30 border-none" aria-label="Close menu" onclick={() => (isOpen = false)} transition:fly={{ duration: 200, y: -5 }}></button>{/if}++<style>+ .custom-scrollbar {+ scrollbar-width: thin;+ scrollbar-color: var(--scrollbar-thumb) transparent;+ }++ .custom-scrollbar::-webkit-scrollbar {+ width: 6px;+ }++ .custom-scrollbar::-webkit-scrollbar-track {+ background: transparent;+ }++ .custom-scrollbar::-webkit-scrollbar-thumb {+ background-color: var(--scrollbar-thumb, rgba(0, 0, 0, 0.2));+ border-radius: 3px;+ }++ :global(.dark) .custom-scrollbar::-webkit-scrollbar-thumb {+ --scrollbar-thumb: rgba(255, 255, 255, 0.2);+ }+</style>diff --git a/src/routes/+page.server.ts b/src/routes/+page.server.tsindex e8c34e719..8c04be2a7 100644--- a/src/routes/+page.server.ts+++ b/src/routes/+page.server.ts@@ -1,14 +1,13 @@import type { PageServerLoad } from './$types';import { listContainers } from '$lib/services/docker/container-service';import { getDockerInfo } from '$lib/services/docker/core';-import { isImageInUse, listImages } from '$lib/services/docker/image-service';+import { isImageInUse, listImages, checkImageMaturity } from '$lib/services/docker/image-service';import { getSettings } from '$lib/services/settings-service';import type { EnhancedImageInfo, ServiceContainer, ServiceImage } from '$lib/types/docker';type DockerInfoType = Awaited<ReturnType<typeof getDockerInfo>>;type SettingsType = NonNullable<Awaited<ReturnType<typeof getSettings>>>;-// Update DashboardData typetype DashboardData = {dockerInfo: DockerInfoType | null;containers: ServiceContainer[];@@ -19,14 +18,12 @@ type DashboardData = {export const load: PageServerLoad = async (): Promise<DashboardData> => {try {- // Fetch all data concurrently, including settingsconst [dockerInfo, containers, images, settings] = await Promise.all([getDockerInfo().catch((e) => {console.error('Dashboard: Failed to get Docker info:', e.message);return null;}),listContainers(true).catch((e) => {- // Ensure options object if neededconsole.error('Dashboard: Failed to list containers:', e.message);return [];}),@@ -35,18 +32,28 @@ export const load: PageServerLoad = async (): Promise<DashboardData> => {return [];}),getSettings().catch((e) => {- // Fetch settingsconsole.error('Dashboard: Failed to get settings:', e.message);- return null; // Handle settings fetch error+ return null;})]);const enhancedImages = await Promise.all(images.map(async (image): Promise<EnhancedImageInfo> => {const inUse = await isImageInUse(image.id);++ let maturity = undefined;+ try {+ if (image.repo !== '<none>' && image.tag !== '<none>') {+ maturity = await checkImageMaturity(image.id);+ }+ } catch (maturityError) {+ console.error(`Dashboard: Failed to check maturity for image ${image.id}:`, maturityError);+ }+return {...image,- inUse+ inUse,+ maturity};}));diff --git a/src/routes/+page.svelte b/src/routes/+page.svelteindex 5ddac66f1..64cd98f06 100644--- a/src/routes/+page.svelte+++ b/src/routes/+page.svelte@@ -20,6 +20,7 @@import SystemAPIService from '$lib/services/api/system-api-service';import type { EnhancedImageInfo } from '$lib/types/docker';import { openConfirmDialog } from '$lib/components/confirm-dialog';+ import MaturityItem from '$lib/components/maturity-item.svelte';let { data }: { data: PageData } = $props();@@ -244,44 +245,51 @@<section><h2 class="text-lg font-semibold tracking-tight mb-4">Quick Actions</h2>- <div class="grid grid-cols-1 sm:grid-cols-3 gap-3">- <Card.Root class="flex flex-col justify-center items-center p-5 h-full">- <Button onclick={handleStartAll} class="w-full" disabled={!dashboardStates.dockerInfo || stoppedContainers === 0 || isLoading.starting || isLoading.stopping || isLoading.pruning} variant="default">+ <div class="grid grid-cols-1 sm:grid-cols-3 gap-5">+ <!-- Start All Button -->+ <button class="group relative flex flex-col items-center p-5 rounded-xl border bg-card shadow-sm hover:shadow-md transition-all disabled:opacity-60 disabled:cursor-not-allowed disabled:hover:shadow-sm" disabled={!dashboardStates.dockerInfo || stoppedContainers === 0 || isLoading.starting || isLoading.stopping || isLoading.pruning} onclick={handleStartAll}>+ <div class="size-10 rounded-full flex items-center justify-center mb-3 bg-green-500/10 group-hover:bg-green-500/20 transition-colors">{#if isLoading.starting}- <Loader2 class="mr-2 animate-spin size-4" />+ <Loader2 class="text-green-500 animate-spin size-5" />{:else}- <PlayCircle class="mr-2 size-4" />+ <PlayCircle class="text-green-500 size-5" />{/if}- Start All Stopped- <StatusBadge variant="amber" text={stoppedContainers.toString()} />- </Button>- <p class="text-xs text-muted-foreground mt-2">Start all stopped containers</p>- </Card.Root>+ </div>+ <span class="text-base font-medium mb-2">Start All Stopped</span>+ <StatusBadge variant="sky" text={stoppedContainers.toString()} class="mb-3" />+ <p class="text-xs text-muted-foreground">Start all stopped containers</p>+ </button>- <Card.Root class="flex flex-col justify-center items-center p-5 h-full">- <Button onclick={handleStopAll} class="w-full" variant="secondary" disabled={!dashboardStates.dockerInfo || runningContainers === 0 || isLoading.starting || isLoading.stopping || isLoading.pruning}>+ <!-- Stop All Button -->+ <button class="group relative flex flex-col items-center p-5 rounded-xl border bg-card shadow-sm hover:shadow-md transition-all disabled:opacity-60 disabled:cursor-not-allowed disabled:hover:shadow-sm" disabled={!dashboardStates.dockerInfo || runningContainers === 0 || isLoading.starting || isLoading.stopping || isLoading.pruning} onclick={handleStopAll}>+ <div class="size-10 rounded-full flex items-center justify-center mb-3 bg-blue-500/10 group-hover:bg-blue-500/20 transition-colors">{#if isLoading.stopping}- <Loader2 class="mr-2 animate-spin size-4" />+ <Loader2 class="text-blue-500 animate-spin size-5" />{:else}- <StopCircle class="mr-2 size-4" />+ <StopCircle class="text-blue-500 size-5" />{/if}- Stop All Running- <StatusBadge variant="amber" text={runningContainers.toString()} />- </Button>- <p class="text-xs text-muted-foreground mt-2">Stop all running containers</p>- </Card.Root>+ </div>+ <span class="text-base font-medium mb-2">Stop All Running</span>+ <StatusBadge variant="sky" text={runningContainers.toString()} class="mb-3" />+ <p class="text-xs text-muted-foreground">Stop all running containers</p>+ </button>- <Card.Root class="flex flex-col justify-center items-center p-5 h-full">- <Button onclick={() => (dashboardStates.isPruneDialogOpen = true)} class="w-full" variant="destructive" disabled={!dashboardStates.dockerInfo || isLoading.starting || isLoading.stopping || isLoading.pruning}>+ <!-- Prune System Button -->+ <button+ class="group relative flex flex-col items-center p-5 rounded-xl border bg-card shadow-sm hover:shadow-md hover:border-destructive/50 transition-all disabled:opacity-60 disabled:cursor-not-allowed disabled:hover:shadow-sm disabled:hover:border-border"+ disabled={!dashboardStates.dockerInfo || isLoading.starting || isLoading.stopping || isLoading.pruning}+ onclick={() => (dashboardStates.isPruneDialogOpen = true)}+ >+ <div class="size-10 rounded-full flex items-center justify-center mb-3 bg-red-500/10 group-hover:bg-red-500/20 transition-colors">{#if isLoading.pruning}- <Loader2 class="mr-2 animate-spin size-4" />+ <Loader2 class="text-red-500 animate-spin size-5" />{:else}- <Trash2 class="mr-2 size-4" />+ <Trash2 class="text-red-500 size-5" />{/if}- Prune System- </Button>- <p class="text-xs text-muted-foreground mt-2">Remove unused data</p>- </Card.Root>+ </div>+ <span class="text-base font-medium mb-2">Prune System</span>+ <p class="text-xs text-muted-foreground">Remove unused data</p>+ </button></div></section>@@ -374,6 +382,7 @@data={dashboardStates.images.slice(0, 5)}columns={[{ accessorKey: 'repo', header: 'Name' },+ { accessorKey: 'inUse', header: ' ', enableSorting: false },{ accessorKey: 'tag', header: 'Tag' },{ accessorKey: 'size', header: 'Size' }]}@@ -395,16 +404,21 @@{#snippet rows({ item })}<Table.Cell><div class="flex items-center gap-2">- <span class="truncate">- <a class="font-medium hover:underline" href="/images/{item.id}/">+ <div class="flex items-center flex-1">+ <MaturityItem maturity={item.maturity} />+ <a class="font-medium hover:underline shrink truncate" href="/images/{item.id}/">{item.repo}</a>- </span>- {#if !item.inUse}- <StatusBadge text="Unused" variant="amber" />- {/if}+ </div></div></Table.Cell>+ <Table.Cell>+ {#if !item.inUse}+ <StatusBadge text="Unused" variant="amber" />+ {:else}+ <StatusBadge text="In Use" variant="green" />+ {/if}+ </Table.Cell><Table.Cell>{item.tag}</Table.Cell><Table.Cell>{formatBytes(item.size)}</Table.Cell>{/snippet}diff --git a/src/routes/auth/login/+page.svelte b/src/routes/auth/login/+page.svelteindex d6c51255a..0c178f15f 100644--- a/src/routes/auth/login/+page.svelte+++ b/src/routes/auth/login/+page.svelte@@ -4,7 +4,7 @@import { Input } from '$lib/components/ui/input/index.js';import { Label } from '$lib/components/ui/label/index.js';import * as Alert from '$lib/components/ui/alert/index.js';- import { AlertCircle, LogIn } from '@lucide/svelte';+ import { AlertCircle, LogIn, Lock, User } from '@lucide/svelte';import type { PageData } from './$types';import { goto } from '$app/navigation';import { env } from '$env/dynamic/public';@@ -33,17 +33,23 @@const showDivider = $derived(showOidcLoginButton && showLocalLoginForm);</script>-<div class="flex max-h-screen flex-col justify-center my-auto py-12 sm:px-6 lg:px-8">- <div class="mx-auto w-full max-w-md">- <img class="w-auto mx-auto size-40" src="/img/arcane.png" alt="Arcane" />- <h2 class="mt-2 text-center text-2xl font-bold leading-9 tracking-tight">Sign in to Arcane</h2>- </div>+<div class="flex min-h-screen flex-col items-center justify-center py-12 px-4 sm:px-6 lg:px-8 bg-background/50">+ <div class="w-full max-w-md space-y-8">+ <!-- Logo and Title -->+ <div class="text-center">+ <div class="flex justify-center">+ <img class="h-40 w-auto" src="/img/arcane.svg" alt="Arcane" />+ </div>+ <h1 class="text-2xl font-bold tracking-tight">Sign in to Arcane</h1>+ <p class="mt-2 text-sm text-muted-foreground">Manage your Container Environment</p>+ </div>- <div class="mt-10 mx-auto w-full max-w-[480px]">- <div class="bg-card px-6 py-5 shadow sm:rounded-lg sm:px-12">+ <!-- Login Card -->+ <div class="rounded-xl border bg-card shadow-sm p-6 sm:p-8">+ <!-- Error Messages -->{#if data.error}- <Alert.Root class="mb-4" variant="destructive">- <AlertCircle class="mr-2 size-4" />+ <Alert.Root class="mb-6" variant="destructive">+ <AlertCircle class="size-4 mr-2" /><Alert.Title>Login Problem</Alert.Title><Alert.Description>{#if data.error === 'oidc_invalid_response'}@@ -66,9 +72,10 @@</Alert.Description></Alert.Root>{/if}+{#if form?.error}- <Alert.Root class="mb-4" variant="destructive">- <AlertCircle class="mr-2 size-4" />+ <Alert.Root class="mb-6" variant="destructive">+ <AlertCircle class="size-4 mr-2" /><Alert.Title>Authentication Failed</Alert.Title><Alert.Description>{form.error}</Alert.Description></Alert.Root>@@ -76,17 +83,28 @@{#if !showLocalLoginForm && !showOidcLoginButton}<Alert.Root variant="destructive">- <AlertCircle class="mr-2 size-4" />+ <AlertCircle class="size-4 mr-2" /><Alert.Title>No Login Methods Configured</Alert.Title><Alert.Description>There are currently no login methods enabled. Please contact an administrator.</Alert.Description></Alert.Root>{/if}+ <!-- OIDC Login Button (when only OIDC is available) -->+ {#if showOidcLoginButton && !showLocalLoginForm}+ <div class="pt-2">+ <Button onclick={handleOidcLogin} variant="default" class="w-full py-6 text-base">+ <LogIn class="mr-3 size-5" />+ Sign in with OIDC Provider+ </Button>+ </div>+ {/if}++ <!-- Local Login Form -->{#if showLocalLoginForm}<form- class="space-y-6"method="POST"action="?/login"+ class="space-y-6"use:enhance={() => {loading = true;return async ({ result, update }) => {@@ -101,52 +119,67 @@}}><input type="hidden" name="redirectTo" value={data.redirectTo} />- <div>- <Label for="username" class="block text-sm font-medium leading-6">Username or Email</Label>- <div class="mt-2">- <Input id="username" name="username" type="text" autocomplete="username" required value={form?.username ?? ''} />++ <div class="space-y-4">+ <!-- Username Field -->+ <div>+ <Label for="username" class="block text-sm font-medium mb-1.5">Username</Label>+ <div class="relative">+ <div class="absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none text-muted-foreground">+ <User class="size-4" />+ </div>+ <Input id="username" name="username" type="text" autocomplete="username" required value={form?.username ?? ''} class="pl-10" placeholder="Enter your username or email" />+ </div></div>- </div>- <div>- <Label for="password" class="block text-sm font-medium leading-6">Password</Label>- <div class="mt-2">- <Input id="password" name="password" type="password" autocomplete="current-password" required />+ <!-- Password Field -->+ <div>+ <Label for="password" class="block text-sm font-medium mb-1.5">Password</Label>+ <div class="relative">+ <div class="absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none text-muted-foreground">+ <Lock class="size-4" />+ </div>+ <Input id="password" name="password" type="password" autocomplete="current-password" required class="pl-10" placeholder="Enter your password" />+ </div></div></div>- <div>- <Button type="submit" class="w-full" disabled={loading} aria-busy={loading}>+ <!-- Sign In Button -->+ <div class="pt-2">+ <Button type="submit" class="w-full py-6 text-base" disabled={loading} aria-busy={loading}>{#if loading}- <span class="loading loading-spinner loading-xs mr-2"></span>+ <div class="mr-2 size-4 border-2 border-t-transparent rounded-full animate-spin"></div>{/if}Sign in</Button></div></form>- {/if}- {#if showDivider}- <div class="mt-6">- <div class="relative">+ <!-- Divider -->+ {#if showDivider}+ <div class="relative my-8"><div class="absolute inset-0 flex items-center"><div class="w-full border-t border-border"></div></div>- <div class="relative flex justify-center text-sm">- <span class="bg-card px-2 text-muted-foreground">Or continue with</span>+ <div class="relative flex justify-center text-xs">+ <span class="bg-card px-4 text-muted-foreground">Or continue with</span></div></div>- </div>- {/if}+ {/if}- {#if showOidcLoginButton}- <div class="mt-6 {showLocalLoginForm ? '' : 'pt-0'}">- <Button onclick={handleOidcLogin} variant="outline" class="w-full">+ <!-- OIDC Login Button (when both methods are available) -->+ {#if showOidcLoginButton && showDivider}+ <Button onclick={handleOidcLogin} variant="outline" class="w-full py-5"><LogIn class="mr-2 size-4" />Sign in with OIDC Provider</Button>- </div>+ {/if}{/if}</div>++ <!-- Footer Text -->+ <p class="text-center text-xs text-muted-foreground">+ <a href="https://github.com/arcane-docker/arcane" target="_blank" rel="noopener noreferrer" class="text-primary hover:underline">View on GitHub</a>+ </p></div></div>diff --git a/src/routes/containers/[id]/+page.svelte b/src/routes/containers/[id]/+page.svelteindex 2f36e3523..0f57de1ea 100644--- a/src/routes/containers/[id]/+page.svelte+++ b/src/routes/containers/[id]/+page.svelte@@ -271,13 +271,13 @@{#if container}<Tabs.Root value={activeTab} onValueChange={(val) => (activeTab = val)} class="space-y-4">- <Tabs.List>- <Tabs.Trigger value="overview">Overview</Tabs.Trigger>- <Tabs.Trigger value="config">Configuration</Tabs.Trigger>- <Tabs.Trigger value="network">Networks</Tabs.Trigger>- <Tabs.Trigger value="storage">Storage</Tabs.Trigger>- <Tabs.Trigger value="logs">Logs</Tabs.Trigger>- <Tabs.Trigger value="stats">Metrics</Tabs.Trigger>+ <Tabs.List class="dark:bg-slate-900 grid grid-cols-6 md:w-full md:max-w-3xl mb-4">+ <Tabs.Trigger class="data-[state=active]:border data-[state=active]:border-primary/60" value="overview">Overview</Tabs.Trigger>+ <Tabs.Trigger class="data-[state=active]:border data-[state=active]:border-primary/60" value="config">Configuration</Tabs.Trigger>+ <Tabs.Trigger class="data-[state=active]:border data-[state=active]:border-primary/60" value="network">Networks</Tabs.Trigger>+ <Tabs.Trigger class="data-[state=active]:border data-[state=active]:border-primary/60" value="storage">Storage</Tabs.Trigger>+ <Tabs.Trigger class="data-[state=active]:border data-[state=active]:border-primary/60" value="logs">Logs</Tabs.Trigger>+ <Tabs.Trigger class="data-[state=active]:border data-[state=active]:border-primary/60" value="stats">Metrics</Tabs.Trigger></Tabs.List><Tabs.Content value="overview" class="space-y-6">@@ -655,7 +655,7 @@<label for="auto-scroll" class="text-xs">Auto-scroll</label></div><Button variant="outline" size="sm" onclick={refreshData} disabled={isRefreshing}>- <RefreshCw class={`h-4 w-4 mr-2 ${isRefreshing ? 'animate-spin' : ''}`} />+ <RefreshCw class={`size-4 ${isRefreshing ? 'animate-spin' : ''}`} />Refresh Logs</Button></div>@@ -664,7 +664,7 @@<Card.Content><div- class="bg-muted/50 text-foreground p-4 rounded-md font-mono text-xs overflow-auto border size-[500px]"+ class="bg-muted/50 text-foreground p-4 rounded-md font-mono text-xs overflow-auto border h-[500px]"bind:this={logsContainer}id="logs-container"style="overflow-x: auto;"diff --git a/src/routes/images/+page.svelte b/src/routes/images/+page.svelteindex 3dec13314..ce120783d 100644--- a/src/routes/images/+page.svelte+++ b/src/routes/images/+page.svelte@@ -20,6 +20,7 @@import { tryCatch } from '$lib/utils/try-catch';import { settingsStore } from '$lib/stores/settings-store';import * as Tooltip from '$lib/components/ui/tooltip/index.js';+ import MaturityItem from '$lib/components/maturity-item.svelte';let { data }: { data: PageData } = $props();let images = $state<EnhancedImageInfo[]>(data.images || []);@@ -455,88 +456,7 @@<Table.Cell><div class="flex items-center gap-2"><div class="flex items-center flex-1">- <!-- Maturity Indicator with proper Tooltip -->- {#if item.maturity}- <Tooltip.Provider>- <Tooltip.Root>- <Tooltip.Trigger>- <span class="inline-flex items-center justify-center align-middle mr-2 size-4">- {#if !item.maturity.updatesAvailable}- <!-- Green checkmark for up-to-date images -->-- <CircleCheck class="text-green-500 size-10" fill="none" stroke="currentColor" strokeWidth="2" />- <!-- <CircleFadingArrowUp class="text-green-500 size-4" fill="none" stroke="currentColor" strokeWidth="2" /> -->- {:else if item.maturity.status === 'Not Matured'}- <!-- Yellow warning icon for non-matured updates -->- <CircleFadingArrowUp class="text-yellow-500 size-10" fill="none" stroke="currentColor" stroke-width="2" />- {:else}- <!-- Blue checkmark for matured updates -->- <CircleArrowUp class="text-blue-500 size-10" fill="none" stroke="currentColor" stroke-width="2" />- {/if}- </span>- </Tooltip.Trigger>- <!-- Tooltip content updated -->- <Tooltip.Content side="right" class="p-3 max-w-[200px] relative tooltip-with-arrow" align="center">- <div class="space-y-2">- <div class="flex items-center gap-2">- {#if !item.maturity.updatesAvailable}- <!-- Green checkmark in tooltip -->- <CircleCheck class="text-green-500 size-5" fill="none" stroke="currentColor" strokeWidth="2" />- <span class="font-medium">Image Up to Date</span>- {:else if item.maturity.status === 'Not Matured'}- <!-- Yellow warning icon in tooltip -->- <CircleFadingArrowUp class="text-yellow-500 size-5" fill="none" stroke="currentColor" stroke-width="2" />- <span class="font-medium">Update Available (Not Matured)</span>- {:else}- <!-- Blue info icon in tooltip -->- <CircleArrowUp class="text-blue-500 size-5" fill="none" stroke="currentColor" stroke-width="2" />- <span class="font-medium">Matured Update Available</span>- {/if}- </div>-- <div class="pt-1 border-t border-gray-200 dark:border-gray-700 justify-between">- <div class="flex justify-between text-xs">- <span class="text-muted-foreground">Version:</span>- <span class="font-medium">{item.maturity.version || 'N/A'}</span>- </div>-- <div class="flex justify-between text-xs mt-1">- <span class="text-muted-foreground">Released:</span>- <span>{item.maturity.date || 'Unknown'}</span>- </div>-- <div class="flex justify-between text-xs mt-1">- <span class="text-muted-foreground">Status:</span>- <span class={item.maturity.status === 'Matured' ? 'text-green-500' : 'text-amber-500'}>- {item.maturity.status || 'Unknown'}- </span>- </div>- </div>- </div>- </Tooltip.Content>- </Tooltip.Root>- </Tooltip.Provider>- {:else}- <!-- Tooltip for missing maturity info -->- <Tooltip.Provider>- <Tooltip.Root>- <Tooltip.Trigger>- <span class="inline-flex items-center justify-center mr-2 opacity-30 size-4">- <svg class="text-gray-500 size-4" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24">- <circle cx="12" cy="12" r="10" />- <path d="M9 12l2 2 4-4" />- </svg>- </span>- </Tooltip.Trigger>- <Tooltip.Content side="right" class="p-2 relative tooltip-with-arrow" align="center">- <span class="text-xs">Maturity status not available.</span>- </Tooltip.Content>- </Tooltip.Root>- </Tooltip.Provider>- {/if}- <!-- End Maturity Indicator -->-- <!-- Repository name as a separate element -->+ <MaturityItem maturity={item.maturity} /><a class="font-medium hover:underline shrink truncate" href="/images/{item.id}/">{item.repo}</a>diff --git a/src/routes/images/pull-image-dialog.svelte b/src/routes/images/pull-image-dialog.svelteindex 64752973b..043bcf87d 100644--- a/src/routes/images/pull-image-dialog.svelte+++ b/src/routes/images/pull-image-dialog.svelte@@ -6,7 +6,6 @@import { Loader2 } from '@lucide/svelte';import * as Accordion from '$lib/components/ui/accordion/index.js';import * as Select from '$lib/components/ui/select/index.js';- import { settingsStore } from '$lib/stores/settings-store';function preventDefault(handler: (event: SubmitEvent) => void) {return (event: SubmitEvent) => {@@ -23,22 +22,15 @@open?: boolean;isPulling?: boolean;pullProgress?: number;- onSubmit?: (data: { imageRef: string; tag?: string; platform?: string; registryUrl?: string }) => void; // Updated onSubmit type- // Removed registryCredentials prop+ onSubmit?: (data: { imageRef: string; tag?: string; platform?: string; registryUrl?: string }) => void;}- let {- open = $bindable(false),- isPulling = false,- pullProgress = 0,- onSubmit = (data) => console.log('Pull submitted:', data) // Default onSubmit- // Removed registryCredentials from destructuring- }: Props = $props();+ let { open = $bindable(false), isPulling = false, pullProgress = 0, onSubmit = (data) => console.log('Pull submitted:', data) }: Props = $props();let imageRef = $state('');let tag = $state('latest');let platform = $state('');- let selectedRegistryUrl = $state(''); // State for selected registry URL+ let selectedRegistryUrl = $state('');// Available platformsconst platforms = [diff --git a/src/routes/networks/[networkId]/+page.svelte b/src/routes/networks/[networkId]/+page.svelteindex 5c8171dab..21d03f4af 100644--- a/src/routes/networks/[networkId]/+page.svelte+++ b/src/routes/networks/[networkId]/+page.svelte@@ -7,7 +7,7 @@import { enhance } from '$app/forms';import * as Alert from '$lib/components/ui/alert/index.js';import { Separator } from '$lib/components/ui/separator/index.js';- import { Badge } from '$lib/components/ui/badge/index.js';+ import StatusBadge from '$lib/components/badges/status-badge.svelte';import { formatDate } from '$lib/utils/string.utils';import type { NetworkInspectInfo } from 'dockerode';import { toast } from 'svelte-sonner';@@ -35,42 +35,61 @@</script><div class="space-y-6 pb-8">- <!-- Breadcrumb Navigation -->- <div class="flex flex-col sm:flex-row justify-between sm:items-center gap-4">- <div>- <Breadcrumb.Root>- <Breadcrumb.List>- <Breadcrumb.Item>- <Breadcrumb.Link href="/networks">Networks</Breadcrumb.Link>- </Breadcrumb.Item>- <Breadcrumb.Separator />- <Breadcrumb.Item>- <Breadcrumb.Page>{network?.Name || shortId}</Breadcrumb.Page>- </Breadcrumb.Item>- </Breadcrumb.List>- </Breadcrumb.Root>- <div class="mt-2 flex items-center gap-2">- <h1 class="text-2xl font-bold tracking-tight break-all">- {network?.Name || 'Network Details'}- </h1>- {#if inUse}- <Badge variant="outline"><Container class="mr-1 size-3" /> In Use</Badge>- {/if}- {#if isPredefined}- <Badge variant="secondary">Predefined</Badge>- {/if}+ <!-- Improved Header with Better Visual Hierarchy -->+ <div class="flex flex-col space-y-4">+ <Breadcrumb.Root>+ <Breadcrumb.List>+ <Breadcrumb.Item>+ <Breadcrumb.Link href="/networks">Networks</Breadcrumb.Link>+ </Breadcrumb.Item>+ <Breadcrumb.Separator />+ <Breadcrumb.Item>+ <Breadcrumb.Page>{network?.Name || shortId}</Breadcrumb.Page>+ </Breadcrumb.Item>+ </Breadcrumb.List>+ </Breadcrumb.Root>++ <div class="flex flex-col sm:flex-row sm:items-start justify-between gap-4">+ <div class="flex flex-col">+ <div class="flex items-center gap-3">+ <h1 class="text-2xl font-bold tracking-tight">+ {network?.Name || 'Network Details'}+ </h1>++ <!-- Network ID pill -->+ <div class="hidden sm:block">+ <StatusBadge variant="gray" text={`ID: ${shortId}`} />+ </div>+ </div>++ <!-- Status badges in a row -->+ <div class="flex gap-2 mt-2">+ {#if inUse}+ <StatusBadge variant="green" text={`In Use (${connectedContainers.length})`} />+ {:else}+ <StatusBadge variant="amber" text="Unused" />+ {/if}++ {#if isPredefined}+ <StatusBadge variant="blue" text="Predefined" />+ {/if}++ <StatusBadge variant="purple" text={network?.Driver || 'Unknown'} />+ </div>+ </div>++ <!-- Action Button -->+ <div class="self-start">+ <Button variant="destructive" size="sm" onclick={triggerRemove} disabled={isRemoving || isPredefined} title={isPredefined ? 'Cannot remove predefined networks' : ''} class="w-full sm:w-auto">+ {#if isRemoving}+ <Loader2 class="mr-2 animate-spin size-4" />+ {:else}+ <Trash2 class="mr-2 size-4" />+ {/if}+ Remove Network+ </Button></div>- </div>- <div class="flex gap-2 flex-wrap">- <!-- Remove Button triggers dialog -->- <Button variant="destructive" size="sm" onclick={triggerRemove} disabled={isRemoving || isPredefined} title={isPredefined ? 'Cannot remove predefined networks' : ''}>- {#if isRemoving}- <Loader2 class="mr-2 animate-spin size-4" />- {:else}- <Trash2 class="mr-2 size-4" />- {/if} Remove- </Button><!-- Hidden form for removal action --><formid="remove-network-form"@@ -81,7 +100,6 @@return async ({ update }) => {await update({ reset: false });isRemoving = false;- // isRemoving will be reset by effect or on navigation};}}class="hidden"@@ -102,14 +120,18 @@{/if}{#if network}- <!-- Network Details Section --><div class="space-y-6">+ <!-- Network Details Card: Improved Layout --><Card.Root class="border shadow-sm">- <Card.Header>- <Card.Title>Network Details</Card.Title>+ <Card.Header class="pb-0">+ <Card.Title class="flex items-center gap-2 text-lg">+ <Network class="text-primary size-5" />+ Network Details+ </Card.Title>+ <Card.Description>Basic information about this Docker network</Card.Description></Card.Header>- <Card.Content>- <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6">+ <Card.Content class="pt-6">+ <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-y-8 gap-x-6"><!-- ID --><div class="flex items-start gap-3"><div class="bg-gray-500/10 p-2 rounded-full flex items-center justify-center shrink-0 size-10">@@ -117,7 +139,7 @@</div><div class="min-w-0 flex-1"><p class="text-sm font-medium text-muted-foreground">ID</p>- <p class="text-base font-semibold mt-1 truncate" title={network.Id}>{shortId}</p>+ <p class="text-base font-semibold mt-1 truncate" title={network.Id}>{network.Id}</p></div></div>@@ -128,7 +150,7 @@</div><div class="min-w-0 flex-1"><p class="text-sm font-medium text-muted-foreground">Name</p>- <p class="text-base font-semibold mt-1 break-all">{network.Name}</p>+ <p class="text-base font-semibold mt-1 break-words">{network.Name}</p></div></div>@@ -172,7 +194,9 @@</div><div class="min-w-0 flex-1"><p class="text-sm font-medium text-muted-foreground">Attachable</p>- <p class="text-base font-semibold mt-1">{network.Attachable ? 'Yes' : 'No'}</p>+ <p class="text-base font-semibold mt-1">+ <StatusBadge variant={network.Attachable ? 'green' : 'gray'} text={network.Attachable ? 'Yes' : 'No'} />+ </p></div></div>@@ -183,7 +207,9 @@</div><div class="min-w-0 flex-1"><p class="text-sm font-medium text-muted-foreground">Internal</p>- <p class="text-base font-semibold mt-1">{network.Internal ? 'Yes' : 'No'}</p>+ <p class="text-base font-semibold mt-1">+ <StatusBadge variant={network.Internal ? 'blue' : 'gray'} text={network.Internal ? 'Yes' : 'No'} />+ </p></div></div>@@ -194,126 +220,194 @@</div><div class="min-w-0 flex-1"><p class="text-sm font-medium text-muted-foreground">IPv6 Enabled</p>- <p class="text-base font-semibold mt-1">{network.EnableIPv6 ? 'Yes' : 'No'}</p>+ <p class="text-base font-semibold mt-1">+ <StatusBadge variant={network.EnableIPv6 ? 'indigo' : 'gray'} text={network.EnableIPv6 ? 'Yes' : 'No'} />+ </p></div></div></div></Card.Content></Card.Root>- <!-- IPAM Configuration Card -->+ <!-- IPAM Configuration Card with improved styling -->{#if network.IPAM?.Config && network.IPAM.Config.length > 0}<Card.Root class="border shadow-sm">- <Card.Header>- <Card.Title>IPAM Configuration</Card.Title>+ <Card.Header class="pb-0">+ <Card.Title class="flex items-center gap-2 text-lg">+ <Settings class="text-primary size-5" />+ IPAM Configuration+ </Card.Title>+ <Card.Description>IP Address Management settings for this network</Card.Description></Card.Header>- <Card.Content class="space-y-4">+ <Card.Content class="pt-6">{#each network.IPAM.Config as config, i (i)}- <div class="space-y-1">- {#if config.Subnet}- <p class="text-sm"><span class="font-medium text-muted-foreground">Subnet:</span> <span class="font-mono text-xs">{config.Subnet}</span></p>- {/if}- {#if config.Gateway}- <p class="text-sm"><span class="font-medium text-muted-foreground">Gateway:</span> <span class="font-mono text-xs">{config.Gateway}</span></p>- {/if}- {#if config.IPRange}- <p class="text-sm"><span class="font-medium text-muted-foreground">IP Range:</span> <span class="font-mono text-xs">{config.IPRange}</span></p>- {/if}- {#if config.AuxiliaryAddresses && Object.keys(config.AuxiliaryAddresses).length > 0}- <p class="text-sm font-medium text-muted-foreground mt-1">Auxiliary Addresses:</p>- <ul class="list-disc list-inside pl-4">- {#each Object.entries(config.AuxiliaryAddresses) as [name, addr] (name)}- <li class="text-xs font-mono">{name}: {addr}</li>- {/each}- </ul>- {/if}+ <div class="p-4 rounded-lg bg-card/50 border mb-4 last:mb-0">+ <div class="space-y-2">+ {#if config.Subnet}+ <div class="flex flex-col sm:flex-row sm:items-center">+ <span class="text-sm font-medium text-muted-foreground w-full sm:w-24">Subnet:</span>+ <code class="px-1.5 py-0.5 rounded bg-muted text-muted-foreground font-mono text-xs sm:text-sm mt-1 sm:mt-0">+ {config.Subnet}+ </code>+ </div>+ {/if}++ {#if config.Gateway}+ <div class="flex flex-col sm:flex-row sm:items-center">+ <span class="text-sm font-medium text-muted-foreground w-full sm:w-24">Gateway:</span>+ <code class="px-1.5 py-0.5 rounded bg-muted text-muted-foreground font-mono text-xs sm:text-sm mt-1 sm:mt-0">+ {config.Gateway}+ </code>+ </div>+ {/if}++ {#if config.IPRange}+ <div class="flex flex-col sm:flex-row sm:items-center">+ <span class="text-sm font-medium text-muted-foreground w-full sm:w-24">IP Range:</span>+ <code class="px-1.5 py-0.5 rounded bg-muted text-muted-foreground font-mono text-xs sm:text-sm mt-1 sm:mt-0">+ {config.IPRange}+ </code>+ </div>+ {/if}++ {#if config.AuxiliaryAddresses && Object.keys(config.AuxiliaryAddresses).length > 0}+ <div class="mt-3">+ <p class="text-sm font-medium text-muted-foreground mb-1">Auxiliary Addresses:</p>+ <ul class="space-y-1 ml-4">+ {#each Object.entries(config.AuxiliaryAddresses) as [name, addr] (name)}+ <li class="text-xs font-mono flex">+ <span class="text-muted-foreground mr-2">{name}:</span>+ <code class="px-1 py-0.5 rounded bg-muted text-muted-foreground">{addr}</code>+ </li>+ {/each}+ </ul>+ </div>+ {/if}+ </div></div>- {#if i < network.IPAM.Config.length - 1}- <Separator />- {/if}{/each}+{#if network.IPAM.Driver}- <p class="text-sm mt-2"><span class="font-medium text-muted-foreground">IPAM Driver:</span> {network.IPAM.Driver}</p>+ <div class="flex items-center mt-4">+ <span class="text-sm font-medium text-muted-foreground mr-2">IPAM Driver:</span>+ <StatusBadge variant="cyan" text={network.IPAM.Driver} />+ </div>{/if}+{#if network.IPAM.Options && Object.keys(network.IPAM.Options).length > 0}- <p class="text-sm font-medium text-muted-foreground mt-2">IPAM Options:</p>- {#each Object.entries(network.IPAM.Options) as [key, value] (key)}- <p class="text-xs font-mono pl-4">{key}: {value}</p>- {/each}+ <div class="mt-4">+ <p class="text-sm font-medium text-muted-foreground mb-2">IPAM Options:</p>+ <div class="bg-muted/50 p-3 rounded-lg border">+ {#each Object.entries(network.IPAM.Options) as [key, value] (key)}+ <div class="flex justify-between text-xs font-mono mb-1 last:mb-0">+ <span class="text-muted-foreground">{key}:</span>+ <span>{value}</span>+ </div>+ {/each}+ </div>+ </div>{/if}</Card.Content></Card.Root>{/if}- <!-- Connected Containers Card -->+ <!-- Connected Containers Card - Refined -->{#if connectedContainers.length > 0}<Card.Root class="border shadow-sm">- <Card.Header>- <Card.Title class="flex items-center gap-2"><Container class="text-muted-foreground size-5" /> Connected Containers ({connectedContainers.length})</Card.Title>+ <Card.Header class="pb-0">+ <Card.Title class="flex items-center gap-2 text-lg">+ <Container class="text-primary size-5" />+ Connected Containers+ </Card.Title>+ <Card.Description>+ {connectedContainers.length} container{connectedContainers.length === 1 ? '' : 's'} connected to this network+ </Card.Description></Card.Header>- <Card.Content class="space-y-2">- {#each connectedContainers as container (container.Name)}- <div class="text-sm flex flex-col sm:flex-row sm:items-center">- <span class="font-medium w-full sm:w-1/3 break-all">- <a href="/containers/{container.Name}" class="hover:underline text-primary">{container.Name}</a>- </span>- <span class="font-mono text-xs sm:text-sm break-all w-full sm:w-2/3">- {container.IPv4Address || container.IPv6Address || 'N/A'}- </span>- </div>- {#if connectedContainers.indexOf(container) < connectedContainers.length - 1}- <Separator class="my-2" />- {/if}- {/each}+ <Card.Content class="pt-6">+ <div class="bg-card rounded-lg border divide-y">+ {#each connectedContainers as container (container.Name)}+ <div class="p-3 flex flex-col sm:flex-row sm:items-center">+ <div class="font-medium w-full sm:w-1/3 break-all mb-2 sm:mb-0">+ <a href="/containers/{container.Name}" class="hover:underline text-primary flex items-center">+ <Container class="size-3.5 mr-1.5 text-muted-foreground" />+ {container.Name}+ </a>+ </div>+ <div class="w-full sm:w-2/3 pl-0 sm:pl-4">+ <code class="px-1.5 py-0.5 text-xs sm:text-sm rounded bg-muted text-muted-foreground font-mono break-all">+ {container.IPv4Address || container.IPv6Address || 'N/A'}+ </code>+ </div>+ </div>+ {/each}+ </div></Card.Content></Card.Root>{/if}- <!-- Labels Card -->+ <!-- Labels Card - Enhanced -->{#if network.Labels && Object.keys(network.Labels).length > 0}<Card.Root class="border shadow-sm">- <Card.Header>- <Card.Title class="flex items-center gap-2"><Tag class="text-muted-foreground size-5" /> Labels</Card.Title>+ <Card.Header class="pb-0">+ <Card.Title class="flex items-center gap-2 text-lg">+ <Tag class="text-primary size-5" />+ Labels+ </Card.Title>+ <Card.Description>User-defined metadata attached to this network</Card.Description></Card.Header>- <Card.Content class="space-y-2">- {#each Object.entries(network.Labels) as [key, value] (key)}- <div class="text-sm flex flex-col sm:flex-row sm:items-center">- <span class="font-medium text-muted-foreground w-full sm:w-1/4 break-all">{key}:</span>- <span class="font-mono text-xs sm:text-sm break-all w-full sm:w-3/4">{value}</span>- </div>- {#if Object.keys(network.Labels).indexOf(key) < Object.keys(network.Labels).length - 1}- <Separator class="my-2" />- {/if}- {/each}+ <Card.Content class="pt-6">+ <div class="bg-card rounded-lg border divide-y">+ {#each Object.entries(network.Labels) as [key, value] (key)}+ <div class="p-3 flex flex-col sm:flex-row">+ <div class="font-medium text-muted-foreground w-full sm:w-1/3 break-all mb-2 sm:mb-0">+ {key}+ </div>+ <div class="font-mono text-xs sm:text-sm break-all w-full sm:w-2/3 bg-muted/50 p-2 rounded">+ {value}+ </div>+ </div>+ {/each}+ </div></Card.Content></Card.Root>{/if}- <!-- Options Card -->+ <!-- Options Card - Enhanced -->{#if network.Options && Object.keys(network.Options).length > 0}<Card.Root class="border shadow-sm">- <Card.Header>- <Card.Title>Options</Card.Title>+ <Card.Header class="pb-0">+ <Card.Title class="flex items-center gap-2 text-lg">+ <Settings class="text-primary size-5" />+ Options+ </Card.Title>+ <Card.Description>Network driver-specific options</Card.Description></Card.Header>- <Card.Content class="space-y-2">- {#each Object.entries(network.Options) as [key, value] (key)}- <div class="text-sm flex flex-col sm:flex-row sm:items-center">- <span class="font-medium text-muted-foreground w-full sm:w-1/4 break-all">{key}:</span>- <span class="font-mono text-xs sm:text-sm break-all w-full sm:w-3/4">{value}</span>- </div>- {#if Object.keys(network.Options).indexOf(key) < Object.keys(network.Options).length - 1}- <Separator class="my-2" />- {/if}- {/each}+ <Card.Content class="pt-6">+ <div class="bg-card rounded-lg border divide-y">+ {#each Object.entries(network.Options) as [key, value] (key)}+ <div class="p-3 flex flex-col sm:flex-row">+ <div class="font-medium text-muted-foreground w-full sm:w-1/3 break-all mb-2 sm:mb-0">+ {key}+ </div>+ <div class="font-mono text-xs sm:text-sm break-all w-full sm:w-2/3 bg-muted/50 p-2 rounded">+ {value}+ </div>+ </div>+ {/each}+ </div></Card.Content></Card.Root>{/if}</div>{:else}- <!-- Network Not Found Section -->- <div class="text-center py-12">- <p class="text-lg font-medium text-muted-foreground">Network not found.</p>- <Button href="/networks" variant="outline" size="sm" class="mt-4">+ <!-- Network Not Found with improved styling -->+ <div class="flex flex-col items-center justify-center py-16 px-4 text-center">+ <div class="bg-muted/30 rounded-full p-4 mb-4">+ <Network class="text-muted-foreground size-10 opacity-70" />+ </div>+ <h2 class="text-xl font-medium mb-2">Network Not Found</h2>+ <p class="text-muted-foreground mb-6">The requested network could not be found or is no longer available.</p>+ <Button href="/networks" variant="outline" size="sm"><ArrowLeft class="mr-2 size-4" /> Back to Networks</Button></div>diff --git a/src/routes/stacks/[stackId]/+page.svelte b/src/routes/stacks/[stackId]/+page.svelteindex b1d875dc5..e755cd81f 100644--- a/src/routes/stacks/[stackId]/+page.svelte+++ b/src/routes/stacks/[stackId]/+page.svelte@@ -47,6 +47,8 @@const baseServerUrl = $derived(settings?.baseServerUrl || 'localhost');+ let activeTab = $state('config');+$effect(() => {isLoading.deploying = false;isLoading.stopping = false;@@ -139,57 +141,71 @@</script><div class="space-y-6 pb-8">- <div class="flex flex-col sm:flex-row justify-between sm:items-center gap-4">- <div>- <Breadcrumb.Root>- <Breadcrumb.List>- <Breadcrumb.Item>- <Breadcrumb.Link href="/">Dashboard</Breadcrumb.Link>- </Breadcrumb.Item>- <Breadcrumb.Separator />- <Breadcrumb.Item>- <Breadcrumb.Link href="/stacks">Stacks</Breadcrumb.Link>- </Breadcrumb.Item>- <Breadcrumb.Separator />- <Breadcrumb.Item>- <Breadcrumb.Page>{stack?.name || 'Loading...'}</Breadcrumb.Page>- </Breadcrumb.Item>- </Breadcrumb.List>- </Breadcrumb.Root>-- <div class="mt-2 flex items-center gap-2">- <h1 class="text-2xl font-bold tracking-tight flex items-center gap-2">+ <!-- Enhanced Header Section -->+ <div class="flex flex-col space-y-4">+ <Breadcrumb.Root>+ <Breadcrumb.List>+ <Breadcrumb.Item>+ <Breadcrumb.Link href="/">Dashboard</Breadcrumb.Link>+ </Breadcrumb.Item>+ <Breadcrumb.Separator />+ <Breadcrumb.Item>+ <Breadcrumb.Link href="/stacks">Stacks</Breadcrumb.Link>+ </Breadcrumb.Item>+ <Breadcrumb.Separator />+ <Breadcrumb.Item>+ <Breadcrumb.Page>{stack?.name || 'Loading...'}</Breadcrumb.Page>+ </Breadcrumb.Item>+ </Breadcrumb.List>+ </Breadcrumb.Root>++ <div class="flex flex-col sm:flex-row sm:items-start justify-between gap-4">+ <div class="flex flex-col">+ <h1 class="text-2xl font-bold tracking-tight">{stack?.name || 'Stack Details'}- {#if stack && servicePorts && Object.keys(servicePorts).length > 0}- {@const allUniquePorts = [...new Set(Object.values(servicePorts).flat())]}+ </h1>++ <!-- Ports as badges under the title for better visibility -->+ {#if stack && servicePorts && Object.keys(servicePorts).length > 0}+ {@const allUniquePorts = [...new Set(Object.values(servicePorts).flat())]}+ <div class="flex flex-wrap gap-2 mt-2">{#each allUniquePorts as port}- <a href={getServicePortUrl(stack, port)} target="_blank" rel="noopener noreferrer" class="text-xs bg-blue-500/10 text-blue-600 dark:text-blue-400 px-2 py-1 rounded-md hover:bg-blue-500/20 transition-colors flex items-center gap-1 self-start mt-1.5">- {port}- <ExternalLink class="size-3" />+ <a href={getServicePortUrl(stack, port)} target="_blank" rel="noopener noreferrer" class="inline-flex items-center px-2 py-1 rounded-md bg-blue-500/10 text-blue-600 dark:text-blue-400 text-xs font-medium hover:bg-blue-500/20 transition-colors">+ Port {port}+ <ExternalLink class="size-3 ml-1" /></a>{/each}- {/if}- </h1>- </div>- </div>+ </div>+ {/if}- {#if stack}- <div class="flex gap-2 flex-wrap">- <ActionButtons- id={stack.id}- type="stack"- itemState={stack.status}- loading={{- start: isLoading.deploying,- stop: isLoading.stopping,- restart: isLoading.restarting,- remove: isLoading.removing- }}- />+ <!-- Stack status badges -->+ {#if stack?.status}+ <div class="mt-2">+ <StatusBadge variant={statusVariantMap[stack.status.toLowerCase()] || 'gray'} text={capitalizeFirstLetter(stack.status)} />+ </div>+ {/if}</div>- {/if}++ <!-- Better positioned action buttons -->+ {#if stack}+ <div class="self-start">+ <ActionButtons+ id={stack.id}+ type="stack"+ itemState={stack.status}+ loading={{+ start: isLoading.deploying,+ stop: isLoading.stopping,+ restart: isLoading.restarting,+ remove: isLoading.removing+ }}+ />+ </div>+ {/if}+ </div></div>+ <!-- Error Alert -->{#if data.error}<Alert.Root variant="destructive"><AlertCircle class="size-4" />@@ -199,32 +215,36 @@{/if}{#if stack}- <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6">- <Card.Root>+ <!-- Summary cards remain the same -->+ <div class="grid grid-cols-1 sm:grid-cols-3 gap-4">+ <!-- Services Card -->+ <Card.Root class="border shadow-sm"><Card.Content class="p-4 flex items-center justify-between"><div><p class="text-sm font-medium text-muted-foreground">Services</p><p class="text-2xl font-bold">{stack.serviceCount}</p></div>- <div class="bg-primary/10 p-2 rounded-full">+ <div class="bg-primary/10 p-3 rounded-full"><Layers class="text-primary size-5" /></div></Card.Content></Card.Root>- <Card.Root>+ <!-- Running Services Card -->+ <Card.Root class="border shadow-sm"><Card.Content class="p-4 flex items-center justify-between"><div><p class="text-sm font-medium text-muted-foreground">Running Services</p><p class="text-2xl font-bold">{stack.runningCount}</p></div>- <div class="bg-green-500/10 p-2 rounded-full">+ <div class="bg-green-500/10 p-3 rounded-full"><Layers class="text-green-500 size-5" /></div></Card.Content></Card.Root>- <Card.Root>+ <!-- Created Card -->+ <Card.Root class="border shadow-sm"><Card.Content class="p-4 flex items-center justify-between"><div><p class="text-sm font-medium text-muted-foreground">Created</p>@@ -232,140 +252,162 @@{new Date(stack.createdAt ?? '').toLocaleString()}</p></div>- <div class="bg-blue-500/10 p-2 rounded-full">+ <div class="bg-blue-500/10 p-3 rounded-full"><FileStack class="text-blue-500 size-5" /></div></Card.Content></Card.Root></div>- <div class="space-y-6">- <Card.Root class="border shadow-sm">- <Card.Header>- <Card.Title>Stack Configuration</Card.Title>- <Card.Description>Edit stack settings, compose file, and environment variables</Card.Description>- </Card.Header>- <Card.Content>- <div class="space-y-4">- <div class="grid w-full max-w-sm items-center gap-1.5">- <Label for="name">Stack Name</Label>- <Input type="text" id="name" name="name" bind:value={name} required disabled={isLoading.saving || stack?.status === 'running' || stack?.status === 'partially running'} />- {#if stack?.status === 'running' || stack?.status === 'partially running'}- <p class="text-xs text-muted-foreground">Stack name cannot be changed while the stack is running. Please stop the stack first.</p>- {/if}+ <!-- Adjust the tab implementation -->+ <Card.Root class="border shadow-sm">+ <div class="border-b flex">+ <button class="px-4 py-3 font-medium text-sm border-b-2 {activeTab === 'config' ? 'border-primary text-primary' : 'border-transparent hover:text-muted-foreground/80 hover:border-muted-foreground/20'}" onclick={() => (activeTab = 'config')}>+ <div class="flex items-center gap-1.5">+ <FileStack class="size-4" />+ <span>Configuration</span>+ </div>+ </button>+ <button class="px-4 py-3 font-medium text-sm border-b-2 {activeTab === 'services' ? 'border-primary text-primary' : 'border-transparent hover:text-muted-foreground/80 hover:border-muted-foreground/20'}" onclick={() => (activeTab = 'services')}>+ <div class="flex items-center gap-1.5">+ <Layers class="size-4" />+ <span>Services ({stack.serviceCount})</span>+ </div>+ </button>+ </div>++ {#if activeTab === 'config'}+ <!-- Stack Configuration Content -->+ <Card.Content class="pt-6">+ <div class="space-y-6">+ <!-- Stack Name Field with Save Button to the right -->+ <div class="flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4">+ <div class="w-full max-w-sm">+ <Label for="name" class="mb-2 block">Stack Name</Label>+ <Input type="text" id="name" name="name" bind:value={name} required disabled={isLoading.saving || stack?.status === 'running' || stack?.status === 'partially running'} class="w-full" />+ {#if stack?.status === 'running' || stack?.status === 'partially running'}+ <p class="text-xs text-muted-foreground mt-1">Stack name cannot be changed while the stack is running. Please stop the stack first.</p>+ {/if}+ </div>++ <!-- Save button positioned right -->+ <div class="self-start">+ <Button type="button" variant={hasChanges ? 'default' : 'secondary'} onclick={handleSaveChanges} disabled={isLoading.saving || !hasChanges} class="min-w-[120px]">+ {#if isLoading.saving}+ <Loader2 class="mr-2 animate-spin size-4" /> Saving...+ {:else}+ <Save class="mr-2 size-4" /> Save Changes+ {/if}+ </Button>+ </div></div>- <div class="grid grid-cols-1 md:grid-cols-3 gap-4">+ <!-- Editors Section -->+ <div class="grid grid-cols-1 md:grid-cols-3 gap-6">+ <!-- Compose Editor - 2/3 width --><div class="md:col-span-2 space-y-2">- <Label for="compose-editor" class="mb-2">Docker Compose File</Label>- <div class="border rounded-md overflow-hidden mt-2 h-[550px]">+ <Label for="compose-editor" class="block">Docker Compose File</Label>+ <div class="border rounded-lg overflow-hidden mt-2 h-[550px]"><YamlEditor bind:value={composeContent} readOnly={isLoading.saving || isLoading.deploying || isLoading.stopping || isLoading.restarting || isLoading.removing} /></div>- <p class="text-xs text-muted-foreground">- Edit your <span class="font-bold">compose.yaml</span> file directly. Syntax errors will be highlighted.+ <p class="text-xs text-muted-foreground mt-2">+ Edit your <span class="font-medium">compose.yaml</span> file directly. Syntax errors will be highlighted.</p></div>+ <!-- Environment Editor - 1/3 width --><div class="space-y-2">- <Label for="env-editor" class="mb-2">Environment Configuration (.env)</Label>-- <div class="border rounded-md overflow-hidden mt-2 h-[550px]">+ <Label for="env-editor" class="block">Environment Configuration (.env)</Label>+ <div class="border rounded-lg overflow-hidden mt-2 h-[550px]"><EnvEditor bind:value={envContent} readOnly={isLoading.saving || isLoading.deploying || isLoading.stopping || isLoading.restarting || isLoading.removing} /></div>- <p class="text-xs text-muted-foreground">Define environment variables in KEY=value format. These will be saved as a .env file in the stack directory.</p>+ <p class="text-xs text-muted-foreground mt-2">Define environment variables in KEY=value format. These will be saved as a .env file in the stack directory.</p></div></div></div></Card.Content>- <Card.Footer class="flex justify-between">+ <Card.Footer class="flex justify-start border-t p-6"><Button variant="outline" type="button" onclick={() => window.history.back()} disabled={isLoading.saving}><ArrowLeft class="mr-2 size-4" />Back</Button>- <Button type="button" variant="default" onclick={handleSaveChanges} disabled={isLoading.saving || !hasChanges}>- {#if isLoading.saving}- <Loader2 class="mr-2 animate-spin size-4" /> Saving...- {:else}- <Save class="mr-2 size-4" /> Save Changes- {/if}- </Button></Card.Footer>- </Card.Root>- </div>-- <Card.Root class="border shadow-sm">- <Card.Header>- <Card.Title>Services</Card.Title>- <Card.Description>Containers in this stack</Card.Description>- </Card.Header>- <Card.Content>- <div class="space-y-2">- {#if stack.services && stack.services.length > 0}- {#each stack.services as service (service.id || service.name)}- {@const status = service.state?.Status || 'unknown'}- {@const variant = statusVariantMap[status.toLowerCase()] || 'gray'}-- {#if service.id}- <a href={`/containers/${service.id}`} class="flex flex-col p-3 border rounded-md hover:bg-muted/50 transition-colors">- <div class="flex items-center justify-between">- <div class="flex items-center gap-3">- <div class="bg-muted rounded-md p-1">- <Layers class="size-4" />+ {:else}+ <!-- Services List Content -->+ <Card.Content class="pt-6 pb-6">+ <div class="space-y-3">+ {#if stack.services && stack.services.length > 0}+ {#each stack.services as service (service.id || service.name)}+ {@const status = service.state?.Status || 'unknown'}+ {@const variant = statusVariantMap[status.toLowerCase()] || 'gray'}++ {#if service.id}+ <!-- Service with ID (clickable) -->+ <a href={`/containers/${service.id}`} class="flex flex-col p-4 border rounded-lg hover:bg-muted/50 transition-colors">+ <div class="flex flex-col sm:flex-row sm:items-center justify-between gap-y-2">+ <div class="flex items-center gap-3">+ <div class="bg-primary/10 p-2 rounded-full flex items-center justify-center">+ <Layers class="text-primary size-4" />+ </div>+ <div>+ <p class="font-medium">{service.name}</p>+ <p class="text-xs text-muted-foreground">ID: {service.id.substring(0, 12)}</p>+ </div></div>- <div>- <p class="font-medium flex items-center gap-1">{service.name}</p>- <p class="text-xs text-muted-foreground">{service.id.substring(0, 12)}</p>+ <div class="flex items-center gap-3 ml-0 sm:ml-auto">+ <StatusBadge {variant} text={capitalizeFirstLetter(status)} />+ <div class="flex items-center text-primary text-xs font-medium">+ <span class="hidden sm:inline">View details</span>+ <ArrowRight class="size-3 ml-1" />+ </div></div></div>- <div class="flex items-center gap-2">- <StatusBadge {variant} text={capitalizeFirstLetter(status)} />- <span class="text-xs text-blue-500 ml-2 flex items-center">- <span class="hidden sm:inline">View details</span>- <ArrowRight class="inline-block ml-1 size-3" />- </span>- </div>- </div>- </a>- {:else}- <div class="flex flex-col p-3 border rounded-md">- <div class="flex items-center justify-between">- <div class="flex items-center gap-3">- <div class="bg-muted rounded-md p-1">- <Layers class="size-4" />+ </a>+ {:else}+ <!-- Service without ID (not clickable) -->+ <div class="flex flex-col p-4 border rounded-lg bg-card">+ <div class="flex flex-col sm:flex-row sm:items-center justify-between gap-y-2">+ <div class="flex items-center gap-3">+ <div class="bg-muted/50 p-2 rounded-full flex items-center justify-center">+ <Layers class="text-muted-foreground size-4" />+ </div>+ <div>+ <p class="font-medium">{service.name}</p>+ <p class="text-xs text-muted-foreground">Not created</p>+ </div></div>- <div>- <p class="font-medium flex items-center gap-1">{service.name}</p>- <p class="text-xs text-muted-foreground">Not created</p>+ <div class="flex items-center ml-0 sm:ml-auto">+ <StatusBadge {variant} text={capitalizeFirstLetter(status)} /></div></div>- <div class="flex items-center gap-2">- <StatusBadge {variant} text={capitalizeFirstLetter(status)} />- </div></div>+ {/if}+ {/each}+ {:else}+ <!-- Empty state -->+ <div class="flex flex-col items-center justify-center py-10 px-4 border rounded-lg bg-muted/10">+ <div class="bg-muted/30 p-3 rounded-full mb-3">+ <Layers class="text-muted-foreground size-5 opacity-70" /></div>- {/if}- {/each}- {:else}- <div class="text-center py-6 text-muted-foreground">- <p>No services defined in this stack</p>- </div>- {/if}- </div>- </Card.Content>+ <p class="text-muted-foreground text-center">No services defined in this stack</p>+ </div>+ {/if}+ </div>+ </Card.Content>+ {/if}</Card.Root>{:else if !data.error}- <div class="flex flex-col items-center justify-center py-12 border rounded-lg shadow-sm bg-card">- <div class="rounded-full bg-muted/50 p-4 mb-4">- <AlertCircle class="text-muted-foreground size-8" />- </div>- <h2 class="text-lg font-medium mb-2">Stack Not Found</h2>- <p class="text-center text-muted-foreground max-w-md">Could not load stack data. It may have been removed or the Docker engine is not accessible.</p>- <div class="flex gap-3 mt-6">- <Button variant="outline" href="/stacks">- <ArrowLeft class="mr-2 size-4" />- Back to Stacks- </Button>+ <!-- Not Found State - Enhanced -->+ <div class="flex flex-col items-center justify-center py-14 px-6 border rounded-lg bg-card">+ <div class="bg-muted/40 rounded-full p-5 mb-5">+ <FileStack class="text-muted-foreground size-10 opacity-60" /></div>+ <h2 class="text-xl font-medium mb-2">Stack Not Found</h2>+ <p class="text-center text-muted-foreground max-w-md mb-6">Could not load stack data. It may have been removed or the Docker engine is not accessible.</p>+ <Button variant="outline" href="/stacks">+ <ArrowLeft class="mr-2 size-4" />+ Back to Stacks+ </Button></div>{/if}</div>diff --git a/src/routes/volumes/+page.svelte b/src/routes/volumes/+page.svelteindex a0a70247d..8681b6a09 100644--- a/src/routes/volumes/+page.svelte+++ b/src/routes/volumes/+page.svelte@@ -240,6 +240,7 @@idKey="name"columns={[{ accessorKey: 'name', header: 'Name' },+ { accessorKey: 'inUse', header: ' ', enableSorting: false },{ accessorKey: 'mountpoint', header: 'Mountpoint' },{ accessorKey: 'driver', header: 'Driver' },{ accessorKey: 'actions', header: ' ', enableSorting: false }@@ -256,11 +257,11 @@<span class="truncate"><a class="font-medium hover:underline" href="/volumes/{item.name}/">{item.name}</a></span>- {#if !item.inUse}- <StatusBadge text="Unused" variant="amber" />- {/if}</div></Table.Cell>+ <Table.Cell>+ <StatusBadge text={item.inUse ? 'In Use' : 'Unused'} variant={item.inUse ? 'green' : 'amber'} />+ </Table.Cell><Table.Cell>{item.mountpoint}</Table.Cell><Table.Cell>{item.driver}</Table.Cell><Table.Cell>diff --git a/src/routes/volumes/[volumeName]/+page.svelte b/src/routes/volumes/[volumeName]/+page.svelteindex 54f30f063..7eb45b4ea 100644--- a/src/routes/volumes/[volumeName]/+page.svelte+++ b/src/routes/volumes/[volumeName]/+page.svelte@@ -8,7 +8,7 @@import { invalidateAll } from '$app/navigation';import * as Alert from '$lib/components/ui/alert/index.js';import { Separator } from '$lib/components/ui/separator/index.js';- import { Badge } from '$lib/components/ui/badge/index.js';+ import StatusBadge from '$lib/components/badges/status-badge.svelte';import { formatDate } from '$lib/utils/string.utils';let { data, form }: { data: PageData; form: ActionData } = $props();@@ -35,40 +35,58 @@</script><div class="space-y-6 pb-8">- <div class="flex flex-col sm:flex-row justify-between sm:items-center gap-4">- <div>- <Breadcrumb.Root>- <Breadcrumb.List>- <Breadcrumb.Item>- <Breadcrumb.Link href="/volumes">Volumes</Breadcrumb.Link>- </Breadcrumb.Item>- <Breadcrumb.Separator />- <Breadcrumb.Item>- <Breadcrumb.Page>{volume?.Name || 'Details'}</Breadcrumb.Page>- </Breadcrumb.Item>- </Breadcrumb.List>- </Breadcrumb.Root>- <div class="mt-2 flex items-center gap-2">- <h1 class="text-2xl font-bold tracking-tight break-all">- {volume?.Name || 'Volume Details'}- </h1>- {#if inUse}- <Badge variant="outline"><Info class="mr-1 size-3" /> In Use</Badge>- {/if}+ <!-- Improved Header with Better Visual Hierarchy -->+ <div class="flex flex-col space-y-4">+ <Breadcrumb.Root>+ <Breadcrumb.List>+ <Breadcrumb.Item>+ <Breadcrumb.Link href="/volumes">Volumes</Breadcrumb.Link>+ </Breadcrumb.Item>+ <Breadcrumb.Separator />+ <Breadcrumb.Item>+ <Breadcrumb.Page>{volume?.Name || 'Details'}</Breadcrumb.Page>+ </Breadcrumb.Item>+ </Breadcrumb.List>+ </Breadcrumb.Root>++ <div class="flex flex-col sm:flex-row sm:items-start justify-between gap-4">+ <div class="flex flex-col">+ <div class="flex items-center gap-3">+ <h1 class="text-2xl font-bold tracking-tight">+ {volume?.Name || 'Volume Details'}+ </h1>+ </div>++ <!-- Status badges in a row -->+ <div class="flex gap-2 mt-2">+ {#if inUse}+ <StatusBadge variant="green" text="In Use" />+ {:else}+ <StatusBadge variant="amber" text="Unused" />+ {/if}++ {#if volume?.Driver}+ <StatusBadge variant="blue" text={volume.Driver} />+ {/if}++ {#if volume?.Scope}+ <StatusBadge variant="purple" text={volume.Scope} />+ {/if}+ </div></div>- </div>- <div class="flex gap-2 flex-wrap">- <Button variant="outline" size="sm" onclick={refreshData} disabled={isRefreshing}>- <RefreshCw class={`h-4 w-4 mr-2 ${isRefreshing ? 'animate-spin' : ''}`} /> Refresh- </Button>- <Button variant="destructive" size="sm" onclick={triggerRemove} disabled={isRemoving}>- {#if isRemoving}- <Loader2 class="mr-2 animate-spin size-4" />- {:else}- <Trash2 class="mr-2 size-4" />- {/if} Remove- </Button>+ <!-- Action Buttons -->+ <div class="flex gap-2 self-start">+ <Button variant="destructive" size="sm" onclick={triggerRemove} disabled={isRemoving}>+ {#if isRemoving}+ <Loader2 class="animate-spin size-4" />+ {:else}+ <Trash2 class="size-4" />+ {/if} Remove Volume+ </Button>+ </div>++ <!-- Hidden form for removal action --><formid="remove-volume-form"method="POST"@@ -87,6 +105,7 @@</div></div>+ <!-- Error Alert -->{#if form?.error}<Alert.Root variant="destructive"><AlertCircle class="mr-2 size-4" />@@ -97,22 +116,29 @@{#if volume}<div class="space-y-6">+ <!-- Volume Details Card: Improved Layout --><Card.Root class="border shadow-sm">- <Card.Header>- <Card.Title>Volume Details</Card.Title>+ <Card.Header class="pb-0">+ <Card.Title class="flex items-center gap-2 text-lg">+ <Database class="text-primary size-5" />+ Volume Details+ </Card.Title>+ <Card.Description>Basic information about this Docker volume</Card.Description></Card.Header>- <Card.Content>- <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6">+ <Card.Content class="pt-6">+ <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-y-8 gap-x-6">+ <!-- Name --><div class="flex items-start gap-3"><div class="bg-gray-500/10 p-2 rounded-full flex items-center justify-center shrink-0 size-10"><Database class="text-gray-500 size-5" /></div><div class="min-w-0 flex-1"><p class="text-sm font-medium text-muted-foreground">Name</p>- <p class="text-base font-semibold mt-1 break-all">{volume.Name}</p>+ <p class="text-base font-semibold mt-1 break-words">{volume.Name}</p></div></div>+ <!-- Driver --><div class="flex items-start gap-3"><div class="bg-blue-500/10 p-2 rounded-full flex items-center justify-center shrink-0 size-10"><HardDrive class="text-blue-500 size-5" />@@ -123,6 +149,7 @@</div></div>+ <!-- Created --><div class="flex items-start gap-3"><div class="bg-green-500/10 p-2 rounded-full flex items-center justify-center shrink-0 size-10"><Clock class="text-green-500 size-5" />@@ -133,6 +160,7 @@</div></div>+ <!-- Scope --><div class="flex items-start gap-3"><div class="bg-purple-500/10 p-2 rounded-full flex items-center justify-center shrink-0 size-10"><Globe class="text-purple-500 size-5" />@@ -143,61 +171,116 @@</div></div>- <div class="flex items-start gap-3 col-span-1 sm:col-span-2">+ <!-- In Use -->+ <div class="flex items-start gap-3">+ <div class="bg-amber-500/10 p-2 rounded-full flex items-center justify-center shrink-0 size-10">+ <Info class="text-amber-500 size-5" />+ </div>+ <div class="min-w-0 flex-1">+ <p class="text-sm font-medium text-muted-foreground">Status</p>+ <p class="text-base font-semibold mt-1">+ {#if inUse}+ <StatusBadge variant="green" text="In Use" />+ {:else}+ <StatusBadge variant="amber" text="Unused" />+ {/if}+ </p>+ </div>+ </div>++ <!-- Mountpoint - Full width -->+ <div class="flex items-start gap-3 col-span-1 sm:col-span-2 lg:col-span-3"><div class="bg-teal-500/10 p-2 rounded-full flex items-center justify-center shrink-0 size-10"><Layers class="text-teal-500 size-5" /></div><div class="min-w-0 flex-1"><p class="text-sm font-medium text-muted-foreground">Mountpoint</p>- <p class="text-sm font-mono mt-1 break-all">{volume.Mountpoint}</p>+ <div class="mt-2 bg-muted/50 p-3 rounded-lg border">+ <code class="text-sm font-mono break-all">{volume.Mountpoint}</code>+ </div></div></div></div></Card.Content></Card.Root>+ <!-- Labels Card - Enhanced -->{#if volume.Labels && Object.keys(volume.Labels).length > 0}<Card.Root class="border shadow-sm">- <Card.Header>- <Card.Title class="flex items-center gap-2"><Tag class="text-muted-foreground size-5" /> Labels</Card.Title>+ <Card.Header class="pb-0">+ <Card.Title class="flex items-center gap-2 text-lg">+ <Tag class="text-primary size-5" />+ Labels+ </Card.Title>+ <Card.Description>User-defined metadata attached to this volume</Card.Description></Card.Header>- <Card.Content class="space-y-2">- {#each Object.entries(volume.Labels) as [key, value] (key)}- <div class="text-sm flex flex-col sm:flex-row sm:items-center">- <span class="font-medium text-muted-foreground w-full sm:w-1/4 break-all">{key}:</span>- <span class="font-mono text-xs sm:text-sm break-all w-full sm:w-3/4">{value}</span>- </div>- {#if !Object.is(Object.keys(volume.Labels).length - 1, Object.keys(volume.Labels).indexOf(key))}- <Separator class="my-2" />- {/if}- {/each}+ <Card.Content class="pt-6">+ <div class="bg-card rounded-lg border divide-y">+ {#each Object.entries(volume.Labels) as [key, value] (key)}+ <div class="p-3 flex flex-col sm:flex-row">+ <div class="font-medium text-muted-foreground w-full sm:w-1/3 break-all mb-2 sm:mb-0">+ {key}+ </div>+ <div class="font-mono text-xs sm:text-sm break-all w-full sm:w-2/3 bg-muted/50 p-2 rounded">+ {value}+ </div>+ </div>+ {/each}+ </div></Card.Content></Card.Root>{/if}+ <!-- Driver Options Card - Enhanced -->{#if volume.Options && Object.keys(volume.Options).length > 0}<Card.Root class="border shadow-sm">- <Card.Header>- <Card.Title>Driver Options</Card.Title>+ <Card.Header class="pb-0">+ <Card.Title class="flex items-center gap-2 text-lg">+ <HardDrive class="text-primary size-5" />+ Driver Options+ </Card.Title>+ <Card.Description>Volume driver-specific options</Card.Description></Card.Header>- <Card.Content class="space-y-2">- {#each Object.entries(volume.Options) as [key, value] (key)}- <div class="text-sm flex flex-col sm:flex-row sm:items-center">- <span class="font-medium text-muted-foreground w-full sm:w-1/4 break-all">{key}:</span>- <span class="font-mono text-xs sm:text-sm break-all w-full sm:w-3/4">{value}</span>+ <Card.Content class="pt-6">+ <div class="bg-card rounded-lg border divide-y">+ {#each Object.entries(volume.Options) as [key, value] (key)}+ <div class="p-3 flex flex-col sm:flex-row">+ <div class="font-medium text-muted-foreground w-full sm:w-1/3 break-all mb-2 sm:mb-0">+ {key}+ </div>+ <div class="font-mono text-xs sm:text-sm break-all w-full sm:w-2/3 bg-muted/50 p-2 rounded">+ {value}+ </div>+ </div>+ {/each}+ </div>+ </Card.Content>+ </Card.Root>+ {/if}++ <!-- If no labels or options, we can show this note -->+ {#if (!volume.Labels || Object.keys(volume.Labels).length === 0) && (!volume.Options || Object.keys(volume.Options).length === 0)}+ <Card.Root class="border shadow-sm bg-muted/10">+ <Card.Content class="pt-6 pb-6 text-center">+ <div class="flex flex-col items-center justify-center">+ <div class="bg-muted/30 rounded-full p-3 mb-4">+ <Tag class="text-muted-foreground opacity-50 size-5" /></div>- {#if !Object.is(Object.keys(volume.Options).length - 1, Object.keys(volume.Options).indexOf(key))}- <Separator class="my-2" />- {/if}- {/each}+ <p class="text-muted-foreground">This volume has no additional labels or driver options.</p>+ </div></Card.Content></Card.Root>{/if}</div>{:else}- <div class="text-center py-12">- <p class="text-lg font-medium text-muted-foreground">Volume not found.</p>- <Button href="/volumes" variant="outline" size="sm" class="mt-4">+ <!-- Volume Not Found with improved styling -->+ <div class="flex flex-col items-center justify-center py-16 px-4 text-center">+ <div class="bg-muted/30 rounded-full p-4 mb-4">+ <Database class="text-muted-foreground size-10 opacity-70" />+ </div>+ <h2 class="text-xl font-medium mb-2">Volume Not Found</h2>+ <p class="text-muted-foreground mb-6">The requested volume could not be found or is no longer available.</p>+ <Button href="/volumes" variant="outline" size="sm"><ArrowLeft class="mr-2 size-4" /> Back to Volumes</Button></div>