From f0ae92303ab5bad02d63fe07a4f8240641046fcb Mon Sep 17 00:00:00 2001 From: zhoupzh Date: Wed, 23 Nov 2022 16:27:22 +0800 Subject: [PATCH] fix issue --- web_src/vuepages/langs/config/en-US.js | 2 +- web_src/vuepages/langs/config/zh-CN.js | 2 +- .../vuepages/pages/notebook/debug/index.vue | 42 +++++++++++++++---- 3 files changed, 35 insertions(+), 11 deletions(-) diff --git a/web_src/vuepages/langs/config/en-US.js b/web_src/vuepages/langs/config/en-US.js index 4f55afaaa..dd85bfe34 100644 --- a/web_src/vuepages/langs/config/en-US.js +++ b/web_src/vuepages/langs/config/en-US.js @@ -213,7 +213,7 @@ const en = { debug: "Debug", stop: "Stop", stopping: "Stopping", - notebookRunning: "The debugging environment has been started, and it will automatically close after a single connection for 4 hours or no operation for half an hour", + notebookRunning: "The debugging environment has been started, and it will automatically close after 4 hours ", stopSuccess: "Stop task succeeded", specification: "Specification", graphicMemory: "Graphic Memory", diff --git a/web_src/vuepages/langs/config/zh-CN.js b/web_src/vuepages/langs/config/zh-CN.js index 1a55f5688..1d915749e 100644 --- a/web_src/vuepages/langs/config/zh-CN.js +++ b/web_src/vuepages/langs/config/zh-CN.js @@ -214,7 +214,7 @@ const zh = { debug: "调试", stop: "停止", stopping: "停止中", - notebookRunning: "调试环境已启动,单次连接 4 小时或无操作半小时后自动关闭", + notebookRunning: "调试环境已启动,单次连接 4 小时后自动关闭", stopSuccess: "停止任务成功", specification: "规格", graphicMemory: "显存", diff --git a/web_src/vuepages/pages/notebook/debug/index.vue b/web_src/vuepages/pages/notebook/debug/index.vue index a970025ba..ebe0ac9a0 100644 --- a/web_src/vuepages/pages/notebook/debug/index.vue +++ b/web_src/vuepages/pages/notebook/debug/index.vue @@ -352,19 +352,43 @@ export default { }, computed: { cpuSpec(){ - return `${this.$t("notebook.specification")}:GPU: ${this.notebookInfo.specCpu.acc_cards_num}*${this.notebookInfo.specCpu.acc_card_type}, - CPU: ${this.notebookInfo.specCpu.cpu_cores}, ${this.$t("notebook.graphicMemory")}: ${this.notebookInfo.specCpu.gpu_mem_gi_b}GB, - ${this.$t("notebook.memory")}: ${this.notebookInfo.specCpu.mem_gi_b}GB, ${this.$t("notebook.sharedMemory")}: ${this.notebookInfo.specCpu.share_mem_gi_b}GB` + let cpu_spec = `${this.$t("notebook.specification")}:GPU: ${this.notebookInfo.specCpu.acc_cards_num}*${this.notebookInfo.specCpu.acc_card_type}, CPU: ${this.notebookInfo.specCpu.cpu_cores}, ` + if(this.notebookInfo.specCpu.gpu_mem_gi_b!==0){ + cpu_spec += `${this.$t("notebook.graphicMemory")}: ${this.notebookInfo.specCpu.gpu_mem_gi_b}GB, ` + } + if(this.notebookInfo.specCpu.mem_gi_b!==0){ + cpu_spec += `${this.$t("notebook.memory")}: ${this.notebookInfo.specCpu.mem_gi_b}GB, ` + } + if(this.notebookInfo.specCpu.share_mem_gi_b!==0){ + cpu_spec += `${this.$t("notebook.sharedMemory")}: ${this.notebookInfo.specCpu.share_mem_gi_b}GB` + } + return cpu_spec }, npuSpec(){ - return `${this.$t("notebook.specification")}:NPU: ${this.notebookInfo.specNpu.acc_cards_num}*${this.notebookInfo.specNpu.acc_card_type}, - CPU: ${this.notebookInfo.specNpu.cpu_cores}, ${this.$t("notebook.graphicMemory")}: ${this.notebookInfo.specNpu.gpu_mem_gi_b}GB, - ${this.$t("notebook.memory")}: ${this.notebookInfo.specNpu.mem_gi_b}GB, ${this.$t("notebook.sharedMemory")}: ${this.notebookInfo.specNpu.share_mem_gi_b}GB` + let npu_spec = `${this.$t("notebook.specification")}:NPU: ${this.notebookInfo.specNpu.acc_cards_num}*${this.notebookInfo.specNpu.acc_card_type}, CPU: ${this.notebookInfo.specNpu.cpu_cores}, ` + if(this.notebookInfo.specNpu.gpu_mem_gi_b!==0){ + npu_spec += `${this.$t("notebook.graphicMemory")}: ${this.notebookInfo.specNpu.gpu_mem_gi_b}GB, ` + } + if(this.notebookInfo.specNpu.mem_gi_b!==0){ + npu_spec += `${this.$t("notebook.memory")}: ${this.notebookInfo.specNpu.mem_gi_b}GB, ` + } + if(this.notebookInfo.specNpu.share_mem_gi_b!==0){ + npu_spec += `${this.$t("notebook.sharedMemory")}: ${this.notebookInfo.specNpu.share_mem_gi_b}GB` + } + return npu_spec }, gpuSpec(){ - return `${this.$t("notebook.specification")}:NPU: ${this.notebookInfo.specGpu.acc_cards_num}*${this.notebookInfo.specGpu.acc_card_type}, - CPU: ${this.notebookInfo.specGpu.cpu_cores}, ${this.$t("notebook.graphicMemory")}: ${this.notebookInfo.specGpu.gpu_mem_gi_b}GB, - ${this.$t("notebook.memory")}: ${this.notebookInfo.specGpu.mem_gi_b}GB, ${this.$t("notebook.sharedMemory")}: ${this.notebookInfo.specGpu.share_mem_gi_b}GB` + let gpu_spec = `${this.$t("notebook.specification")}:GPU: ${this.notebookInfo.specGpu.acc_cards_num}*${this.notebookInfo.specGpu.acc_card_type}, CPU: ${this.notebookInfo.specGpu.cpu_cores}, ` + if(this.notebookInfo.specGpu.gpu_mem_gi_b!==0){ + gpu_spec += `${this.$t("notebook.graphicMemory")}: ${this.notebookInfo.specGpu.gpu_mem_gi_b}GB, ` + } + if(this.notebookInfo.specGpu.mem_gi_b!==0){ + gpu_spec += `${this.$t("notebook.memory")}: ${this.notebookInfo.specGpu.mem_gi_b}GB, ` + } + if(this.notebookInfo.specGpu.share_mem_gi_b!==0){ + gpu_spec += `${this.$t("notebook.sharedMemory")}: ${this.notebookInfo.specGpu.share_mem_gi_b}GB` + } + return gpu_spec } }, beforeDestroy() {