From 9995d49249c741f091fc5391b0756daee8fba433 Mon Sep 17 00:00:00 2001 From: HynoR <20227709+HynoR@users.noreply.github.com> Date: Mon, 27 Oct 2025 17:13:49 +0800 Subject: [PATCH 1/3] feat: Expand Docker inspect detail drawer --- .../src/views/container/container/index.vue | 14 +- .../container/container/inspect/index.vue | 331 ++++++++++++++++++ 2 files changed, 335 insertions(+), 10 deletions(-) create mode 100644 frontend/src/views/container/container/inspect/index.vue diff --git a/frontend/src/views/container/container/index.vue b/frontend/src/views/container/container/index.vue index 0adbd24c4e7f..7b574d11c808 100644 --- a/frontend/src/views/container/container/index.vue +++ b/frontend/src/views/container/container/index.vue @@ -337,7 +337,7 @@ - + @@ -358,7 +358,7 @@ import UpgradeDialog from '@/views/container/container/upgrade/index.vue'; import CommitDialog from '@/views/container/container/commit/index.vue'; import MonitorDialog from '@/views/container/container/monitor/index.vue'; import TerminalDialog from '@/views/container/container/terminal/index.vue'; -import CodemirrorDrawer from '@/components/codemirror-pro/drawer.vue'; +import ContainerInspectDialog from '@/views/container/container/inspect/index.vue'; import PortJumpDialog from '@/components/port-jump/index.vue'; import DockerStatus from '@/views/container/docker-status/index.vue'; import ContainerLogDialog from '@/components/log/container-drawer/index.vue'; @@ -431,7 +431,7 @@ const props = withDefaults(defineProps(), { filters: '', }); -const myDetail = ref(); +const containerInspectRef = ref(); const dialogContainerLogRef = ref(); const dialogRenameRef = ref(); @@ -611,13 +611,7 @@ const onTerminal = (row: any) => { const onInspect = async (id: string) => { const res = await inspect({ id: id, type: 'container' }); - let detailInfo = JSON.stringify(JSON.parse(res.data), null, 2); - let param = { - header: i18n.global.t('commons.button.view'), - detailInfo: detailInfo, - mode: 'json', - }; - myDetail.value!.acceptParams(param); + containerInspectRef.value!.acceptParams({ data: res.data }); }; const onClean = () => { diff --git a/frontend/src/views/container/container/inspect/index.vue b/frontend/src/views/container/container/inspect/index.vue new file mode 100644 index 000000000000..a9328559aaa6 --- /dev/null +++ b/frontend/src/views/container/container/inspect/index.vue @@ -0,0 +1,331 @@ + + + + + + + + + {{ inspectData?.Name?.substring(1) || '-' }} + + + + {{ inspectData?.Id?.substring(0, 12) }} + + + + {{ inspectData?.State?.Pid }} + + + {{ inspectData?.Config?.Image }} + + + {{ formatDate(inspectData?.Created) }} + + + {{ formatDate(inspectData?.State?.StartedAt) }} + + + {{ formatDate(inspectData?.State?.FinishedAt) }} + + + {{ inspectData?.HostConfig?.RestartPolicy?.Name }} + + + + {{ inspectData?.State?.Status }} + {{ + inspectData?.State?.Health?.Status + ? '(' + inspectData?.State?.Health?.Status + ')' + : '' + }} + + + + + + + {{ $t('container.command') }} + + + + + {{ inspectData?.Config?.Cmd.join(' ') }} + + - + + + + + {{ entry }} + + + - + + + {{ inspectData?.Config?.WorkingDir || '-' }} + + + + + + + {{ $t('container.env') }} + + + + + {{ getEnvKey(env) }} + + {{ getEnvValue(env) }} + + + + + + + + + + + + {{ $t('container.network') }} + + + + {{ inspectData?.HostConfig?.NetworkMode }} + + + {{ inspectData?.Config?.Hostname }} + + + {{ inspectData?.Config?.Domainname || '-' }} + + + + + + + {{ row.hostIp }}:{{ row.hostPort }} + → + {{ row.containerPort }} + + + + + + + + + {{ name }} + + + {{ network?.NetworkID?.substring(0, 12) }} + + + {{ network?.EndpointID?.substring(0, 12) }} + + + {{ network?.IPAddress || '-' }} + + + {{ network?.Gateway || '-' }} + + + {{ network?.MacAddress || '-' }} + + + {{ network?.IPv6Gateway || '-' }} + + + + + + + + + + + {{ $t('container.mountpoint') }} + + + + + {{ row.Type }} + + + + + + {{ row.Source }} + + - + + + + + + + {{ row.RW ? $t('container.modeRW') : $t('container.modeR') }} + + + + + + + + + + + + {{ $t('commons.button.view') }} + + + + + + + + + + + + {{ $t('commons.button.cancel') }} + + + + + + + + From 8791ca1a29d731e2410fd1a2c4a0b27b389b90c9 Mon Sep 17 00:00:00 2001 From: HynoR <20227709+HynoR@users.noreply.github.com> Date: Mon, 27 Oct 2025 17:27:28 +0800 Subject: [PATCH 2/3] chore: i18n --- frontend/src/lang/modules/en.ts | 1 + frontend/src/lang/modules/es-es.ts | 1 + frontend/src/lang/modules/ja.ts | 1 + frontend/src/lang/modules/ko.ts | 1 + frontend/src/lang/modules/ms.ts | 1 + frontend/src/lang/modules/pt-br.ts | 1 + frontend/src/lang/modules/ru.ts | 1 + frontend/src/lang/modules/tr.ts | 1 + frontend/src/lang/modules/zh-Hant.ts | 1 + frontend/src/lang/modules/zh.ts | 1 + 10 files changed, 10 insertions(+) diff --git a/frontend/src/lang/modules/en.ts b/frontend/src/lang/modules/en.ts index f00c1597cc51..6b5bd83433e3 100644 --- a/frontend/src/lang/modules/en.ts +++ b/frontend/src/lang/modules/en.ts @@ -1032,6 +1032,7 @@ const message = { author: 'Author', ifPause: 'Pause Container During Creation', ifMakeImageWithContainer: 'Create New Image from This Container?', + finishTime: 'Last stop time', }, cronjob: { create: 'Create cron job', diff --git a/frontend/src/lang/modules/es-es.ts b/frontend/src/lang/modules/es-es.ts index 23d2ba61afa3..d27f640ee6e6 100644 --- a/frontend/src/lang/modules/es-es.ts +++ b/frontend/src/lang/modules/es-es.ts @@ -1031,6 +1031,7 @@ const message = { author: 'Autor', ifPause: '¿Pausar el contenedor durante la creación?', ifMakeImageWithContainer: '¿Crear nueva imagen a partir de este contenedor?', + finishTime: 'Hora de la última detención', }, cronjob: { create: 'Crear tarea programada', diff --git a/frontend/src/lang/modules/ja.ts b/frontend/src/lang/modules/ja.ts index bf1a47a87e44..18b4980a03b1 100644 --- a/frontend/src/lang/modules/ja.ts +++ b/frontend/src/lang/modules/ja.ts @@ -1003,6 +1003,7 @@ const message = { author: '著者', ifPause: '作成中にコンテナを一時停止します', ifMakeImageWithContainer: 'このコンテナから新しい画像を作成しますか?', + finishTime: '前回の停止時間', }, cronjob: { create: 'Cronジョブを作成します', diff --git a/frontend/src/lang/modules/ko.ts b/frontend/src/lang/modules/ko.ts index 04bf22f67666..da2fe7b27c1d 100644 --- a/frontend/src/lang/modules/ko.ts +++ b/frontend/src/lang/modules/ko.ts @@ -993,6 +993,7 @@ const message = { author: '작성자', ifPause: '생성 중 컨테이너 일시 정지', ifMakeImageWithContainer: '이 컨테이너에서 새 이미지를 생성하시겠습니까?', + finishTime: '마지막 중지 시간', }, cronjob: { create: '크론 작업 생성', diff --git a/frontend/src/lang/modules/ms.ts b/frontend/src/lang/modules/ms.ts index cf679bc4da1a..a3450e9bb4be 100644 --- a/frontend/src/lang/modules/ms.ts +++ b/frontend/src/lang/modules/ms.ts @@ -1027,6 +1027,7 @@ const message = { author: 'Pengarang', ifPause: 'Jeda Kontena Semasa Penciptaan', ifMakeImageWithContainer: 'Cipta Imej Baru daripada Kontena Ini?', + finishTime: 'Masa berhenti terakhir', }, cronjob: { create: 'Cipta tugas cron', diff --git a/frontend/src/lang/modules/pt-br.ts b/frontend/src/lang/modules/pt-br.ts index 3b21caa121c6..713a1a37e6ff 100644 --- a/frontend/src/lang/modules/pt-br.ts +++ b/frontend/src/lang/modules/pt-br.ts @@ -1024,6 +1024,7 @@ const message = { author: 'Autor', ifPause: 'Pausar container durante a criação', ifMakeImageWithContainer: 'Criar nova imagem a partir deste container?', + finishTime: 'Horário da última parada', }, cronjob: { create: 'Criar tarefa cron', diff --git a/frontend/src/lang/modules/ru.ts b/frontend/src/lang/modules/ru.ts index 7c90571702a2..7e2c8ee432e2 100644 --- a/frontend/src/lang/modules/ru.ts +++ b/frontend/src/lang/modules/ru.ts @@ -1022,6 +1022,7 @@ const message = { author: 'Автор', ifPause: 'Приостановить контейнер во время создания', ifMakeImageWithContainer: 'Создать новый образ из этого контейнера?', + finishTime: 'Время последней остановки', }, cronjob: { create: 'Создать задачу cron', diff --git a/frontend/src/lang/modules/tr.ts b/frontend/src/lang/modules/tr.ts index 5fc76aff0022..93d87ac19ae1 100644 --- a/frontend/src/lang/modules/tr.ts +++ b/frontend/src/lang/modules/tr.ts @@ -1044,6 +1044,7 @@ const message = { author: 'Yazar', ifPause: 'Oluşturma Sırasında Konteyneri Duraklat', ifMakeImageWithContainer: 'Bu Konteynerden Yeni İmaj Oluşturulsun mu?', + finishTime: 'Son durdurma zamanı', }, cronjob: { create: 'Cron görevi oluştur', diff --git a/frontend/src/lang/modules/zh-Hant.ts b/frontend/src/lang/modules/zh-Hant.ts index 227608d3cb19..ce13d2af0275 100644 --- a/frontend/src/lang/modules/zh-Hant.ts +++ b/frontend/src/lang/modules/zh-Hant.ts @@ -980,6 +980,7 @@ const message = { author: '作者', ifPause: '製作過程中是否暫停容器', ifMakeImageWithContainer: '是否根據此容器製作新鏡像?', + finishTime: '上一次停止時間', }, cronjob: { create: '建立計劃任務', diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts index e8e429a4c287..9e0b1f97dde2 100644 --- a/frontend/src/lang/modules/zh.ts +++ b/frontend/src/lang/modules/zh.ts @@ -980,6 +980,7 @@ const message = { author: '作者', ifPause: '制作过程中是否暂停容器', ifMakeImageWithContainer: '是否根据此容器制作新镜像?', + finishTime: '上一次停止时间', }, cronjob: { create: '创建计划任务', From d60ae769a06e24460110ddaa32cfc45e11a1bb07 Mon Sep 17 00:00:00 2001 From: HynoR <20227709+HynoR@users.noreply.github.com> Date: Mon, 27 Oct 2025 17:39:22 +0800 Subject: [PATCH 3/3] fix: switch order in mount detail card. --- frontend/src/views/container/container/inspect/index.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/frontend/src/views/container/container/inspect/index.vue b/frontend/src/views/container/container/inspect/index.vue index a9328559aaa6..6c8a4ec2b068 100644 --- a/frontend/src/views/container/container/inspect/index.vue +++ b/frontend/src/views/container/container/inspect/index.vue @@ -158,7 +158,7 @@ {{ row.Type }} - + - - +