From 1f92324a45c609893484a1bd6893f16371ba611e Mon Sep 17 00:00:00 2001 From: ssongliu <73214554+ssongliu@users.noreply.github.com> Date: Thu, 12 Oct 2023 21:58:32 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AE=B9=E5=99=A8=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=8F=90=E7=A4=BA=E4=BF=A1=E6=81=AF=20(#2529?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/lang/modules/en.ts | 2 ++ frontend/src/lang/modules/tw.ts | 1 + frontend/src/lang/modules/zh.ts | 1 + .../container/container/operate/index.vue | 35 ++++++++++++++++--- 4 files changed, 34 insertions(+), 5 deletions(-) diff --git a/frontend/src/lang/modules/en.ts b/frontend/src/lang/modules/en.ts index 6b404bb19..7c806e7bc 100644 --- a/frontend/src/lang/modules/en.ts +++ b/frontend/src/lang/modules/en.ts @@ -546,6 +546,8 @@ const message = { cpuShareHelper: 'The default CPU share for a container is 1024, which can be increased to give the container more CPU time.', + containerFromAppHelper: + 'Detected that this container originates from the app store. App operations may cause current edits to be invalidated.', command: 'Command', console: 'Console Interaction', tty: 'TTY (-t)', diff --git a/frontend/src/lang/modules/tw.ts b/frontend/src/lang/modules/tw.ts index 74e305529..352be17fe 100644 --- a/frontend/src/lang/modules/tw.ts +++ b/frontend/src/lang/modules/tw.ts @@ -532,6 +532,7 @@ const message = { cpuShare: 'CPU 權重', cpuShareHelper: '容器默認份額為 1024 個 CPU,增大可使當前容器獲得更多的 CPU 時間', + containerFromAppHelper: '檢測到該容器來源於應用商店,應用操作可能會導致當前編輯失效', command: '命令', console: '控製臺交互', tty: '偽終端 ( -t )', diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts index 22d8eaf16..4be57f888 100644 --- a/frontend/src/lang/modules/zh.ts +++ b/frontend/src/lang/modules/zh.ts @@ -532,6 +532,7 @@ const message = { cpuShare: 'CPU 权重', cpuShareHelper: '容器默认份额为 1024 个 CPU,增大可使当前容器获得更多的 CPU 时间', + containerFromAppHelper: '检测到该容器来源于应用商店,应用操作可能会导致当前编辑失效', command: '命令', console: '控制台交互', tty: '伪终端 ( -t )', diff --git a/frontend/src/views/container/container/operate/index.vue b/frontend/src/views/container/container/operate/index.vue index 72b65b3e2..6205f05f7 100644 --- a/frontend/src/views/container/container/operate/index.vue +++ b/frontend/src/views/container/container/operate/index.vue @@ -24,6 +24,13 @@ > + @@ -171,7 +178,7 @@ - + { itemCmd += `'${item}' `; } dialogData.value.rowData.cmdStr = itemCmd ? itemCmd.substring(0, itemCmd.length - 1) : ''; - if (dialogData.value.rowData.entrypoint) { - dialogData.value.rowData.entrypointStr = dialogData.value.rowData.entrypoint.join(' '); + + let itemEntrypoint = ''; + for (const item of dialogData.value.rowData.entrypoint) { + itemEntrypoint += `'${item}' `; } + dialogData.value.rowData.entrypointStr = itemEntrypoint + ? itemEntrypoint.substring(0, itemEntrypoint.length - 1) + : ''; dialogData.value.rowData.labels = dialogData.value.rowData.labels || []; dialogData.value.rowData.env = dialogData.value.rowData.env || []; dialogData.value.rowData.labelsStr = dialogData.value.rowData.labels.join('\n'); @@ -435,8 +447,21 @@ const onSubmit = async (formEl: FormInstance | undefined) => { } } } - if (dialogData.value.rowData!.entrypointStr) { - dialogData.value.rowData!.entrypoint = dialogData.value.rowData!.entrypointStr.split(' '); + dialogData.value.rowData!.entrypoint = []; + if (dialogData.value.rowData?.entrypointStr) { + if (dialogData.value.rowData?.entrypointStr.indexOf(`'`) !== -1) { + let itemEntrypoint = dialogData.value.rowData!.entrypointStr.split(`'`); + for (const entry of itemEntrypoint) { + if (entry && entry !== ' ') { + dialogData.value.rowData!.entrypoint.push(entry); + } + } + } else { + let itemEntrypoint = dialogData.value.rowData!.entrypointStr.split(` `); + for (const entry of itemEntrypoint) { + dialogData.value.rowData!.entrypoint.push(entry); + } + } } if (dialogData.value.rowData!.publishAllPorts) { dialogData.value.rowData!.exposedPorts = [];