-
- {{if .dataset.Title}}
- {{.dataset.Title}}
+ {{if .dataset.Task}}
+ {{.dataset.Task}}
{{end}}
{{if .dataset.Category}}
{{.dataset.Category}}
@@ -304,4 +305,5 @@ $('#dataset-range-value').find('.item').each(function(){
items.push($(this).data('private'))
})
console.log(items)
+console.log({{$.IsStaringDataset}})
\ No newline at end of file
diff --git a/web_src/js/components/MinioUploader.vue b/web_src/js/components/MinioUploader.vue
index ff4a73a2a..7daec7512 100755
--- a/web_src/js/components/MinioUploader.vue
+++ b/web_src/js/components/MinioUploader.vue
@@ -311,6 +311,7 @@ export default {
},
async newMultiUpload(file) {
+ console.log(this.uploadtype,this)
const res = await axios.get('/attachments/new_multipart', {
params: {
totalChunkCounts: file.totalChunkCounts,
@@ -335,6 +336,7 @@ export default {
fileReader = new FileReader(),
time = new Date().getTime();
let currentChunk = 0;
+ let _this = this
function loadNext() {
const start = currentChunk * chunkSize;
@@ -358,7 +360,7 @@ export default {
uploadID: file.uploadID,
size: partSize,
chunkNumber: currentChunk + 1,
- type: this.uploadtype,
+ type: _this.uploadtype,
_csrf: csrf
}
});
@@ -373,13 +375,16 @@ export default {
}
async function uploadMinioNewMethod(url,e){
+ console.log(_this.uploadtype,url,e)
var xhr = new XMLHttpRequest();
xhr.open('PUT', url, false);
xhr.setRequestHeader('Content-Type', 'text/plain')
- xhr.send(e.target.result);
- var etagValue = xhr.getResponseHeader('etag');
- //console.log(etagValue);
- etags[currentChunk] = etagValue;
+ xhr.send(e.target.result);
+ if(_this.uploadtype===0){
+ var etagValue = xhr.getResponseHeader('etag');
+ etags[currentChunk] = etagValue;
+ }
+
}
async function updateChunk(currentChunk) {
@@ -424,6 +429,7 @@ export default {
}
async function completeUpload() {
+ console.log(_this.uploadtype)
return await axios.post(
'/attachments/complete_multipart',
qs.stringify({
@@ -432,9 +438,9 @@ export default {
file_name: file.name,
size: file.size,
dataset_id: file.datasetId,
- type: this.uploadtype,
+ type: _this.uploadtype,
_csrf: csrf,
- description:this.desc
+ description:_this.desc
})
);
}
diff --git a/web_src/js/index.js b/web_src/js/index.js
index 5c595b47a..178c8bd67 100755
--- a/web_src/js/index.js
+++ b/web_src/js/index.js
@@ -3669,6 +3669,7 @@ function initVueDataset() {
items.push($(this).data('private'))
})
let num_stars = $('#dataset-range-value').data('num-stars')
+ let star_active = $('#dataset-range-value').data('star-active')
const ruleForm = {}
if(document.getElementById('dataset-edit-value')){
let $this = $('#dataset-edit-value')
@@ -3678,6 +3679,7 @@ function initVueDataset() {
ruleForm.task = $this.data('edit-task') || ''
ruleForm.license = $this.data('edit-license') || ''
ruleForm.id = $this.data('edit-id')|| ''
+ ruleForm._csrf = csrf
}
console.log(ruleForm)
// getEditInit(){
@@ -3710,7 +3712,16 @@ function initVueDataset() {
task:'',
license:'',
_csrf:csrf,
- id:'',
+
+ },
+ ruleForm1:{
+ title:'',
+ description:'',
+ category:'',
+ task:'',
+ license:'',
+ _csrf:'',
+ id:''
},
rules: {
title: [
@@ -3749,7 +3760,9 @@ function initVueDataset() {
}
this.privates = items
this.num_stars = num_stars
- this.ruleForm = ruleForm
+ this.star_active = star_active
+ this.ruleForm1 = ruleForm
+
// this.getEditInit()
},
@@ -3840,7 +3853,7 @@ function initVueDataset() {
this.$refs[formName].validate((valid)=>{
if(valid){
document.getElementById("mask").style.display = "block"
- _this.$axios.post(_this.url,_this.qs.stringify(_this.ruleForm)).then((res)=>{
+ _this.$axios.post(_this.url,_this.qs.stringify(_this.ruleForm1)).then((res)=>{
if(res.data.Code===0){
document.getElementById("mask").style.display = "none"
location.href = _this.url.split('/edit')[0]+'?type=-1'
@@ -3858,8 +3871,27 @@ function initVueDataset() {
})
},
- postStar(id,link){
- console.log(id,link)
+ postStar(id,link,IsStaringDataset){
+ console.log(id,link,IsStaringDataset)
+ if(IsStaringDataset){
+ let url = link+'/'+ id + '/unstar'
+ this.$axios.put(url).then((res)=>{
+ console.log(res)
+ if(res.Code===0){
+ this.num_stars = this.num_stars + 1
+ }
+ })
+ }else{
+ let url = link+'/'+ id + '/star'
+ this.$axios.put(url).then((res)=>{
+ console.log(res)
+ this.star_active = true
+ if(res.Code===0){
+ this.num_stars = this.num_stars + 1
+ }
+
+ })
+ }
}