Browse Source

fix issue

tags/v1.22.3.2^2
zhoupzh 3 years ago
parent
commit
4183abf184
6 changed files with 31 additions and 15 deletions
  1. +1
    -1
      templates/repo/attachment/edit.tmpl
  2. +1
    -1
      templates/repo/datasets/create.tmpl
  3. +1
    -1
      templates/repo/datasets/edit.tmpl
  4. +9
    -3
      templates/repo/datasets/index.tmpl
  5. +6
    -1
      web_src/js/components/MinioUploader.vue
  6. +13
    -8
      web_src/js/index.js

+ 1
- 1
templates/repo/attachment/edit.tmpl View File

@@ -32,7 +32,7 @@
</el-form-item>
<el-form-item>
<el-button style="background-color: #21ba45;" type="success" @click="editDatasetFile({{.Attachment.ID}})">确定</el-button>
<el-button type="info" @click="cancelDataset">取消</el-button>
<el-button type="info" @click="cancelDataset('',)">取消</el-button>
</el-form-item>
</el-form>


+ 1
- 1
templates/repo/datasets/create.tmpl View File

@@ -58,7 +58,7 @@
</el-form-item>
<el-form-item>
<el-button style="background-color: #21ba45;" type="success" @click="createDataset('ruleForm')">确定</el-button>
<el-button type="info" @click="cancelDataset('create')">取消</el-button>
<el-button type="info" @click="cancelDataset('create','')">取消</el-button>
</el-form-item>
</el-form>
</div>


+ 1
- 1
templates/repo/datasets/edit.tmpl View File

@@ -58,7 +58,7 @@
</el-form-item>
<el-form-item>
<el-button style="background-color: #21ba45;" type="success" @click="editDataset('ruleForm',{{.Dataset.ID}})">确定</el-button>
<el-button type="info" @click="cancelDataset('edit')">取消</el-button>
<el-button type="info" @click="cancelDataset('edit','')">取消</el-button>
</el-form-item>
</el-form>
</div>


+ 9
- 3
templates/repo/datasets/index.tmpl View File

@@ -112,11 +112,17 @@
<div class="column thirteen wide"><h2>{{.dataset.Title}}</h2></div>
<div class="column three wide right aligned">
<span style="display: flex;align-items: center;justify-content: flex-end;height: 36px;">
{{if $.IsSigned}}
<div style="line-height: 1;margin-right: 4px;margin-bottom: -2px;padding: 0 10px;" @click="postStar({{.dataset.ID}},'{{.Link}}')">
<svg width="1.4em" height="1.4em" viewBox="0 0 32 32" class="heart-stroke" :class='{stars_active:star_active}'><path d="M4.4 6.54c-1.761 1.643-2.6 3.793-2.36 6.056.24 2.263 1.507 4.521 3.663 6.534a29110.9 29110.9 0 0010.296 9.633l10.297-9.633c2.157-2.013 3.424-4.273 3.664-6.536.24-2.264-.599-4.412-2.36-6.056-1.73-1.613-3.84-2.29-6.097-1.955-1.689.25-3.454 1.078-5.105 2.394l-.4.319-.398-.319c-1.649-1.316-3.414-2.143-5.105-2.394a7.612 7.612 0 00-1.113-.081c-1.838 0-3.541.694-4.983 2.038z"></path></svg>
</div>
<svg width="1.4em" height="1.4em" viewBox="0 0 32 32" class="heart-stroke" :class='{stars_active:star_active}'><path d="M4.4 6.54c-1.761 1.643-2.6 3.793-2.36 6.056.24 2.263 1.507 4.521 3.663 6.534a29110.9 29110.9 0 0010.296 9.633l10.297-9.633c2.157-2.013 3.424-4.273 3.664-6.536.24-2.264-.599-4.412-2.36-6.056-1.73-1.613-3.84-2.29-6.097-1.955-1.689.25-3.454 1.078-5.105 2.394l-.4.319-.398-.319c-1.649-1.316-3.414-2.143-5.105-2.394a7.612 7.612 0 00-1.113-.081c-1.838 0-3.541.694-4.983 2.038z"></path></svg>
</div>
<span style="line-height: 1;">${num_stars}</span>
{{else}}
<div style="line-height: 1;margin-right: 4px;margin-bottom: -2px;padding: 0 10px;">
<svg width="1.4em" height="1.4em" viewBox="0 0 32 32" class="heart-stroke" :class='{stars_active:star_active}'><path d="M4.4 6.54c-1.761 1.643-2.6 3.793-2.36 6.056.24 2.263 1.507 4.521 3.663 6.534a29110.9 29110.9 0 0010.296 9.633l10.297-9.633c2.157-2.013 3.424-4.273 3.664-6.536.24-2.264-.599-4.412-2.36-6.056-1.73-1.613-3.84-2.29-6.097-1.955-1.689.25-3.454 1.078-5.105 2.394l-.4.319-.398-.319c-1.649-1.316-3.414-2.143-5.105-2.394a7.612 7.612 0 00-1.113-.081c-1.838 0-3.541.694-4.983 2.038z"></path></svg>
</div>
<span style="line-height: 1;">${num_stars}</span>
{{end}}
<a style="margin-left:30px;" href="{{.RepoLink}}/datasets/edit/{{.dataset.ID}}" class="ui primary basic mini {{if not $.CanWrite}} disabled {{end}} button">修改</a>
</span>
</div>


+ 6
- 1
web_src/js/components/MinioUploader.vue View File

@@ -9,7 +9,7 @@
<strong class="success text red">{{ status }}</strong>
</p>
<el-button style="background-color: #21ba45;" type="success" :disabled="btnFlag" @click="onFileAdded">上传</el-button>
<el-button type="info" @click="cancelDataset">取消</el-button>
<el-button type="info" @click="cancelDataset('',backurl)">取消</el-button>
<!-- <p>说明:<br>
- 只有zip格式的数据集才能发起云脑任务;<br>
- 云脑1提供 <span class="text blue">CPU / GPU</span> 资源,云脑2提供 <span class="text blue">Ascend NPU</span> 资源;调试使用的数据集也需要上传到对应的环境。</p> -->
@@ -37,6 +37,10 @@ export default {
desc:{
type:String,
default:''
},
backurl:{
type:String,
default:''
}
},
data() {
@@ -56,6 +60,7 @@ export default {
},

async mounted() {
console.log(this.backurl)
this.dropzoneParams = $('div#minioUploader-params');
this.file_status_text = this.dropzoneParams.data('file-status');
this.status = this.dropzoneParams.data('file-init-status');


+ 13
- 8
web_src/js/index.js View File

@@ -3838,13 +3838,18 @@ function initVueDataset() {
}
})
},
cancelDataset(getpage){
if(getpage==='create'){
location.href = this.url.split('/create')[0]+'?type=-1'
}else if(getpage==='edit'){
location.href = this.url.split('/edit')[0]+'?type=-1'
}else{
location.href='/'
cancelDataset(getpage,attachment){
if(getpage && !attachment){
if(getpage==='create'){
location.href = this.url.split('/create')[0]+'?type=-1'
}else if(getpage==='edit'){
location.href = this.url.split('/edit')[0]+'?type=-1'
}else{
location.href='/'
}
}
else{
console.log(attachment)
}
},
@@ -3929,7 +3934,7 @@ function initVueDataset() {
let url = '/attachments/edit'
const params={id:id,description:this.descfile}
// document.getElementById("mask").style.display = "block"
this.$axios.post(url,params).then((res)=>{
this.$axios.post(url,this.qs.stringify(params)).then((res)=>{
console.log(res)
})
},


Loading…
Cancel
Save