|
|
|
@@ -774,9 +774,11 @@ func QueryModelFileForPredict(ctx *context.Context) { |
|
|
|
ctx.ServerError("no such model:", err) |
|
|
|
return |
|
|
|
} |
|
|
|
prefix := model.Path[len(setting.Bucket)+1:] |
|
|
|
fileinfos, err := storage.GetAllObjectByBucketAndPrefix(setting.Bucket, prefix) |
|
|
|
ctx.JSON(http.StatusOK, fileinfos) |
|
|
|
if model.Type == models.TypeCloudBrainTwo { |
|
|
|
prefix := model.Path[len(setting.Bucket)+1:] |
|
|
|
fileinfos, _ := storage.GetAllObjectByBucketAndPrefix(setting.Bucket, prefix) |
|
|
|
ctx.JSON(http.StatusOK, fileinfos) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
func QueryOneLevelModelFile(ctx *context.Context) { |
|
|
|
@@ -788,7 +790,14 @@ func QueryOneLevelModelFile(ctx *context.Context) { |
|
|
|
ctx.ServerError("no such model:", err) |
|
|
|
return |
|
|
|
} |
|
|
|
prefix := model.Path[len(setting.Bucket)+1:] |
|
|
|
fileinfos, err := storage.GetOneLevelAllObjectUnderDir(setting.Bucket, prefix, parentDir) |
|
|
|
ctx.JSON(http.StatusOK, fileinfos) |
|
|
|
if model.Type == models.TypeCloudBrainTwo { |
|
|
|
prefix := model.Path[len(setting.Bucket)+1:] |
|
|
|
fileinfos, _ := storage.GetOneLevelAllObjectUnderDir(setting.Bucket, prefix, parentDir) |
|
|
|
ctx.JSON(http.StatusOK, fileinfos) |
|
|
|
} else if model.Type == models.TypeCloudBrainOne { |
|
|
|
prefix := model.Path[len(setting.Attachment.Minio.Bucket)+1:] |
|
|
|
fileinfos, _ := storage.GetOneLevelAllObjectUnderDirMinio(setting.Attachment.Minio.Bucket, prefix, parentDir) |
|
|
|
ctx.JSON(http.StatusOK, fileinfos) |
|
|
|
} |
|
|
|
|
|
|
|
} |