| @@ -37,7 +37,8 @@ const ( | |||
| ) | |||
| func GrampusTrainJobGPUNew(ctx *context.Context) { | |||
| err := grampusGpuNewDataPrepare(ctx) | |||
| ctx.Data["cloudbraintype"] = models.TypeCloudBrainOne | |||
| err := grampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeGPU) | |||
| if err != nil { | |||
| ctx.ServerError("get new train-job info failed", err) | |||
| return | |||
| @@ -45,110 +46,9 @@ func GrampusTrainJobGPUNew(ctx *context.Context) { | |||
| ctx.HTML(http.StatusOK, tplGrampusTrainJobGPUNew) | |||
| } | |||
| func grampusGpuNewDataPrepare(ctx *context.Context) error { | |||
| ctx.Data["PageIsCloudBrain"] = true | |||
| t := time.Now() | |||
| var displayJobName = jobNamePrefixValid(cutString(ctx.User.Name, 5)) + t.Format("2006010215") + strconv.Itoa(int(t.Unix()))[5:] | |||
| ctx.Data["display_job_name"] = displayJobName | |||
| //get valid images | |||
| result, err := cloudbrain.GetImages() | |||
| if err != nil { | |||
| ctx.Data["error"] = err.Error() | |||
| log.Error("cloudbrain.GetImages failed:", err.Error(), ctx.Data["MsgID"]) | |||
| } | |||
| for i, payload := range result.Payload.ImageInfo { | |||
| if strings.HasPrefix(result.Payload.ImageInfo[i].Place, "192.168") { | |||
| result.Payload.ImageInfo[i].PlaceView = payload.Place[strings.Index(payload.Place, "/"):len(payload.Place)] | |||
| } else { | |||
| result.Payload.ImageInfo[i].PlaceView = payload.Place | |||
| } | |||
| } | |||
| ctx.Data["images"] = result.Payload.ImageInfo | |||
| resultPublic, err := cloudbrain.GetPublicImages() | |||
| if err != nil { | |||
| ctx.Data["error"] = err.Error() | |||
| log.Error("cloudbrain.GetPublicImages failed:", err.Error(), ctx.Data["MsgID"]) | |||
| } | |||
| for i, payload := range resultPublic.Payload.ImageInfo { | |||
| if strings.HasPrefix(resultPublic.Payload.ImageInfo[i].Place, "192.168") { | |||
| resultPublic.Payload.ImageInfo[i].PlaceView = payload.Place[strings.Index(payload.Place, "/"):len(payload.Place)] | |||
| } else { | |||
| resultPublic.Payload.ImageInfo[i].PlaceView = payload.Place | |||
| } | |||
| } | |||
| ctx.Data["public_images"] = resultPublic.Payload.ImageInfo | |||
| //get valid dataset | |||
| attachs, err := models.GetAllUserAttachments(ctx.User.ID) | |||
| if err != nil { | |||
| log.Error("GetAllUserAttachments failed: %v", err, ctx.Data["MsgID"]) | |||
| return err | |||
| } | |||
| ctx.Data["attachments"] = attachs | |||
| ctx.Data["command"] = cloudbrain.Command | |||
| ctx.Data["code_path"] = cloudbrain.CodeMountPath | |||
| ctx.Data["dataset_path"] = cloudbrain.DataSetMountPath | |||
| ctx.Data["model_path"] = cloudbrain.ModelMountPath | |||
| ctx.Data["benchmark_path"] = cloudbrain.BenchMarkMountPath | |||
| ctx.Data["is_benchmark_enabled"] = setting.IsBenchmarkEnabled | |||
| //get valid resource specs | |||
| if categories == nil { | |||
| json.Unmarshal([]byte(setting.BenchmarkCategory), &categories) | |||
| } | |||
| ctx.Data["benchmark_categories"] = categories.Category | |||
| ctx.Data["benchmark_types"] = GetBenchmarkTypes(ctx).BenchmarkType | |||
| if gpuInfos == nil { | |||
| json.Unmarshal([]byte(setting.GpuTypes), &gpuInfos) | |||
| } | |||
| ctx.Data["gpu_types"] = gpuInfos.GpuInfo | |||
| if trainGpuInfos == nil { | |||
| json.Unmarshal([]byte(setting.TrainGpuTypes), &trainGpuInfos) | |||
| } | |||
| ctx.Data["train_gpu_types"] = trainGpuInfos.GpuInfo | |||
| if benchmarkGpuInfos == nil { | |||
| json.Unmarshal([]byte(setting.BenchmarkGpuTypes), &benchmarkGpuInfos) | |||
| } | |||
| ctx.Data["benchmark_gpu_types"] = benchmarkGpuInfos.GpuInfo | |||
| if benchmarkResourceSpecs == nil { | |||
| json.Unmarshal([]byte(setting.BenchmarkResourceSpecs), &benchmarkResourceSpecs) | |||
| } | |||
| ctx.Data["benchmark_resource_specs"] = benchmarkResourceSpecs.ResourceSpec | |||
| if cloudbrain.ResourceSpecs == nil { | |||
| json.Unmarshal([]byte(setting.ResourceSpecs), &cloudbrain.ResourceSpecs) | |||
| } | |||
| ctx.Data["resource_specs"] = cloudbrain.ResourceSpecs.ResourceSpec | |||
| if cloudbrain.TrainResourceSpecs == nil { | |||
| json.Unmarshal([]byte(setting.TrainResourceSpecs), &cloudbrain.TrainResourceSpecs) | |||
| } | |||
| ctx.Data["train_resource_specs"] = cloudbrain.TrainResourceSpecs.ResourceSpec | |||
| branches, _, err := ctx.Repo.GitRepo.GetBranches(0, 0) | |||
| if err != nil { | |||
| log.Error("GetBranches error:", err) | |||
| } | |||
| ctx.Data["branches"] = branches | |||
| ctx.Data["branchName"] = ctx.Repo.BranchName | |||
| return nil | |||
| } | |||
| func GrampusTrainJobNPUNew(ctx *context.Context) { | |||
| err := grampusTrainJobNpuNewDataPrepare(ctx) | |||
| ctx.Data["cloudbraintype"] = models.TypeCloudBrainTwo | |||
| err := grampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeNPU) | |||
| if err != nil { | |||
| ctx.ServerError("get new train-job info failed", err) | |||
| return | |||
| @@ -156,7 +56,7 @@ func GrampusTrainJobNPUNew(ctx *context.Context) { | |||
| ctx.HTML(200, tplGrampusTrainJobNPUNew) | |||
| } | |||
| func grampusTrainJobNpuNewDataPrepare(ctx *context.Context) error { | |||
| func grampusTrainJobNewDataPrepare(ctx *context.Context, processType string) error { | |||
| ctx.Data["PageIsCloudBrain"] = true | |||
| t := time.Now() | |||
| @@ -164,23 +64,32 @@ func grampusTrainJobNpuNewDataPrepare(ctx *context.Context) error { | |||
| ctx.Data["display_job_name"] = displayJobName | |||
| //get valid dataset | |||
| attachs, err := models.GetModelArtsTrainAttachments(ctx.User.ID) | |||
| if err != nil { | |||
| log.Error("GetModelArtsTrainAttachments failed:", err.Error()) | |||
| if processType == grampus.ProcessorTypeNPU { | |||
| attachs, err := models.GetModelArtsTrainAttachments(ctx.User.ID) | |||
| if err != nil { | |||
| log.Error("GetModelArtsTrainAttachments failed:", err.Error()) | |||
| } else { | |||
| ctx.Data["attachments"] = attachs | |||
| } | |||
| } else { | |||
| ctx.Data["attachments"] = attachs | |||
| attachs, err := models.GetAllUserAttachments(ctx.User.ID) | |||
| if err != nil { | |||
| log.Error("GetAllUserAttachments failed: %v", err, ctx.Data["MsgID"]) | |||
| } else { | |||
| ctx.Data["attachments"] = attachs | |||
| } | |||
| } | |||
| //get valid engines | |||
| images, err := grampus.GetImages(grampus.ProcessorTypeNPU) | |||
| //get valid images | |||
| images, err := grampus.GetImages(processType) | |||
| if err != nil { | |||
| log.Error("GetResourceSpecs failed:", err.Error()) | |||
| log.Error("GetImages failed:", err.Error()) | |||
| } else { | |||
| ctx.Data["engine_versions"] = images.Infos | |||
| ctx.Data["images"] = images.Infos | |||
| } | |||
| //get valid resource specs | |||
| specs, err := grampus.GetResourceSpecs(grampus.ProcessorTypeNPU) | |||
| specs, err := grampus.GetResourceSpecs(processType) | |||
| if err != nil { | |||
| log.Error("GetResourceSpecs failed:", err.Error()) | |||
| } else { | |||
| @@ -235,13 +144,13 @@ func GrampusTrainJobNpuCreate(ctx *context.Context, form auth.CreateGrampusTrain | |||
| count, err := models.GetGrampusCountByUserID(ctx.User.ID, string(models.JobTypeTrain), models.NPUResource) | |||
| if err != nil { | |||
| log.Error("GetGrampusCountByUserID failed:%v", err, ctx.Data["MsgID"]) | |||
| grampusTrainJobNpuNewDataPrepare(ctx) | |||
| grampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeNPU) | |||
| ctx.RenderWithErr("system error", tplGrampusTrainJobNPUNew, &form) | |||
| return | |||
| } else { | |||
| if count >= 1 { | |||
| log.Error("the user already has running or waiting task", ctx.Data["MsgID"]) | |||
| grampusTrainJobNpuNewDataPrepare(ctx) | |||
| grampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeNPU) | |||
| ctx.RenderWithErr("you have already a running or waiting task, can not create more", tplGrampusTrainJobNPUNew, &form) | |||
| return | |||
| } | |||
| @@ -250,7 +159,7 @@ func GrampusTrainJobNpuCreate(ctx *context.Context, form auth.CreateGrampusTrain | |||
| //check param | |||
| if err := grampusParamCheckCreateTrainJob(form); err != nil { | |||
| log.Error("paramCheckCreateTrainJob failed:(%v)", err) | |||
| grampusTrainJobNpuNewDataPrepare(ctx) | |||
| grampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeNPU) | |||
| ctx.RenderWithErr(err.Error(), tplGrampusTrainJobNPUNew, &form) | |||
| return | |||
| } | |||
| @@ -260,14 +169,14 @@ func GrampusTrainJobNpuCreate(ctx *context.Context, form auth.CreateGrampusTrain | |||
| if err == nil { | |||
| if len(tasks) != 0 { | |||
| log.Error("the job name did already exist", ctx.Data["MsgID"]) | |||
| grampusTrainJobNpuNewDataPrepare(ctx) | |||
| grampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeNPU) | |||
| ctx.RenderWithErr("the job name did already exist", tplGrampusTrainJobNPUNew, &form) | |||
| return | |||
| } | |||
| } else { | |||
| if !models.IsErrJobNotExist(err) { | |||
| log.Error("system error, %v", err, ctx.Data["MsgID"]) | |||
| grampusTrainJobNpuNewDataPrepare(ctx) | |||
| grampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeNPU) | |||
| ctx.RenderWithErr("system error", tplGrampusTrainJobNPUNew, &form) | |||
| return | |||
| } | |||
| @@ -277,7 +186,7 @@ func GrampusTrainJobNpuCreate(ctx *context.Context, form auth.CreateGrampusTrain | |||
| attachment, err := models.GetAttachmentByUUID(uuid) | |||
| if err != nil { | |||
| log.Error("GetAttachmentByUUID failed:", err.Error(), ctx.Data["MsgID"]) | |||
| grampusTrainJobNpuNewDataPrepare(ctx) | |||
| grampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeNPU) | |||
| ctx.RenderWithErr("dataset is not exist", tplGrampusTrainJobNPUNew, &form) | |||
| return | |||
| } | |||
| @@ -290,7 +199,7 @@ func GrampusTrainJobNpuCreate(ctx *context.Context, form auth.CreateGrampusTrain | |||
| if err := downloadZipCode(ctx, codeLocalPath, branchName); err != nil { | |||
| log.Error("downloadZipCode failed, server timed out: %s (%v)", repo.FullName(), err) | |||
| grampusTrainJobNpuNewDataPrepare(ctx) | |||
| grampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeNPU) | |||
| ctx.RenderWithErr("Create task failed, server timed out", tplGrampusTrainJobNPUNew, &form) | |||
| return | |||
| } | |||
| @@ -298,14 +207,14 @@ func GrampusTrainJobNpuCreate(ctx *context.Context, form auth.CreateGrampusTrain | |||
| //todo: upload code (send to file_server todo this work?) | |||
| if err := obsMkdir(setting.CodePathPrefix + jobName + modelarts.OutputPath); err != nil { | |||
| log.Error("Failed to obsMkdir_output: %s (%v)", repo.FullName(), err) | |||
| grampusTrainJobNpuNewDataPrepare(ctx) | |||
| grampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeNPU) | |||
| ctx.RenderWithErr("Failed to obsMkdir_output", tplGrampusTrainJobNPUNew, &form) | |||
| return | |||
| } | |||
| if err := uploadCodeToObs(codeLocalPath, jobName, ""); err != nil { | |||
| log.Error("Failed to uploadCodeToObs: %s (%v)", repo.FullName(), err) | |||
| grampusTrainJobNpuNewDataPrepare(ctx) | |||
| grampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeNPU) | |||
| ctx.RenderWithErr("Failed to uploadCodeToObs", tplGrampusTrainJobNPUNew, &form) | |||
| return | |||
| } | |||
| @@ -344,7 +253,7 @@ func GrampusTrainJobNpuCreate(ctx *context.Context, form auth.CreateGrampusTrain | |||
| err = grampus.GenerateTrainJob(ctx, req) | |||
| if err != nil { | |||
| log.Error("GenerateTrainJob failed:%v", err.Error()) | |||
| grampusTrainJobNpuNewDataPrepare(ctx) | |||
| grampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeNPU) | |||
| ctx.RenderWithErr(err.Error(), tplGrampusTrainJobNPUNew, &form) | |||
| return | |||
| } | |||
| @@ -1,9 +1,9 @@ | |||
| <div class="dataset-repolink" id="dataset-repolink-init" style="display: none;" data-repolink="{{.RepoLink}}" | |||
| data-cloudranin-type="{{.cloudbraintype}}"></div> | |||
| <div class="inline {{if eq .cloudbraintype 0}} required {{end}} field" id="dataset-base"> | |||
| data-dataset-type="{{.datasetType}}"></div> | |||
| <div class="inline {{if eq .datasetType 0}} required {{end}} field" id="dataset-base"> | |||
| <label>{{.i18n.Tr "dataset.dataset"}}</label> | |||
| <input type="hidden" name="attachment" :value="dataset_uuid"> | |||
| {{if eq .cloudbraintype 0}} | |||
| {{if eq .datasetType 0}} | |||
| <input class="disabled" type="text" :value="dataset_name" placeholder="{{.i18n.Tr "cloudbrain.select_dataset"}}" | |||
| required onfocus="this.blur();"> | |||
| {{else}} | |||
| @@ -18,7 +18,7 @@ | |||
| <input type="text" placeholder="{{.i18n.Tr "dataset.search_dataset"}}" v-model="searchDataItem"> | |||
| </div> | |||
| <el-tabs v-model="activeName" @tab-click="handleClick('{{.RepoLink}}',activeName,{{.cloudbraintype}})"> | |||
| <el-tabs v-model="activeName" @tab-click="handleClick('{{.RepoLink}}',activeName,{{.datasetType}})"> | |||
| <el-tab-pane label="{{.i18n.Tr "dataset.current_project"}}" name="first"> | |||
| <div style="display: flex;align-items: center;justify-content: space-between;padding: 1rem 0;border-bottom:1px solid #F5F5F5" | |||
| v-for="(dataset,index) in currentRepoDataset" :key="index"> | |||
| @@ -1,5 +1,5 @@ | |||
| <div class="dataset-repolink" id="dataset-repolink-init" style="display: none;" data-repolink="{{.RepoLink}}" | |||
| data-cloudranin-type="{{.cloudbraintype}}"></div> | |||
| data-dataset-type="{{.datasetType}}"></div> | |||
| <div class="inline required unite min_title field" id="dataset-base" style="margin-bottom: 0 !important;"> | |||
| {{if or (.benchmarkMode) (.newInference)}} | |||
| <label | |||
| @@ -22,7 +22,7 @@ | |||
| <input type="text" placeholder="{{.i18n.Tr "dataset.search_dataset"}}" v-model="searchDataItem"> | |||
| </div> | |||
| <el-tabs v-model="activeName" @tab-click="handleClick('{{.RepoLink}}',activeName,{{.cloudbraintype}})"> | |||
| <el-tabs v-model="activeName" @tab-click="handleClick('{{.RepoLink}}',activeName,{{.datasetType}})"> | |||
| <el-tab-pane label="{{.i18n.Tr "dataset.current_project"}}" name="first" v-loading="loadingDataIndex"> | |||
| <div style="display: flex;align-items: center;justify-content: space-between;padding: 1rem 0;border-bottom:1px solid #F5F5F5" | |||
| v-for="(dataset,index) in currentRepoDataset" :key="index"> | |||
| @@ -156,29 +156,6 @@ | |||
| </select> | |||
| </div> | |||
| <div class="required unite min_title inline field"> | |||
| <label style="font-weight: normal;">{{.i18n.Tr "cloudbrain.gpu_type"}}</label> | |||
| <select id="cloudbrain_gpu_type" class="ui search width806 dropdown" placeholder="选择GPU类型" style='width:385px' name="gpu_type"> | |||
| {{range .train_gpu_types}} | |||
| <option value="{{.Queue}}">{{.Value}}</option> | |||
| {{end}} | |||
| </select> | |||
| </div> | |||
| <!-- <div class="required unite min_title inline field" style="position: relative;"> | |||
| <label style="font-weight: normal;">{{.i18n.Tr "cloudbrain.mirror"}} </label> | |||
| <input class="width81" type="text" list="cloudbrain_image" placeholder="{{.i18n.Tr "cloudbrain.choose_mirror"}}" name="image" required autofocus maxlength="255"> | |||
| <i class="times circle outline icon icons" style="visibility: hidden;" onclick="clearValue()"></i> | |||
| <datalist class="ui search" id="cloudbrain_image" name="image"> | |||
| {{range .images}} | |||
| <option name="image" value="{{.Place}}">{{.PlaceView}}</option> | |||
| {{end}} | |||
| {{range .public_images}} | |||
| <option name="image" value="{{.Place}}">{{.PlaceView}}</option> | |||
| {{end}} | |||
| </datalist> | |||
| </div> --> | |||
| <div id="images-new-cb"> | |||
| </div> | |||
| @@ -198,7 +175,7 @@ | |||
| {{template "custom/select_dataset_train" .}} | |||
| <span class="tooltips" style="margin-left: 11.5rem;margin-bottom: 2rem;">训练脚本存储在/code中,数据集存储在/dataset中,训练输出请存储在/model中以供后续下载。</span> | |||
| <span class="tooltips" style="margin-left: 11.5rem;margin-bottom: 2rem;">{{.i18n.Tr "repo.grampus.dataset_path_rule"}}</span> | |||
| <div class="inline unite min_title field"> | |||
| <label style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.run_parameter"}}</label> | |||
| <span id="add_run_para" style="margin-left: 0.5rem;cursor:pointer;color: rgba(3, 102, 214, 100);font-size: 14px;line-height: 26px;font-family: SourceHanSansSC-medium;"><i class="plus square outline icon"></i>{{.i18n.Tr "repo.modelarts.train_job.add_run_parameter"}}</span> | |||
| @@ -225,11 +202,11 @@ | |||
| </div> | |||
| </div> | |||
| <div class="required inline unite min_title field"> | |||
| <label style="font-weight: normal;">{{.i18n.Tr "cloudbrain.resource_specification"}}</label> | |||
| <select id="cloudbrain_resource_spec" class="ui search dropdown" placeholder="选择资源规格" style='width:385px' name="resource_spec_id"> | |||
| {{range .train_resource_specs}} | |||
| <option name="resource_spec_id" value="{{.Id}}">GPU数:{{.GpuNum}},CPU数:{{.CpuNum}},内存(MB):{{.MemMiB}},共享内存(MB):{{.ShareMemMiB}}</option> | |||
| <div class="required unite min_title inline field" id="flaver_name"> | |||
| <label style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.standard"}}</label> | |||
| <select class="ui dropdown width81" id="trainjob-flavor" style='width:385px' name="flavor"> | |||
| {{range .flavor_infos}} | |||
| <option name="flavor" value="{{.ID}}">{{.Name}}</option> | |||
| {{end}} | |||
| </select> | |||
| </div> | |||
| @@ -145,19 +145,13 @@ | |||
| </select> | |||
| </div> | |||
| <div class="required unite min_title inline fields" style="width: 90%;"> | |||
| <label style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.AI_driver"}} </label> | |||
| <div class="field" style="flex: 2;" id="engine_name"> | |||
| <select class="ui dropdown width" id="trainjob_engine_versions" style='width: 100%;' name="image_id"> | |||
| {{range .engine_versions}} | |||
| <option name="image_id" value="{{.ID}}">{{.Name}}</option> | |||
| {{end}} | |||
| </select> | |||
| </div> | |||
| <div class="required unite min_title inline field"> | |||
| <label style="font-weight: normal;">{{.i18n.Tr "cloudbrain.mirror"}}</label> | |||
| <select class="ui dropdown width81" id="trainjob_images" name="image_id"> | |||
| {{range .images}} | |||
| <option name="image_id" value="{{.ID}}">{{.Name}}</option> | |||
| {{end}} | |||
| </select> | |||
| </div> | |||
| <div class="inline unite min_title field required"> | |||
| @@ -183,32 +177,6 @@ | |||
| </div> | |||
| </div> | |||
| <div class="required field " style="display: none;"> | |||
| <label style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.resource_pool"}}</label> | |||
| <select class="ui dropdown" id="trainjob_resource_pool" style='width:385px' name="pool_id"> | |||
| {{range .resource_pools}} | |||
| <option value="{{.ID}}">{{.Value}}</option> | |||
| {{end}} | |||
| </select> | |||
| </div> | |||
| <div class="required grouped fields" style="display: none;"> | |||
| <label style="font-weight: normal;" for="resource_type">{{.i18n.Tr "repo.modelarts.train_job.resource_type"}}</label> | |||
| <div class="field"> | |||
| <div class="ui grid"> | |||
| <div class="column"> | |||
| <div class="ui radio checkbox"> | |||
| <input type="radio" name="resource_type" checked="" tabindex="0"> | |||
| </div> | |||
| </div> | |||
| <div class="three wide column">train-private-1</div> | |||
| <div class="three wide column">{{svg "octicon-verified" 16}} 运行中</div> | |||
| <div class="three wide column"> CPU:192 核 2048GiB</div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| <div class="required unite min_title inline field" id="flaver_name"> | |||
| <label style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.standard"}}</label> | |||
| <select class="ui dropdown width81" id="trainjob-flavor" style='width:385px' name="flavor"> | |||
| @@ -3779,7 +3779,7 @@ function initVueDataset() { | |||
| } | |||
| let link = $('#square-link').data('link') | |||
| let repolink = $('.dataset-repolink').data('repolink') | |||
| let cloudbrainType = $('.dataset-repolink').data('cloudranin-type') | |||
| //let datasetType = $('.dataset-repolink').data('cloudranin-type') | |||
| const clearBtn = document.getElementsByClassName("clear_dataset_value"); | |||
| const params = new URLSearchParams(location.search) | |||
| for (let i = 0; i < clearBtn.length; i++) { | |||
| @@ -3864,7 +3864,7 @@ function initVueDataset() { | |||
| page: 1, | |||
| totalnums: 0, | |||
| repolink: '', | |||
| cloudbrainType: 0, | |||
| datasetType: 0, | |||
| dataset_uuid: '', | |||
| dataset_name: '', | |||
| loadingDataIndex: false, | |||
| @@ -3923,8 +3923,9 @@ function initVueDataset() { | |||
| this.getTypeList() | |||
| if (!!document.getElementById('dataset-repolink-init')) { | |||
| this.cloudbrainType = location.href.indexOf('cloudbrain') !== -1 ? 0 : 1 | |||
| this.getCurrentRepoDataset(this.repolink, this.cloudbrainType) | |||
| // this.datasetType = location.href.indexOf('cloudbrain') !== -1 ? 0 : 1 | |||
| this.datasetType = $('#dataset-repolink-init').data("dataset-type") | |||
| this.getCurrentRepoDataset(this.repolink, this.datasetType) | |||
| } | |||
| const params = new URLSearchParams(location.search) | |||
| @@ -3951,7 +3952,7 @@ function initVueDataset() { | |||
| this.licenseLists = licenseLists | |||
| this.descfile = dataset_file_desc | |||
| this.repolink = repolink | |||
| this.cloudbrainType = cloudbrainType | |||
| this.datasetType = datasetType | |||
| }, | |||
| methods: { | |||
| copyUrl(url) { | |||
| @@ -3975,17 +3976,17 @@ function initVueDataset() { | |||
| this.page = val | |||
| switch (this.activeName) { | |||
| case 'first': | |||
| this.getCurrentRepoDataset(this.repolink, this.cloudbrainType) | |||
| this.getCurrentRepoDataset(this.repolink, this.datasetType) | |||
| break | |||
| case 'second': | |||
| this.getMyDataset(this.repolink, this.cloudbrainType) | |||
| this.getMyDataset(this.repolink, this.datasetType) | |||
| break | |||
| case 'third': | |||
| this.getPublicDataset(this.repolink, this.cloudbrainType) | |||
| this.getPublicDataset(this.repolink, this.datasetType) | |||
| break | |||
| case 'fourth': | |||
| this.getStarDataset(this.repolink, this.cloudbrainType) | |||
| this.getStarDataset(this.repolink, this.datasetType) | |||
| break | |||
| } | |||
| @@ -4324,16 +4325,16 @@ function initVueDataset() { | |||
| refreshStatusDataset() { | |||
| switch (this.activeName) { | |||
| case 'first': | |||
| this.getCurrentRepoDataset(this.repolink, this.cloudbrainType) | |||
| this.getCurrentRepoDataset(this.repolink, this.datasetType) | |||
| break | |||
| case 'second': | |||
| this.getMyDataset(this.repolink, this.cloudbrainType) | |||
| this.getMyDataset(this.repolink, this.datasetType) | |||
| break | |||
| case 'third': | |||
| this.getPublicDataset(this.repolink, this.cloudbrainType) | |||
| this.getPublicDataset(this.repolink, this.datasetType) | |||
| break | |||
| case 'fourth': | |||
| this.getStarDataset(this.repolink, this.cloudbrainType) | |||
| this.getStarDataset(this.repolink, this.datasetType) | |||
| break | |||
| } | |||
| }, | |||
| @@ -4435,19 +4436,19 @@ function initVueDataset() { | |||
| switch (this.activeName) { | |||
| case 'first': | |||
| this.page = 1 | |||
| this.getCurrentRepoDataset(this.repolink, this.cloudbrainType) | |||
| this.getCurrentRepoDataset(this.repolink, this.datasetType) | |||
| break | |||
| case 'second': | |||
| this.page = 1 | |||
| this.getMyDataset(this.repolink, this.cloudbrainType) | |||
| this.getMyDataset(this.repolink, this.datasetType) | |||
| break | |||
| case 'third': | |||
| this.page = 1 | |||
| this.getPublicDataset(this.repolink, this.cloudbrainType) | |||
| this.getPublicDataset(this.repolink, this.datasetType) | |||
| break | |||
| case 'fourth': | |||
| this.page = 1 | |||
| this.getStarDataset(this.repolink, this.cloudbrainType) | |||
| this.getStarDataset(this.repolink, this.datasetType) | |||
| break | |||
| } | |||
| } | |||
| @@ -4457,19 +4458,19 @@ function initVueDataset() { | |||
| switch (this.activeName) { | |||
| case 'first': | |||
| this.page = 1 | |||
| this.getCurrentRepoDataset(this.repolink, this.cloudbrainType) | |||
| this.getCurrentRepoDataset(this.repolink, this.datasetType) | |||
| break | |||
| case 'second': | |||
| this.page = 1 | |||
| this.getMyDataset(this.repolink, this.cloudbrainType) | |||
| this.getMyDataset(this.repolink, this.datasetType) | |||
| break | |||
| case 'third': | |||
| this.page = 1 | |||
| this.getPublicDataset(this.repolink, this.cloudbrainType) | |||
| this.getPublicDataset(this.repolink, this.datasetType) | |||
| break | |||
| case 'fourth': | |||
| this.page = 1 | |||
| this.getStarDataset(this.repolink, this.cloudbrainType) | |||
| this.getStarDataset(this.repolink, this.datasetType) | |||
| break | |||
| } | |||
| } | |||