diff --git a/modules/storage/obs.go b/modules/storage/obs.go index 33730b72c..aa5d2e356 100755 --- a/modules/storage/obs.go +++ b/modules/storage/obs.go @@ -424,6 +424,7 @@ func GetObsListObject(jobName, outPutPath, parentDir, versionName string) ([]Fil input := &obs.ListObjectsInput{} input.Bucket = setting.Bucket input.Prefix = strings.TrimPrefix(path.Join(setting.TrainJobModelPath, jobName, outPutPath, versionName, parentDir), "/") + log.Info("bucket=" + input.Bucket + " Prefix=" + input.Prefix) strPrefix := strings.Split(input.Prefix, "/") output, err := ObsCli.ListObjects(input) fileInfos := make([]FileInfo, 0) diff --git a/routers/repo/ai_model_manage.go b/routers/repo/ai_model_manage.go index 5a47098d5..36438f8d4 100644 --- a/routers/repo/ai_model_manage.go +++ b/routers/repo/ai_model_manage.go @@ -463,8 +463,9 @@ func QueryTrainModelList(ctx *context.Context) { log.Info("query train job list. start.") jobName := ctx.Query("jobName") taskType := ctx.QueryInt("type") + VersionName := ctx.Query("VersionName") if taskType == models.TypeCloudBrainTwo { - objectkey := strings.TrimPrefix(path.Join(setting.TrainJobModelPath, jobName, setting.OutPutPath), "/") + objectkey := strings.TrimPrefix(path.Join(setting.TrainJobModelPath, jobName, setting.OutPutPath, VersionName, ""), "/") modelDbResult, err := storage.GetAllObjectByBucketAndPrefix(setting.Bucket, objectkey) log.Info("bucket=" + setting.Bucket + " objectkey=" + objectkey) if err != nil { diff --git a/templates/repo/modelmanage/index.tmpl b/templates/repo/modelmanage/index.tmpl index 9bf78483c..0fcb9068a 100644 --- a/templates/repo/modelmanage/index.tmpl +++ b/templates/repo/modelmanage/index.tmpl @@ -439,7 +439,7 @@ if(trainJob ==null || trainJob ==""){ console.log("trainJob is null"); }else{ - $.get(`${repolink}/modelmanage/query_train_model?jobName=${trainJob.JobName}&type=${trainJob.Type}`, (data) => { + $.get(`${repolink}/modelmanage/query_train_model?jobName=${trainJob.JobName}&type=${trainJob.Type}&VersionName=${trainJob.VersionName}`, (data) => { const n_length = data.length let file_html='' let firstFileName =''