From 146f66ea3798d68344a81932bedc81811fb7a59f Mon Sep 17 00:00:00 2001 From: zouap Date: Mon, 8 Aug 2022 09:49:46 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- modules/storage/minio_ext.go | 41 ----------------------------------- templates/repo/modelmanage/index.tmpl | 2 +- 2 files changed, 1 insertion(+), 42 deletions(-) diff --git a/modules/storage/minio_ext.go b/modules/storage/minio_ext.go index 05b692335..4b738c068 100755 --- a/modules/storage/minio_ext.go +++ b/modules/storage/minio_ext.go @@ -214,47 +214,6 @@ func GetOneLevelAllObjectUnderDirMinio(bucket string, prefixRootPath string, rel ParenDir: ParenDir, } fileInfos = append(fileInfos, fileInfo) - - // log.Info("val key=" + val.Key) - // var isDir bool - // var fileName string - // if val.Key == Prefix { - // continue - // } - - // fileName = val.Key[prefixLen:] - // log.Info("fileName =" + fileName) - // files := strings.Split(fileName, "/") - // if fileMap[files[0]] { - // continue - // } else { - // fileMap[files[0]] = true - // } - // ParenDir := relativePath - // fileName = files[0] - // if len(files) > 1 { - // isDir = true - // ParenDir += fileName + "/" - // } else { - // isDir = false - // } - - // // if strings.HasSuffix(val.Key, "/") { - // // isDir = true - // // fileName = val.Key[prefixLen : len(val.Key)-1] - // // relativePath += val.Key[prefixLen:] - // // } else { - // // isDir = false - // // fileName = val.Key[prefixLen:] - // // } - // fileInfo := FileInfo{ - // ModTime: val.LastModified.Local().Format("2006-01-02 15:04:05"), - // FileName: fileName, - // Size: val.Size, - // IsDir: isDir, - // ParenDir: relativePath, - // } - // fileInfos = append(fileInfos, fileInfo) } return fileInfos, err } else { diff --git a/templates/repo/modelmanage/index.tmpl b/templates/repo/modelmanage/index.tmpl index c42f1ba7b..4d02a8e21 100644 --- a/templates/repo/modelmanage/index.tmpl +++ b/templates/repo/modelmanage/index.tmpl @@ -463,7 +463,7 @@ parentNodeMap = nodesMap; var fileSplits = data[i].FileName.split("/"); for(let j=0;j < fileSplits.length;j++){ - if(fileSplits[j] == ""){ + if(fileSplits[j] == "" && !(data[i].FileName[data[i].FileName.length - 1]=="/")){ break; } if(parentNodeMap[fileSplits[j]] == null){ From 6a60330adc3e863d870db167fa1e0a1d9cf6a78d Mon Sep 17 00:00:00 2001 From: zouap Date: Mon, 8 Aug 2022 10:04:51 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- templates/repo/modelmanage/index.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/repo/modelmanage/index.tmpl b/templates/repo/modelmanage/index.tmpl index 4d02a8e21..c42f1ba7b 100644 --- a/templates/repo/modelmanage/index.tmpl +++ b/templates/repo/modelmanage/index.tmpl @@ -463,7 +463,7 @@ parentNodeMap = nodesMap; var fileSplits = data[i].FileName.split("/"); for(let j=0;j < fileSplits.length;j++){ - if(fileSplits[j] == "" && !(data[i].FileName[data[i].FileName.length - 1]=="/")){ + if(fileSplits[j] == ""){ break; } if(parentNodeMap[fileSplits[j]] == null){ From aceb9ad8ec742466bf8b53b243d8fb12ad8c80b4 Mon Sep 17 00:00:00 2001 From: zouap Date: Mon, 8 Aug 2022 10:51:42 +0800 Subject: [PATCH 3/9] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- templates/repo/modelmanage/index.tmpl | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/templates/repo/modelmanage/index.tmpl b/templates/repo/modelmanage/index.tmpl index c42f1ba7b..567ff8dc7 100644 --- a/templates/repo/modelmanage/index.tmpl +++ b/templates/repo/modelmanage/index.tmpl @@ -325,6 +325,7 @@ $('#name').val(modelName) $('#version').val("0.0.1") } + let dirKey="isOnlyDir--:&"; function showcreate(obj) { $('.ui.modal.second') .modal({ @@ -471,6 +472,16 @@ } parentNodeMap = parentNodeMap[fileSplits[j]] } + for(let j=0;j < fileSplits.length;j++){ + if(fileSplits[j] == ""){ + if(data[i].FileName[data[i].FileName.length -1] =="/"){ + if(Object.keys(parentNodeMap[fileSplits[j]]).length ==0){ + parentNodeMap[fileSplits[j]][dirKey]="true"; + } + } + break; + } + } } convertToNode(zNodes,nodesMap); $.fn.zTree.init($("#treeDemo"), setting, zNodes); @@ -488,12 +499,18 @@ node["name"] = keyList[i]; nodeList.push(node); if(nodesMap[keyList[i]] != null && Object.keys(nodesMap[keyList[i]]).length >0){ - node["children"]=[]; - if(isFirst){ - node["open"] = true; - isFirst= false; + if(nodesMap[keyList[i]][dirKey] != null){ + node["open"] = false; + node["isParent"] = true; + }else{ + node["children"]=[]; + if(isFirst){ + node["open"] = true; + isFirst= false; + } + convertToNode(node["children"],nodesMap[keyList[i]]); } - convertToNode(node["children"],nodesMap[keyList[i]]); + } } } From 29b4628b9014f27b4c2f1d8c3ab89c659b79dd18 Mon Sep 17 00:00:00 2001 From: zouap Date: Mon, 8 Aug 2022 10:56:13 +0800 Subject: [PATCH 4/9] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- templates/repo/modelmanage/index.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/repo/modelmanage/index.tmpl b/templates/repo/modelmanage/index.tmpl index 567ff8dc7..9e741cf2d 100644 --- a/templates/repo/modelmanage/index.tmpl +++ b/templates/repo/modelmanage/index.tmpl @@ -475,7 +475,7 @@ for(let j=0;j < fileSplits.length;j++){ if(fileSplits[j] == ""){ if(data[i].FileName[data[i].FileName.length -1] =="/"){ - if(Object.keys(parentNodeMap[fileSplits[j]]).length ==0){ + if(Object.keys(parentNodeMap[fileSplits[j-1]]).length ==0){ parentNodeMap[fileSplits[j]][dirKey]="true"; } } From 6c7bef90e983afb34e7989ea6e1e64909100c101 Mon Sep 17 00:00:00 2001 From: zouap Date: Mon, 8 Aug 2022 11:12:49 +0800 Subject: [PATCH 5/9] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- templates/repo/modelmanage/index.tmpl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/templates/repo/modelmanage/index.tmpl b/templates/repo/modelmanage/index.tmpl index 9e741cf2d..3f83ea5e1 100644 --- a/templates/repo/modelmanage/index.tmpl +++ b/templates/repo/modelmanage/index.tmpl @@ -470,8 +470,10 @@ if(parentNodeMap[fileSplits[j]] == null){ parentNodeMap[fileSplits[j]] = {}; } - parentNodeMap = parentNodeMap[fileSplits[j]] + parentNodeMap = parentNodeMap[fileSplits[j]]; } + + parentNodeMap = nodesMap; for(let j=0;j < fileSplits.length;j++){ if(fileSplits[j] == ""){ if(data[i].FileName[data[i].FileName.length -1] =="/"){ @@ -481,6 +483,7 @@ } break; } + parentNodeMap = parentNodeMap[fileSplits[j]]; } } convertToNode(zNodes,nodesMap); From ee51a420fb642a7312984e99d5a0f46a82af3228 Mon Sep 17 00:00:00 2001 From: zouap Date: Mon, 8 Aug 2022 11:20:18 +0800 Subject: [PATCH 6/9] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- templates/repo/modelmanage/index.tmpl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/repo/modelmanage/index.tmpl b/templates/repo/modelmanage/index.tmpl index 3f83ea5e1..9fd3e1007 100644 --- a/templates/repo/modelmanage/index.tmpl +++ b/templates/repo/modelmanage/index.tmpl @@ -461,7 +461,7 @@ var zNodes=[]; var nodesMap={}; for (let i=0;i Date: Mon, 8 Aug 2022 11:24:25 +0800 Subject: [PATCH 7/9] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- templates/repo/modelmanage/index.tmpl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/templates/repo/modelmanage/index.tmpl b/templates/repo/modelmanage/index.tmpl index 9fd3e1007..e92c3bd5f 100644 --- a/templates/repo/modelmanage/index.tmpl +++ b/templates/repo/modelmanage/index.tmpl @@ -472,8 +472,10 @@ } parentNodeMap = parentNodeMap[fileSplits[j]]; } - - parentNodeMap = nodesMap; + } + for (let i=0;i Date: Mon, 8 Aug 2022 11:31:22 +0800 Subject: [PATCH 8/9] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- templates/repo/modelmanage/index.tmpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/repo/modelmanage/index.tmpl b/templates/repo/modelmanage/index.tmpl index e92c3bd5f..52b042c46 100644 --- a/templates/repo/modelmanage/index.tmpl +++ b/templates/repo/modelmanage/index.tmpl @@ -479,8 +479,8 @@ for(let j=0;j < fileSplits.length;j++){ if(fileSplits[j] == ""){ if(data[i].FileName[data[i].FileName.length -1] =="/"){ - if(Object.keys(parentNodeMap[fileSplits[j-1]]).length ==0){ - parentNodeMap[fileSplits[j-1]][dirKey]="true"; + if(Object.keys(parentNodeMap).length ==0){ + parentNodeMap[dirKey]="true"; } } break; From a7d8c351e20f5a7a2f4ea01f6670973586c67c2b Mon Sep 17 00:00:00 2001 From: zouap Date: Mon, 8 Aug 2022 16:44:51 +0800 Subject: [PATCH 9/9] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=EF=BC=8C=E8=A7=A3=E5=86=B3mindspore=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- templates/repo/grampus/trainjob/show.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/repo/grampus/trainjob/show.tmpl b/templates/repo/grampus/trainjob/show.tmpl index 728b876b5..25f1af82b 100755 --- a/templates/repo/grampus/trainjob/show.tmpl +++ b/templates/repo/grampus/trainjob/show.tmpl @@ -773,7 +773,7 @@ } if (srcEngine == 'mindspore') { $('#choice_Engine .default.text').text("MindSpore"); - $('#choice_Engine input[name="Engine"]').val(1) + $('#choice_Engine input[name="Engine"]').val(2) } } }else{