diff --git a/modules/templates/helper.go b/modules/templates/helper.go
index 3e424454b..c314127f1 100755
--- a/modules/templates/helper.go
+++ b/modules/templates/helper.go
@@ -151,6 +151,9 @@ func NewFuncMap() []template.FuncMap {
"EscapePound": func(str string) string {
return strings.NewReplacer("%", "%25", "#", "%23", " ", "%20", "?", "%3F").Replace(str)
},
+ "IpynbBool":func(str string) bool{
+ return strings.Contains(str, ".ipynb")
+ },
"nl2br": func(text string) template.HTML {
return template.HTML(strings.Replace(template.HTMLEscapeString(text), "\n", "
", -1))
},
diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini
index c14955dff..66ee9b64f 100755
--- a/options/locale/locale_en-US.ini
+++ b/options/locale/locale_en-US.ini
@@ -1438,6 +1438,7 @@ blame = Blame
normal_view = Normal View
line = line
lines = lines
+notebook_open = Open in Notebook
editor.new_file = New File
editor.upload_file = Upload File
diff --git a/options/locale/locale_zh-CN.ini b/options/locale/locale_zh-CN.ini
index fc0743c59..da82a2316 100755
--- a/options/locale/locale_zh-CN.ini
+++ b/options/locale/locale_zh-CN.ini
@@ -1456,6 +1456,8 @@ normal_view=普通视图
line=行
lines=行
+notebook_open = 在Notebook中打开
+
editor.new_file=新建文件
editor.upload_file=上传文件
editor.edit_file=编辑文件
diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl
index cb83bebe7..2c94d5f30 100755
--- a/templates/repo/header.tmpl
+++ b/templates/repo/header.tmpl
@@ -90,7 +90,7 @@
{{end}}
{{if not .Repository.IsBeingCreated}}
-
@@ -27,12 +27,12 @@
C
-
CPU 环境
+
{{$t('notebook.cpuEnv')}}
{{cpuSpec}}
- 镜像:{{notebookInfo.imageCpuDescription}}
+ {{$t('image')}}:{{notebookInfo.imageCpuDescription}}
@@ -54,12 +54,12 @@
G
-
GPU 环境
+
{{$t('notebook.gpuEnv')}}
{{gpuSpec}}
- 镜像:{{notebookInfo.imageGpuDescription}}
+ {{$t('image')}}:{{notebookInfo.imageGpuDescription}}
@@ -82,12 +82,12 @@
N
-
NPU 环境
+
{{$t('notebook.npuEnv')}}
{{npuSpec}}
- 镜像:{{notebookInfo.imageCpuDescription}}
+ {{$t('image')}}:{{notebookInfo.imageCpuDescription}}
@@ -102,68 +102,68 @@
@@ -240,7 +240,6 @@ export default {
},
getNotebookInfo(){
getFileNotebook().then((res)=>{
- console.log(res)
if(res.data.code==0){
this.notebookInfo = res.data
}else{
@@ -252,7 +251,6 @@ export default {
},
getCb1NotebookInfo(path,id,index){
getCb1Notebook(path,id).then((res)=>{
- console.log(res)
if(res.status===200){
if(res.data.JobStatus==="RUNNING"){
this.btnStatus[index]=2
@@ -260,9 +258,7 @@ export default {
this.deubgUrlGpuStop = `${AppSubUrl}/${this.fileInfo.owner_name}/${this.notebookInfo.projectName}/cloudbrain/${id}/stop`
clearInterval(timerCb1)
}
- console.log(finalState.includes(res.data.JobStatus),finalState,res.data.JobStatus)
if(finalState.includes(res.data.JobStatus)){
- console.log("---=-==",index)
this.btnStatus[index] = 0
clearInterval(timerCb1)
}
@@ -279,7 +275,6 @@ export default {
clearInterval(timerCb2)
}
if(finalState.includes(res.data.JobStatus)){
- console.log("---=-==")
this.btnStatus[2] = 0
clearInterval(timerCb2)
}
@@ -292,7 +287,7 @@ export default {
stopNotebook(url).then((res)=>{
if(res.data.result_code==='0'){
this.btnStatus[index]=0
- Message.success("停止任务成功")
+ Message.success(this.$t("notebook.stopSuccess"))
}else{
this.btnStatus[index]=0
Message.error(res.data.error_msg)
@@ -314,7 +309,7 @@ export default {
}, 10000)
}else{
timerCb1 = setInterval(() => {
- setTimeout(this.getCb1NotebookInfo(repoPath,res.data.message), 0,index)
+ setTimeout(this.getCb1NotebookInfo(repoPath,res.data.message,index), 0)
}, 10000)
}
this.alertCb = false
@@ -339,19 +334,19 @@ export default {
},
computed: {
cpuSpec(){
- return `规格:GPU: ${this.notebookInfo.specCpu.acc_cards_num}*${this.notebookInfo.specCpu.acc_card_type},
- CPU: ${this.notebookInfo.specCpu.cpu_cores}, 显存: ${this.notebookInfo.specCpu.gpu_mem_gi_b}GB,
- 内存: ${this.notebookInfo.specCpu.mem_gi_b}GB, 共享内存: ${this.notebookInfo.specCpu.share_mem_gi_b}GB`
+ 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`
},
npuSpec(){
- return `规格:NPU: ${this.notebookInfo.specNpu.acc_cards_num}*${this.notebookInfo.specNpu.acc_card_type},
- CPU: ${this.notebookInfo.specNpu.cpu_cores}, 显存: ${this.notebookInfo.specNpu.gpu_mem_gi_b}GB,
- 内存: ${this.notebookInfo.specNpu.mem_gi_b}GB, 共享内存: ${this.notebookInfo.specNpu.share_mem_gi_b}GB`
+ 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`
},
gpuSpec(){
- return `规格:NPU: ${this.notebookInfo.specGpu.acc_cards_num}*${this.notebookInfo.specGpu.acc_card_type},
- CPU: ${this.notebookInfo.specGpu.cpu_cores}, 显存: ${this.notebookInfo.specGpu.gpu_mem_gi_b}GB,
- 内存: ${this.notebookInfo.specGpu.mem_gi_b}GB, 共享内存: ${this.notebookInfo.specGpu.share_mem_gi_b}GB`
+ 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`
}
},
beforeDestroy() {
@@ -445,6 +440,7 @@ export default {
display: flex;
align-items: center;
justify-content: center;
+ flex-shrink: 0;
.text {
font-size: 26px;
color: rgba(251, 251, 251, 1);