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){