Skip to content

Modern Docker Management, Designed for Everyone

feat: expand system info dialog to show more information (#965)

Kyle Mendella2940a2362f0
diff --git a/backend/internal/api/system_handler.go b/backend/internal/api/system_handler.go
index d12cda35b..035bc7be6 100644
--- a/backend/internal/api/system_handler.go
+++ b/backend/internal/api/system_handler.go
@@ -8,7 +8,6 @@ import (
"errors"
"fmt"
"log/slog"
- "math"
"net/http"
"os/exec"
"runtime"
@@ -18,8 +17,6 @@ import (
"sync/atomic"
"time"
- "github.com/docker/docker/api/types/container"
- "github.com/docker/docker/api/types/image"
"github.com/gin-gonic/gin"
"github.com/gorilla/websocket"
"github.com/ofkm/arcane-backend/internal/common"
@@ -168,37 +165,16 @@ func (h *SystemHandler) GetDockerInfo(c *gin.Context) {
return
}
- containers, err := dockerClient.ContainerList(ctx, container.ListOptions{All: true})
- if err != nil {
- c.JSON(http.StatusInternalServerError, gin.H{
- "success": false,
- "error": (&common.DockerContainerListError{Err: err}).Error(),
- })
- return
- }
-
- images, err := dockerClient.ImageList(ctx, image.ListOptions{})
- if err != nil {
- c.JSON(http.StatusInternalServerError, gin.H{
- "success": false,
- "error": (&common.DockerImageListError{Err: err}).Error(),
- })
- return
- }
-
cpuCount := info.NCPU
- var memTotal uint64
- if info.MemTotal > 0 {
- memTotal = uint64(info.MemTotal)
- }
+ memTotal := info.MemTotal
// Check for cgroup limits (LXC, Docker, etc.)
if cgroupLimits, err := utils.DetectCgroupLimits(); err == nil {
// Use cgroup memory limit if available and smaller than host value
if limit := cgroupLimits.MemoryLimit; limit > 0 {
- limitUint := uint64(limit)
- if memTotal == 0 || limitUint < memTotal {
- memTotal = limitUint
+ limitInt := int64(limit)
+ if memTotal == 0 || limitInt < memTotal {
+ memTotal = limitInt
}
}
@@ -208,31 +184,19 @@ func (h *SystemHandler) GetDockerInfo(c *gin.Context) {
}
}
+ // Update info with cgroup limits
+ info.NCPU = cpuCount
+ info.MemTotal = memTotal
+
dockerInfo := dto.DockerInfoDto{
- Success: true,
- Version: version.Version,
- APIVersion: version.APIVersion,
- GitCommit: version.GitCommit,
- GoVersion: version.GoVersion,
- OS: version.Os,
- Arch: version.Arch,
- BuildTime: version.BuildTime,
- Containers: len(containers),
- ContainersRunning: info.ContainersRunning,
- ContainersPaused: info.ContainersPaused,
- ContainersStopped: info.ContainersStopped,
- Images: len(images),
- StorageDriver: info.Driver,
- LoggingDriver: info.LoggingDriver,
- CgroupDriver: info.CgroupDriver,
- CgroupVersion: info.CgroupVersion,
- KernelVersion: info.KernelVersion,
- OperatingSystem: info.OperatingSystem,
- OSVersion: info.OSVersion,
- ServerVersion: info.ServerVersion,
- Architecture: info.Architecture,
- CPUs: cpuCount,
- MemTotal: safeUint64ToInt64(memTotal),
+ Success: true,
+ APIVersion: version.APIVersion,
+ GitCommit: version.GitCommit,
+ GoVersion: version.GoVersion,
+ Os: version.Os,
+ Arch: version.Arch,
+ BuildTime: version.BuildTime,
+ Info: info,
}
c.JSON(http.StatusOK, dockerInfo)
@@ -290,13 +254,6 @@ func (h *SystemHandler) PruneAll(c *gin.Context) {
})
}
-func safeUint64ToInt64(value uint64) int64 {
- if value > uint64(math.MaxInt64) {
- return math.MaxInt64
- }
- return int64(value)
-}
-
func (h *SystemHandler) StartAllContainers(c *gin.Context) {
result, err := h.systemService.StartAllContainers(c.Request.Context())
if err != nil {
diff --git a/backend/internal/dto/docker_info_dto.go b/backend/internal/dto/docker_info_dto.go
index c9a782ea1..5d5167609 100644
--- a/backend/internal/dto/docker_info_dto.go
+++ b/backend/internal/dto/docker_info_dto.go
@@ -1,28 +1,14 @@
package dto
+import "github.com/docker/docker/api/types/system"
+
type DockerInfoDto struct {
- Success bool `json:"success"`
- Version string `json:"version"`
- APIVersion string `json:"apiVersion"`
- GitCommit string `json:"gitCommit"`
- GoVersion string `json:"goVersion"`
- OS string `json:"os"`
- Arch string `json:"arch"`
- BuildTime string `json:"buildTime"`
- Containers int `json:"containers"`
- ContainersRunning int `json:"containersRunning"`
- ContainersPaused int `json:"containersPaused"`
- ContainersStopped int `json:"containersStopped"`
- Images int `json:"images"`
- StorageDriver string `json:"storageDriver"`
- LoggingDriver string `json:"loggingDriver"`
- CgroupDriver string `json:"cgroupDriver"`
- CgroupVersion string `json:"cgroupVersion"`
- KernelVersion string `json:"kernelVersion"`
- OperatingSystem string `json:"operatingSystem"`
- OSVersion string `json:"osVersion"`
- ServerVersion string `json:"serverVersion"`
- Architecture string `json:"architecture"`
- CPUs int `json:"cpus"`
- MemTotal int64 `json:"memTotal"`
+ Success bool `json:"success"`
+ APIVersion string `json:"apiVersion"`
+ GitCommit string `json:"gitCommit"`
+ GoVersion string `json:"goVersion"`
+ Os string `json:"os"`
+ Arch string `json:"arch"`
+ BuildTime string `json:"buildTime"`
+ system.Info
}
diff --git a/frontend/messages/en.json b/frontend/messages/en.json
index 0f4986d39..a472e99e7 100644
--- a/frontend/messages/en.json
+++ b/frontend/messages/en.json
@@ -1185,14 +1185,13 @@
"apply": "Apply",
"_comment_docker_info": "=== DOCKER INFO ===",
- "docker_engine_title": "Docker Engine",
+ "docker_engine_title": "{engine}",
"docker_engine_subtitle": "{os} • {arch}",
"docker_containers_running_badge": "{count} running",
"docker_containers_total_badge": "total {count}",
"docker_containers_stopped_badge": "stopped {count}",
"docker_images_subtitle": "Total images discovered",
- "docker_info_dialog_title": "Docker Engine",
- "docker_info_dialog_description": "Detailed information about your Docker installation",
+ "docker_info_dialog_description": "Detailed information about your container installation",
"docker_info_version_section": "Version Information",
"docker_info_system_section": "System Information",
"docker_info_drivers_section": "Drivers & Storage",
@@ -1215,6 +1214,25 @@
"docker_info_total_containers_label": "Total Containers",
"docker_info_paused_label": "Paused",
"docker_info_images_label": "Images",
+ "docker_info_system_time": "System Time",
+ "docker_info_root_dir": "Root Dir",
+ "docker_info_experimental": "Experimental",
+ "docker_info_resources_section": "Resources",
+ "docker_info_goroutines": "Goroutines",
+ "docker_info_file_descriptors": "File Descriptors",
+ "docker_info_isolation": "Isolation",
+ "docker_info_init_binary": "Init Binary",
+ "docker_info_default_runtime": "Default Runtime",
+ "docker_info_proxy_label": "Proxy",
+ "docker_info_ipv4_forwarding": "IPv4 Forwarding",
+ "docker_info_http_proxy": "HTTP Proxy",
+ "docker_info_https_proxy": "HTTPS Proxy",
+ "docker_info_no_proxy": "No Proxy",
+ "docker_info_bridge_ip": "Bridge IP",
+ "docker_info_plugins_section": "Plugins",
+ "docker_info_logs_plugin": "Logs",
+ "docker_info_security_options": "Security Options",
+ "docker_info_runtimes": "Runtimes",
"_comment_sidebar": "=== SIDEBAR ===",
"sidebar_environment_label": "Environment",
diff --git a/frontend/src/lib/components/dialogs/docker-info-dialog.svelte b/frontend/src/lib/components/dialogs/docker-info-dialog.svelte
index 0c6f70ed8..46fe19a15 100644
--- a/frontend/src/lib/components/dialogs/docker-info-dialog.svelte
+++ b/frontend/src/lib/components/dialogs/docker-info-dialog.svelte
@@ -3,9 +3,14 @@
import { Button } from '$lib/components/ui/button/index.js';
import { Badge } from '$lib/components/ui/badge';
import { CopyButton } from '$lib/components/ui/copy-button';
+ import { Separator } from '$lib/components/ui/separator';
import ServerIcon from '@lucide/svelte/icons/server';
import CpuIcon from '@lucide/svelte/icons/cpu';
import HardDriveIcon from '@lucide/svelte/icons/hard-drive';
+ import NetworkIcon from '@lucide/svelte/icons/network';
+ import ShieldIcon from '@lucide/svelte/icons/shield';
+ import ActivityIcon from '@lucide/svelte/icons/activity';
+ import LayersIcon from '@lucide/svelte/icons/layers';
import type { DockerInfo } from '$lib/types/docker-info.type';
import { m } from '$lib/paraglide/messages';
import bytes from 'bytes';
@@ -18,25 +23,46 @@
let { open = $bindable(), dockerInfo }: Props = $props();
const shortGitCommit = $derived(dockerInfo?.gitCommit?.slice(0, 8) ?? '-');
- const formattedMemory = $derived(dockerInfo?.memTotal ? bytes.format(dockerInfo.memTotal) : '-');
+ const formattedMemory = $derived(dockerInfo?.MemTotal ? bytes.format(dockerInfo.MemTotal) : '-');
function handleClose() {
open = false;
}
+
+ function formatTime(timeStr: string | undefined) {
+ if (!timeStr) return '-';
+ try {
+ return new Date(timeStr).toLocaleString();
+ } catch {
+ return timeStr;
+ }
+ }
</script>
<ResponsiveDialog
bind:open
- title={m.docker_info_dialog_title()}
+ title={m.docker_engine_title({ engine: dockerInfo?.Name ?? 'Docker Engine' })}
description={m.docker_info_dialog_description()}
- contentClass="sm:max-w-[720px]"
+ contentClass="sm:max-w-[800px]"
>
{#snippet children()}
<div class="space-y-6 pt-4">
- {@render versionSection()}
- {@render systemSection()}
- {@render driversSection()}
{@render statsSection()}
+
+ <div class="grid gap-6 sm:grid-cols-2">
+ {@render systemSection()}
+ {@render versionSection()}
+ </div>
+
+ {@render resourcesSection()}
+
+ <div class="grid gap-6 sm:grid-cols-2">
+ {@render configurationSection()}
+ {@render networkSection()}
+ </div>
+
+ {@render pluginsSection()}
+ {@render securitySection()}
</div>
{/snippet}
@@ -47,16 +73,52 @@
{/snippet}
</ResponsiveDialog>
-{#snippet versionSection()}
+{#snippet statsSection()}
<div>
<h3 class="mb-3 flex items-center gap-2 text-sm font-semibold">
+ <ActivityIcon class="size-4" />
+ {m.docker_info_stats_section()}
+ </h3>
+ <div class="space-y-3">
+ <div class="grid gap-3 sm:grid-cols-4">
+ {@render statCard(m.common_running(), dockerInfo?.ContainersRunning ?? 0, 'emerald')}
+ {@render statCard(m.docker_info_paused_label(), dockerInfo?.ContainersPaused ?? 0, 'amber')}
+ {@render statCard(m.common_stopped(), dockerInfo?.ContainersStopped ?? 0, 'red')}
+ {@render statCard(m.docker_info_images_label(), dockerInfo?.Images ?? 0, 'neutral', true)}
+ </div>
+ </div>
+ </div>
+{/snippet}
+
+{#snippet systemSection()}
+ <div class="space-y-3">
+ <h3 class="flex items-center gap-2 text-sm font-semibold">
<ServerIcon class="size-4" />
+ {m.docker_info_system_section()}
+ </h3>
+ <div class="space-y-2 rounded-lg border p-3">
+ {@render infoRow(m.common_name(), dockerInfo?.Name)}
+ {@render infoRow(m.common_id(), dockerInfo?.ID, true, true)}
+ {@render infoRow(m.docker_info_os_label(), dockerInfo?.OperatingSystem)}
+ {@render infoRow(m.docker_info_os_type_label(), dockerInfo?.OSType)}
+ {@render infoRow(m.common_architecture(), dockerInfo?.Architecture)}
+ {@render infoRow(m.docker_info_kernel_version_label(), dockerInfo?.KernelVersion)}
+ {@render infoRow(m.docker_info_system_time(), formatTime(dockerInfo?.SystemTime), false)}
+ {@render infoRow(m.docker_info_root_dir(), dockerInfo?.DockerRootDir, true, true)}
+ </div>
+ </div>
+{/snippet}
+
+{#snippet versionSection()}
+ <div class="space-y-3">
+ <h3 class="flex items-center gap-2 text-sm font-semibold">
+ <LayersIcon class="size-4" />
{m.docker_info_version_section()}
</h3>
<div class="space-y-2 rounded-lg border p-3">
- {@render infoRow(m.docker_info_version_label(), dockerInfo?.version)}
+ {@render infoRow(m.docker_info_server_version_label(), dockerInfo?.ServerVersion)}
{@render infoRow(m.docker_info_api_version_label(), dockerInfo?.apiVersion)}
- {@render infoRow(m.docker_info_server_version_label(), dockerInfo?.serverVersion)}
+ {@render infoRow(m.docker_info_go_version_label(), dockerInfo?.goVersion)}
<div class="flex items-center justify-between gap-4">
<span class="text-muted-foreground text-xs">{m.docker_info_git_commit_label()}</span>
<div class="flex items-center gap-2">
@@ -66,80 +128,147 @@
{/if}
</div>
</div>
- {@render infoRow(m.docker_info_go_version_label(), dockerInfo?.goVersion)}
- {@render infoRow(m.docker_info_build_time_label(), dockerInfo?.buildTime, false)}
+ {@render infoRow(m.docker_info_build_time_label(), formatTime(dockerInfo?.buildTime), false)}
+ {@render infoRow(m.docker_info_experimental(), dockerInfo?.ExperimentalBuild ? m.common_yes() : m.common_no(), false)}
</div>
</div>
{/snippet}
-{#snippet systemSection()}
+{#snippet resourcesSection()}
<div>
<h3 class="mb-3 flex items-center gap-2 text-sm font-semibold">
<CpuIcon class="size-4" />
- {m.docker_info_system_section()}
+ {m.docker_info_resources_section()}
</h3>
- <div class="grid gap-3 sm:grid-cols-2">
- <div class="rounded-lg border p-3">
- <div class="text-muted-foreground mb-2 text-xs">{m.docker_info_os_label()}</div>
- <div class="text-sm font-medium">{dockerInfo?.operatingSystem ?? '-'}</div>
- <div class="text-muted-foreground mt-1 text-xs">
- {dockerInfo?.os ?? '-'}
- {dockerInfo?.osVersion ? `· ${dockerInfo.osVersion}` : ''}
- </div>
- </div>
- <div class="rounded-lg border p-3">
- <div class="text-muted-foreground mb-2 text-xs">{m.common_architecture()}</div>
- <Badge class="mt-1">{dockerInfo?.architecture ?? '-'}</Badge>
- </div>
- <div class="rounded-lg border p-3">
- <div class="text-muted-foreground mb-2 text-xs">{m.docker_info_kernel_version_label()}</div>
- <code class="text-sm">{dockerInfo?.kernelVersion ?? '-'}</code>
- </div>
+ <div class="grid gap-3 sm:grid-cols-4">
<div class="rounded-lg border p-3">
<div class="text-muted-foreground mb-2 text-xs">{m.common_cpus()}</div>
<div class="flex items-center gap-2">
- <Badge variant="secondary" class="text-base">{dockerInfo?.cpus ?? 0}</Badge>
+ <Badge variant="secondary" class="text-base">{dockerInfo?.NCPU ?? 0}</Badge>
<span class="text-muted-foreground text-xs">cores</span>
</div>
</div>
- <div class="rounded-lg border p-3 sm:col-span-2">
+ <div class="rounded-lg border p-3">
<div class="text-muted-foreground mb-2 text-xs">{m.docker_info_memory_label()}</div>
<Badge variant="secondary" class="text-base">{formattedMemory}</Badge>
</div>
+ <div class="rounded-lg border p-3">
+ <div class="text-muted-foreground mb-2 text-xs">{m.docker_info_goroutines()}</div>
+ <Badge variant="secondary" class="text-base">{dockerInfo?.NGoroutines ?? 0}</Badge>
+ </div>
+ <div class="rounded-lg border p-3">
+ <div class="text-muted-foreground mb-2 text-xs">{m.docker_info_file_descriptors()}</div>
+ <Badge variant="secondary" class="text-base">{dockerInfo?.NFd ?? 0}</Badge>
+ </div>
</div>
</div>
{/snippet}
-{#snippet driversSection()}
- <div>
- <h3 class="mb-3 flex items-center gap-2 text-sm font-semibold">
+{#snippet configurationSection()}
+ <div class="space-y-3">
+ <h3 class="flex items-center gap-2 text-sm font-semibold">
<HardDriveIcon class="size-4" />
- {m.docker_info_drivers_section()}
+ {m.common_configuration()}
</h3>
<div class="space-y-2 rounded-lg border p-3">
- <div class="flex items-center justify-between gap-4">
- <span class="text-muted-foreground text-xs">{m.docker_info_storage_driver_label()}</span>
- <Badge variant="outline">{dockerInfo?.storageDriver ?? '-'}</Badge>
+ {@render infoRow(m.docker_info_storage_driver_label(), dockerInfo?.Driver)}
+ {@render infoRow(m.docker_info_logging_driver_label(), dockerInfo?.LoggingDriver)}
+ {@render infoRow(m.docker_info_cgroup_driver_label(), dockerInfo?.CgroupDriver)}
+ {@render infoRow(m.docker_info_cgroup_version_label(), dockerInfo?.CgroupVersion)}
+ {@render infoRow(m.docker_info_isolation(), dockerInfo?.Isolation)}
+ {@render infoRow(m.docker_info_init_binary(), dockerInfo?.InitBinary)}
+ {@render infoRow(m.docker_info_default_runtime(), dockerInfo?.DefaultRuntime)}
+ </div>
+ </div>
+{/snippet}
+
+{#snippet networkSection()}
+ <div class="space-y-3">
+ <h3 class="flex items-center gap-2 text-sm font-semibold">
+ <NetworkIcon class="size-4" />
+ {m.resource_networks_cap()} & {m.docker_info_proxy_label()}
+ </h3>
+ <div class="space-y-2 rounded-lg border p-3">
+ {@render infoRow(
+ m.docker_info_ipv4_forwarding(),
+ dockerInfo?.IPv4Forwarding ? m.common_enabled() : m.common_disabled(),
+ false
+ )}
+ {@render infoRow(m.docker_info_http_proxy(), dockerInfo?.HttpProxy)}
+ {@render infoRow(m.docker_info_https_proxy(), dockerInfo?.HttpsProxy)}
+ {@render infoRow(m.docker_info_no_proxy(), dockerInfo?.NoProxy)}
+ {@render infoRow(m.docker_info_bridge_ip(), dockerInfo?.DefaultAddressPools?.[0]?.Base)}
+ </div>
+ </div>
+{/snippet}
+
+{#snippet pluginsSection()}
+ <div>
+ <h3 class="mb-3 flex items-center gap-2 text-sm font-semibold">
+ <LayersIcon class="size-4" />
+ {m.docker_info_plugins_section()}
+ </h3>
+ <div class="grid gap-3 sm:grid-cols-3">
+ <div class="rounded-lg border p-3">
+ <div class="text-muted-foreground mb-2 text-xs">{m.resource_volumes_cap()}</div>
+ <div class="flex flex-wrap gap-1">
+ {#each dockerInfo?.Plugins?.Volume ?? [] as plugin}
+ <Badge variant="outline" class="text-xs">{plugin}</Badge>
+ {:else}
+ <span class="text-muted-foreground text-xs">-</span>
+ {/each}
+ </div>
+ </div>
+ <div class="rounded-lg border p-3">
+ <div class="text-muted-foreground mb-2 text-xs">{m.resource_networks_cap()}</div>
+ <div class="flex flex-wrap gap-1">
+ {#each dockerInfo?.Plugins?.Network ?? [] as plugin}
+ <Badge variant="outline" class="text-xs">{plugin}</Badge>
+ {:else}
+ <span class="text-muted-foreground text-xs">-</span>
+ {/each}
+ </div>
+ </div>
+ <div class="rounded-lg border p-3">
+ <div class="text-muted-foreground mb-2 text-xs">{m.docker_info_logs_plugin()}</div>
+ <div class="flex flex-wrap gap-1">
+ {#each dockerInfo?.Plugins?.Log ?? [] as plugin}
+ <Badge variant="outline" class="text-xs">{plugin}</Badge>
+ {:else}
+ <span class="text-muted-foreground text-xs">-</span>
+ {/each}
+ </div>
</div>
- {@render infoRow(m.docker_info_logging_driver_label(), dockerInfo?.loggingDriver, false)}
- {@render infoRow(m.docker_info_cgroup_driver_label(), dockerInfo?.cgroupDriver, false)}
- {@render infoRow(m.docker_info_cgroup_version_label(), dockerInfo?.cgroupVersion, false)}
</div>
</div>
{/snippet}
-{#snippet statsSection()}
+{#snippet securitySection()}
<div>
- <h3 class="mb-3 text-sm font-semibold">{m.docker_info_stats_section()}</h3>
- <div class="space-y-3">
- <div class="grid gap-3 sm:grid-cols-3">
- {@render statCard(m.common_running(), dockerInfo?.containersRunning ?? 0, 'emerald')}
- {@render statCard(m.docker_info_paused_label(), dockerInfo?.containersPaused ?? 0, 'amber')}
- {@render statCard(m.common_stopped(), dockerInfo?.containersStopped ?? 0, 'red')}
+ <h3 class="mb-3 flex items-center gap-2 text-sm font-semibold">
+ <ShieldIcon class="size-4" />
+ {m.security_title()} & {m.docker_info_runtimes()}
+ </h3>
+ <div class="grid gap-3 sm:grid-cols-2">
+ <div class="rounded-lg border p-3">
+ <div class="text-muted-foreground mb-2 text-xs">{m.docker_info_security_options()}</div>
+ <div class="flex flex-wrap gap-1">
+ {#each dockerInfo?.SecurityOptions ?? [] as opt}
+ <Badge variant="secondary" class="text-xs">{opt}</Badge>
+ {:else}
+ <span class="text-muted-foreground text-xs">-</span>
+ {/each}
+ </div>
</div>
- <div class="grid gap-3 sm:grid-cols-2">
- {@render statCard(m.docker_info_total_containers_label(), dockerInfo?.containers ?? 0, 'neutral')}
- {@render statCard(m.docker_info_images_label(), dockerInfo?.images ?? 0, 'neutral', true)}
+ <div class="rounded-lg border p-3">
+ <div class="text-muted-foreground mb-2 text-xs">{m.docker_info_runtimes()}</div>
+ <div class="flex flex-wrap gap-1">
+ {#each Object.keys(dockerInfo?.Runtimes ?? {}) as runtime}
+ <Badge variant="outline" class="text-xs">{runtime}</Badge>
+ {:else}
+ <span class="text-muted-foreground text-xs">-</span>
+ {/each}
+ </div>
</div>
</div>
</div>
@@ -176,9 +305,11 @@
</div>
{/snippet}
-{#snippet infoRow(label: string, value: string | undefined, mono: boolean = true)}
+{#snippet infoRow(label: string, value: string | undefined | null, mono: boolean = true, truncate: boolean = false)}
<div class="flex items-center justify-between gap-4">
- <span class="text-muted-foreground text-xs">{label}</span>
- <span class="text-sm {mono ? 'font-mono' : ''}">{value ?? '-'}</span>
+ <span class="text-muted-foreground shrink-0 text-xs">{label}</span>
+ <span class="text-sm {mono ? 'font-mono' : ''} {truncate ? 'max-w-[200px] truncate' : ''}" title={value ?? ''}>
+ {value || '-'}
+ </span>
</div>
{/snippet}
diff --git a/frontend/src/lib/components/docker-overview.svelte b/frontend/src/lib/components/docker-overview.svelte
index 6304b91c9..a8a9e511d 100644
--- a/frontend/src/lib/components/docker-overview.svelte
+++ b/frontend/src/lib/components/docker-overview.svelte
@@ -44,8 +44,10 @@
{:else}
<div class="flex flex-1 flex-col gap-1.5">
<div class="flex items-center gap-2">
- <span class="text-foreground text-sm font-semibold">{m.docker_engine_title()}</span>
- <Badge variant="outline" class="text-xs">{dockerInfo?.version ?? '-'}</Badge>
+ <span class="text-foreground text-sm font-semibold"
+ >{m.docker_engine_title({ engine: dockerInfo?.Name ?? 'Docker Engine' })}</span
+ >
+ <Badge variant="outline" class="text-xs">{dockerInfo?.ServerVersion ?? '-'}</Badge>
</div>
<div class="text-muted-foreground flex flex-wrap items-center gap-3 text-xs">
<span class="flex items-center gap-1.5">
@@ -62,7 +64,7 @@
</span>
<span class="text-muted-foreground/50">•</span>
<span class="font-mono">
- {dockerInfo?.os ?? '-'} / {dockerInfo?.architecture ?? '-'}
+ {dockerInfo?.OperatingSystem ?? '-'} / {dockerInfo?.Architecture ?? '-'}
</span>
</div>
</div>
diff --git a/frontend/src/lib/components/quick-actions.svelte b/frontend/src/lib/components/quick-actions.svelte
index c89543679..6015b7185 100644
--- a/frontend/src/lib/components/quick-actions.svelte
+++ b/frontend/src/lib/components/quick-actions.svelte
@@ -7,6 +7,7 @@
import EllipsisIcon from '@lucide/svelte/icons/ellipsis';
import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';
import { m } from '$lib/paraglide/messages';
+ import type { DockerInfo } from '$lib/types/docker-info.type';
type IsLoadingFlags = {
starting: boolean;
@@ -14,8 +15,6 @@
pruning: boolean;
};
- type DockerInfo = { containersRunning?: number } | null | undefined;
-
let {
dockerInfo,
stoppedContainers,
@@ -30,7 +29,7 @@
compact = false,
class: className
}: {
- dockerInfo: DockerInfo;
+ dockerInfo: DockerInfo | null;
stoppedContainers: number;
runningContainers: number;
loadingDockerInfo?: boolean;
@@ -76,7 +75,7 @@
<button
class="ring-offset-background focus-visible:ring-ring bg-card/60 hover:bg-card/90 group bubble-shadow hover-lift inline-flex h-9 items-center gap-2 rounded-lg border border-sky-500/20 px-3 py-1.5 text-xs backdrop-blur-sm transition-all hover:border-sky-500/40 hover:bg-sky-500/10 hover:backdrop-blur-sm focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-60"
disabled={!dockerInfo ||
- (dockerInfo?.containersRunning ?? 0) === 0 ||
+ (dockerInfo?.ContainersRunning ?? 0) === 0 ||
isLoading.starting ||
isLoading.stopping ||
isLoading.pruning}
@@ -143,7 +142,7 @@
<DropdownMenu.Item
onclick={onStopAll}
disabled={!dockerInfo ||
- (dockerInfo?.containersRunning ?? 0) === 0 ||
+ (dockerInfo?.ContainersRunning ?? 0) === 0 ||
isLoading.starting ||
isLoading.stopping ||
isLoading.pruning}
@@ -217,7 +216,7 @@
<button
class="ring-offset-background focus-visible:ring-ring bg-card/90 bubble bubble-shadow flex min-h-14 w-full items-center gap-3 rounded-2xl border p-3 backdrop-blur-sm transition-all hover:shadow-md focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-60"
disabled={!dockerInfo ||
- (dockerInfo?.containersRunning ?? 0) === 0 ||
+ (dockerInfo?.ContainersRunning ?? 0) === 0 ||
isLoading.starting ||
isLoading.stopping ||
isLoading.pruning}
diff --git a/frontend/src/lib/types/docker-info.type.ts b/frontend/src/lib/types/docker-info.type.ts
index d2eb5f496..acd6f9c93 100644
--- a/frontend/src/lib/types/docker-info.type.ts
+++ b/frontend/src/lib/types/docker-info.type.ts
@@ -1,26 +1,93 @@
export interface DockerInfo {
success: boolean;
- version: string;
apiVersion: string;
gitCommit: string;
goVersion: string;
os: string;
arch: string;
buildTime: string;
- containers: number;
- containersRunning: number;
- containersPaused: number;
- containersStopped: number;
- images: number;
- storageDriver: string;
- loggingDriver: string;
- cgroupDriver: string;
- cgroupVersion: string;
- kernelVersion: string;
- operatingSystem: string;
- osVersion: string;
- serverVersion: string;
- architecture: string;
- cpus: number;
- memTotal: number;
+
+ // System Info fields (from embedded system.Info)
+ ID: string;
+ Containers: number;
+ ContainersRunning: number;
+ ContainersPaused: number;
+ ContainersStopped: number;
+ Images: number;
+ Driver: string;
+ DriverStatus: string[][];
+ SystemStatus?: string[][];
+ Plugins: PluginsInfo;
+ MemoryLimit: boolean;
+ SwapLimit: boolean;
+ KernelMemory?: boolean;
+ KernelMemoryTCP?: boolean;
+ CpuCfsPeriod: boolean;
+ CpuCfsQuota: boolean;
+ CPUShares: boolean;
+ CPUSet: boolean;
+ PidsLimit: boolean;
+ IPv4Forwarding: boolean;
+ Debug: boolean;
+ NFd: number;
+ OomKillDisable: boolean;
+ NGoroutines: number;
+ SystemTime: string;
+ LoggingDriver: string;
+ CgroupDriver: string;
+ CgroupVersion?: string;
+ NEventsListener: number;
+ KernelVersion: string;
+ OperatingSystem: string;
+ OSVersion: string;
+ OSType: string;
+ Architecture: string;
+ IndexServerAddress: string;
+ RegistryConfig: any;
+ NCPU: number;
+ MemTotal: number;
+ GenericResources: any[];
+ DockerRootDir: string;
+ HttpProxy: string;
+ HttpsProxy: string;
+ NoProxy: string;
+ Name: string;
+ Labels: string[];
+ ExperimentalBuild: boolean;
+ ServerVersion: string;
+ Runtimes: Record<string, RuntimeWithStatus>;
+ DefaultRuntime: string;
+ Swarm: any;
+ LiveRestoreEnabled: boolean;
+ Isolation: string;
+ InitBinary: string;
+ ContainerdCommit: Commit;
+ RuncCommit: Commit;
+ InitCommit: Commit;
+ SecurityOptions: string[];
+ ProductLicense?: string;
+ DefaultAddressPools?: any[];
+ FirewallBackend?: any;
+ CDISpecDirs: string[];
+ DiscoveredDevices?: any[];
+ Containerd?: any;
+ Warnings: string[];
+}
+
+export interface PluginsInfo {
+ Volume?: string[];
+ Network?: string[];
+ Authorization?: string[];
+ Log?: string[];
+}
+
+export interface RuntimeWithStatus {
+ path: string;
+ runtimeArgs?: string[];
+ status?: Record<string, string>;
+}
+
+export interface Commit {
+ ID: string;
+ Expected: string;
}
diff --git a/frontend/src/routes/dashboard/+page.svelte b/frontend/src/routes/dashboard/+page.svelte
index 1889d4a8d..b5b73a552 100644
--- a/frontend/src/routes/dashboard/+page.svelte
+++ b/frontend/src/routes/dashboard/+page.svelte
@@ -105,7 +105,7 @@
if (stats.gpus && stats.gpus.length > 0) {
// Track average GPU memory usage percentage across all GPUs
// Filter out GPUs with zero total memory to avoid invalid calculations
- const validGpus = stats.gpus.filter(gpu => gpu.memoryTotal > 0);
+ const validGpus = stats.gpus.filter((gpu) => gpu.memoryTotal > 0);
if (validGpus.length > 0) {
const totalGpuPercent = validGpus.reduce((sum, gpu) => {
@@ -119,7 +119,7 @@
}
}
- historicalData.containers.push({ date: now, value: dockerInfo!.containersRunning });
+ historicalData.containers.push({ date: now, value: dockerInfo!.ContainersRunning });
if (historicalData.containers.length > maxPoints) {
historicalData.containers = historicalData.containers.slice(-maxPoints);
}
@@ -226,7 +226,7 @@
}
async function handleStopAll() {
- if (isLoading.stopping || !dashboardStates.dockerInfo || dockerInfo?.containersRunning === 0) return;
+ if (isLoading.stopping || !dashboardStates.dockerInfo || dockerInfo?.ContainersRunning === 0) return;
openConfirmDialog({
title: m.dashboard_stop_all_title(),
message: m.dashboard_stop_all_confirm(),
@@ -323,7 +323,11 @@
{/if}
</div>
<div class="space-y-3">
- <div class="grid grid-cols-2 gap-3 sm:grid-cols-2 {currentStats?.gpuCount && currentStats.gpuCount > 0 ? 'lg:grid-cols-4' : 'lg:grid-cols-3'}">
+ <div
+ class="grid grid-cols-2 gap-3 sm:grid-cols-2 {currentStats?.gpuCount && currentStats.gpuCount > 0
+ ? 'lg:grid-cols-4'
+ : 'lg:grid-cols-3'}"
+ >
<MeterMetric
title={m.dashboard_meter_cpu()}
icon={CpuIcon}
@@ -363,10 +367,7 @@
/>
{#if currentStats?.gpuCount && currentStats.gpuCount > 0}
- <GpuMeter
- gpus={currentStats?.gpus}
- loading={isLoading.loadingStats || !hasInitialStatsLoaded}
- />
+ <GpuMeter gpus={currentStats?.gpus} loading={isLoading.loadingStats || !hasInitialStatsLoaded} />
{/if}
</div>