Modern Docker Management, Designed for Everyone
Go composecontainer-managementcontainersdockerdocker-composedocker-managementgoself-hostedsveltekittypescriptweb-ui
feat: add raw inspect tab to container detail view (#2368)
Giulio Savinif432ecb22a18
diff --git a/frontend/messages/en.json b/frontend/messages/en.jsonindex 3f603f4a6..1e9a90673 100644--- a/frontend/messages/en.json+++ b/frontend/messages/en.json@@ -550,6 +550,8 @@"containers_mount_label_host": "Host:","containers_mount_label_source": "Source:","containers_no_mounts_configured": "No volumes or mounts configured",+ "containers_inspect_title": "Raw Inspect",+ "containers_inspect_description": "Full JSON output of docker container inspect","container": "Container","container_name_required": "Container name is required","container_image_required": "Image is required",@@ -583,6 +585,7 @@"compose_editor_editing_info": "Editing {file} for project {project}","compose_editor_viewing_info": "Viewing {file} for project {project}","tabs_compose": "Compose",+ "tabs_inspect": "Inspect","tabs_environment": "Environment","tabs_volumes": "Volumes","tabs_network_security": "Network & Security",diff --git a/frontend/messages/it.json b/frontend/messages/it.jsonindex 4bb13d7cb..17a424b12 100644--- a/frontend/messages/it.json+++ b/frontend/messages/it.json@@ -531,6 +531,8 @@"containers_mount_label_host": "Host:","containers_mount_label_source": "Origine:","containers_no_mounts_configured": "Nessun volume o mount configurato",+ "containers_inspect_title": "Raw Inspect",+ "containers_inspect_description": "Full JSON output of docker container inspect","container": "Container","container_name_required": "Il nome del container è obbligatorio","container_image_required": "L'immagine è obbligatoria",@@ -564,6 +566,7 @@"compose_editor_editing_info": "Modifica di {file} per il progetto {project}","compose_editor_viewing_info": "Visualizzazione di {file} per il progetto {project}","tabs_compose": "Comporre",+ "tabs_inspect": "Inspect","tabs_environment": "Ambiente","tabs_volumes": "Volumi","tabs_network_security": "Rete & sicurezza",diff --git a/frontend/src/routes/(app)/containers/[containerId]/+page.svelte b/frontend/src/routes/(app)/containers/[containerId]/+page.svelteindex d75352f21..fb3883be9 100644--- a/frontend/src/routes/(app)/containers/[containerId]/+page.svelte+++ b/frontend/src/routes/(app)/containers/[containerId]/+page.svelte@@ -23,6 +23,7 @@import ContainerLogsPanel from '../components/ContainerLogsPanel.svelte';import ContainerShell from '../components/ContainerShell.svelte';import ContainerComposePanel from '../components/ContainerComposePanel.svelte';+ import ContainerInspect from '../components/ContainerInspect.svelte';import ContainerDetailStatsSync from '../components/container-detail-stats-sync.svelte';import IconImage from '$lib/components/icon-image.svelte';import { getArcaneIconUrlFromLabels } from '$lib/utils/arcane-labels';@@ -37,7 +38,8 @@TerminalIcon,ContainersIcon,StatsIcon,- CodeIcon+ CodeIcon,+ InspectIcon} from '$lib/icons';import { parse as parseYaml } from 'yaml';import type { IncludeFile } from '$lib/types/project.type';@@ -211,7 +213,8 @@...(showConfiguration ? [{ value: 'config', label: m.common_configuration(), icon: SettingsIcon }] : []),...(showNetworkTab ? [{ value: 'network', label: m.containers_nav_networks(), icon: NetworksIcon }] : []),...(hasMounts ? [{ value: 'storage', label: m.containers_nav_storage(), icon: VolumesIcon }] : []),- ...(showComposeTab ? [{ value: 'compose', label: m.tabs_compose(), icon: CodeIcon }] : [])+ ...(showComposeTab ? [{ value: 'compose', label: m.tabs_compose(), icon: CodeIcon }] : []),+ { value: 'inspect', label: m.tabs_inspect(), icon: InspectIcon }]);const activeTab = $derived.by(() => {@@ -373,6 +376,10 @@</Tabs.Content>{/if}{/await}++ <Tabs.Content value="inspect" class="h-full">+ <ContainerInspect {container} />+ </Tabs.Content>{/snippet}</TabbedPageLayout>{:else}diff --git a/frontend/src/routes/(app)/containers/components/ContainerInspect.svelte b/frontend/src/routes/(app)/containers/components/ContainerInspect.sveltenew file mode 100644index 000000000..08ddeee0a--- /dev/null+++ b/frontend/src/routes/(app)/containers/components/ContainerInspect.svelte@@ -0,0 +1,34 @@+<script lang="ts">+ import * as Card from '$lib/components/ui/card';+ import { CopyButton } from '$lib/components/ui/copy-button';+ import { m } from '$lib/paraglide/messages';+ import type { ContainerDetailsDto } from '$lib/types/container.type';+ import { CodeIcon } from '$lib/icons';++ interface Props {+ container: ContainerDetailsDto;+ }++ let { container }: Props = $props();++ const json = $derived(JSON.stringify(container, null, 2));+</script>++<Card.Root>+ <Card.Header icon={CodeIcon}>+ <div class="flex flex-col space-y-1.5">+ <Card.Title>+ <h2>{m.containers_inspect_title()}</h2>+ </Card.Title>+ <Card.Description>{m.containers_inspect_description()}</Card.Description>+ </div>+ <div class="ml-auto">+ <CopyButton text={json} variant="outline" size="default">+ {m.common_copy_json()}+ </CopyButton>+ </div>+ </Card.Header>+ <Card.Content class="p-0">+ <pre class="bg-muted/40 overflow-auto rounded-b-lg p-4 font-mono text-xs leading-relaxed"><code>{json}</code></pre>+ </Card.Content>+</Card.Root>