Skip to content

Commit

Permalink
Merge pull request #131 from biothings/dummy-uploader-fix
Browse files Browse the repository at this point in the history
Fixed dummy uploader
  • Loading branch information
DylanWelzel authored Feb 2, 2024
2 parents fad60e3 + 7116f41 commit 63e5068
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
8 changes: 6 additions & 2 deletions webapp/src/BaseDataSource.vue
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,14 @@ export default {
console.log('Error getting job manager information: ' + err)
})
},
upload: function (subsrc = null) {
upload: function (subsrc = null, release = null){
var srcname = this.source.name
if (subsrc != null) { srcname += '.' + subsrc } // upload a sub-source only
axios.put(axios.defaults.baseURL + `/source/${srcname}/upload`)
let payload = {};
if (release && release.trim() !== '') {
payload.release = release;
}
axios.put(axios.defaults.baseURL + `/source/${srcname}/upload`, payload)
.then(response => {
console.log(response.data.result)
})
Expand Down
9 changes: 5 additions & 4 deletions webapp/src/DataSourceUpload.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@
<div :class="['ui upload form',actionable,subsrc]">
<div class="fields">
<div class="required ten wide field">
<input type="text" id="release" placeholder="Specify a release (optional)" autofocus v-if="info.uploader.dummy">
<input type="text" id="release" placeholder="Specify a release" autofocus v-if="info.uploader.dummy" v-model="release">
</div>
<div class="required six wide field">
<button :class="['ui labeled small icon button',info.status == 'uploading' ? 'disabled' : '']" @click="do_upload(subsrc)">
<button :class="['ui labeled small icon button',info.status == 'uploading' ? 'disabled' : '']" @click="do_upload(subsrc, release)">
<i class="database icon"></i>
Upload
</button>
Expand Down Expand Up @@ -164,6 +164,7 @@ export default {
data () {
return {
metadataCompareData: [],
release: null
}
},
methods: {
Expand All @@ -175,8 +176,8 @@ export default {
self.do_update_source_meta(subsrc, false)
})
},
do_upload: function (subsrc = null) {
return this.$parent.upload(subsrc = subsrc)
do_upload: function (subsrc = null, release = null) {
return this.$parent.upload(subsrc = subsrc, release = release)
},
do_update_source_meta: function(subsrc=null, dry=true) {
const self = this
Expand Down

0 comments on commit 63e5068

Please sign in to comment.