From bca8cea1563e58dc3756dfe26b4ddf4c68ce74b8 Mon Sep 17 00:00:00 2001 From: zhoupzh Date: Wed, 16 Mar 2022 13:27:56 +0800 Subject: [PATCH] fix issue --- templates/repo/attachment/edit.tmpl | 139 +++++++++------------------- templates/repo/cloudbrain/new.tmpl | 28 ++++++ templates/repo/datasets/index.tmpl | 10 +- web_src/js/index.js | 72 ++++++++++++-- 4 files changed, 145 insertions(+), 104 deletions(-) diff --git a/templates/repo/attachment/edit.tmpl b/templates/repo/attachment/edit.tmpl index 8e8370fb3..53ae9b265 100644 --- a/templates/repo/attachment/edit.tmpl +++ b/templates/repo/attachment/edit.tmpl @@ -1,98 +1,49 @@ - - {{template "base/head" .}} -
- {{template "repo/header" .}} -
- -
-

- 上传数据集文件 -

-
-
- - {{.CsrfTokenHtml}} - - CPU/GPU - NPU - - - - - - - - - - - - - - - - -
-
-
-
-
-
- -

说明:

-

只有zip格式的数据集才能发起云脑任务;
- 云脑1提供CPU / GPU资源,云脑2提供Ascend NPU资源;调试使用的数据集也需要上传到对应的环境;

- +
+
+
+
+
+
+
+
+
+{{template "base/head" .}} +
+{{template "repo/header" .}} +
+ +
+

+ 修改数据集文件描述 +

+
+
+ + {{.CsrfTokenHtml}} + + NPU + + + + {{.Attachment.Name}} + + + + + + 确定 + 取消 + + + +
+
- {{template "base/footer" .}} - \ No newline at end of file diff --git a/templates/repo/cloudbrain/new.tmpl b/templates/repo/cloudbrain/new.tmpl index 744eaca0d..c8a93ee8f 100755 --- a/templates/repo/cloudbrain/new.tmpl +++ b/templates/repo/cloudbrain/new.tmpl @@ -216,7 +216,34 @@ :visible.sync="dialogVisible" width="50%" > +
+ + +
+ + + +
+
+
asdasd
+
asdasdsd
+
+
+ +
+
+
+ + + + + + + + + +
@@ -362,5 +389,6 @@ selected_value = $("#cloudbrain_benchmark_category").val() $('#store_category').attr("value", selected_value) }) + console.log({{.RepoLink}}) \ No newline at end of file diff --git a/templates/repo/datasets/index.tmpl b/templates/repo/datasets/index.tmpl index 60d248e60..6d76bb2f2 100755 --- a/templates/repo/datasets/index.tmpl +++ b/templates/repo/datasets/index.tmpl @@ -190,9 +190,17 @@
diff --git a/web_src/js/index.js b/web_src/js/index.js index 36692d8f0..a19613d23 100755 --- a/web_src/js/index.js +++ b/web_src/js/index.js @@ -3696,7 +3696,10 @@ function initVueDataset() { $('#task-square-range-value').find('.item').each(function(){ licenseLists.push($(this).data('license')) }) - + let dataset_file_desc + if(document.getElementById('dataset-file-desc')){ + dataset_file_desc = document.getElementById('dataset-file-desc').value + } // getEditInit(){ // if($('#dataset-edit-value')){ @@ -3717,6 +3720,7 @@ function initVueDataset() { url:'', type:0, desc:'', + descfile:'', datasetType:'', privates:[], starItems:[], @@ -3731,6 +3735,7 @@ function initVueDataset() { num_stars:0, dialogVisible:false, activeName: 'first', + currentRepoDataset:[], ruleForm:{ title:'', description:'', @@ -3791,6 +3796,7 @@ function initVueDataset() { // // this.getEditInit() // this.getTypeList() + this.getTypeList() }, created(){ @@ -3802,11 +3808,12 @@ function initVueDataset() { this.star_active = star_active this.ruleForm1 = ruleForm // this.getEditInit() - this.getTypeList() + this.starItems = starItems this.starActives = starActives this.taskLists = taskLists this.licenseLists = licenseLists + this.descfile = dataset_file_desc }, methods:{ createDataset(formName){ @@ -3917,6 +3924,15 @@ function initVueDataset() { }) }, + editDatasetFile(id){ + console.log(id) + let url = '/attachments/edit' + const params={id:id,description:this.descfile,_csrf:csrf} + // document.getElementById("mask").style.display = "block" + this.$axios.post(url,params).then((res)=>{ + console.log(res) + }) + }, postStar(id,link){ console.log(id,link) if(this.star_active){ @@ -3968,10 +3984,15 @@ function initVueDataset() { console.log("init---",window.location.search && params.has('type')) if( window.location.search && params.has('type')){ if(params.get('type')==0){ + console.log(0) this.datasetType = '0' - } else if(params.get('type')==1){ + } + if(params.get('type')==1){ + console.log(1) this.datasetType = '1' - }else{ + } + if(params.get('type')==-1){ + console.log(-1) this.datasetType = '-1' } }else { @@ -3985,7 +4006,8 @@ function initVueDataset() { if (!window.location.search) { window.location.href = window.location.href + '?type='+val } else if (searchParams.has('type')) { - window.location.href = window.location.href.replace(/type=[0-9]/g,'type='+val) + console.log("=========",window.location.href.replace(/type=([0-9]|-[0-9])/g,'type='+val)) + window.location.href = window.location.href.replace(/type=([0-9]|-[0-9])/g,'type='+val) } else { window.location.href=window.location.href+'&type='+val } @@ -3996,9 +4018,41 @@ function initVueDataset() { location.href = `/attachments/edit/${id}` }, - handleClick(tab, event) { - console.log(tab, event); - } + handleClick(repoLink, tabName,type) { + if(tabName=="first"){ + this.getCurrentRepoDataset(repoLink,type) + } + if(tabName=="second"){ + this.getMyDataset(repoLink,type) + } + if(tabName=="third"){ + this.getPublicDataset(repoLink,type) + } + if(tabName=="fourth"){ + this.getStarDataset(repoLink),type + } + }, + getCurrentRepoDataset(repoLink,type){ + let url = repoLink + '/datasets/current_repo' + this.$axios.get(url,{ + params:{ + type:type + } + }).then((res)=>{ + console.log(res) + console.log(JSON.parse(res.data.data)) + }) + }, + getMyDataset(){ + + }, + getPublicDataset(){ + + }, + getStarDataset(){ + + }, + @@ -4612,4 +4666,4 @@ function initcreateRepo(){ }); } -initcreateRepo() +initcr \ No newline at end of file