diff --git a/routers/repo/cloudbrain.go b/routers/repo/cloudbrain.go index 154dbb402..7cac900c6 100755 --- a/routers/repo/cloudbrain.go +++ b/routers/repo/cloudbrain.go @@ -349,11 +349,23 @@ func CloudBrainShowModels(ctx *context.Context) { //get dirs + ctx.Data["task"] = task ctx.Data["jobID"] = jobID ctx.HTML(200, tplCloudBrainShowModels) } +func getModelDirs(uuid string, parentDir string) (string, error) { + var req string + if parentDir == "" { + req = "uuid=" + uuid + } else { + req = "uuid=" + uuid + "&parentDir=" + parentDir + } + + return getDirs(req) +} + func CloudBrainDownloadModel(ctx *context.Context) { filePath := ctx.Query("file_path") fileName := ctx.Query("file_name") diff --git a/routers/repo/dir.go b/routers/repo/dir.go index 388af34ec..ea1f80498 100755 --- a/routers/repo/dir.go +++ b/routers/repo/dir.go @@ -58,7 +58,7 @@ func DirIndex(ctx *context.Context) { dirArray = []string{attachment.Name} } - dirs, err := getDirs(uuid, parentDir) + dirs, err := getDatasetDirs(uuid, parentDir) if err != nil { log.Error("getDirs failed:", err.Error()) ctx.ServerError("getDirs failed:", err) @@ -75,13 +75,13 @@ func DirIndex(ctx *context.Context) { ctx.Data["Path"] = dirArray ctx.Data["Dirs"] = fileInfos + ctx.Data["Uuid"] = uuid ctx.Data["PageIsDataset"] = true ctx.HTML(200, tplDirIndex) } -func getDirs(uuid string, parentDir string) (string, error) { - var dirs string +func getDatasetDirs(uuid string, parentDir string) (string, error) { var req string if parentDir == "" { req = "uuid=" + uuid @@ -89,7 +89,13 @@ func getDirs(uuid string, parentDir string) (string, error) { req = "uuid=" + uuid + "&parentDir=" + parentDir } - url := setting.DecompressAddress + "/dirs?" + req + return getDirs(req) +} + +func getDirs(req string) (string, error) { + var dirs string + + url := setting.DecompressAddress + "/dirs/dataset?" + req reqHttp, err := http.NewRequest(http.MethodGet, url, nil) if err != nil { log.Error("http.NewRequest failed:", err.Error()) @@ -127,6 +133,5 @@ func getDirs(uuid string, parentDir string) (string, error) { } dirs = resp.FileInfos - return dirs, nil } diff --git a/templates/repo/datasets/dirs/dir_list.tmpl b/templates/repo/datasets/dirs/dir_list.tmpl index 98232e17e..9d10f509c 100755 --- a/templates/repo/datasets/dirs/dir_list.tmpl +++ b/templates/repo/datasets/dirs/dir_list.tmpl @@ -6,7 +6,7 @@