|
|
|
|
@ -4,6 +4,7 @@
|
|
|
|
|
<div class="upload-dashboard">
|
|
|
|
|
<va-file-upload dropzone type="single" @file-added="handleFile"></va-file-upload>
|
|
|
|
|
</div>
|
|
|
|
|
<va-modal v-model="showModal" :message="result.message" :title="result.status" hide-default-actions />
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
@ -26,9 +27,24 @@ export default {
|
|
|
|
|
.then(res => res.json())
|
|
|
|
|
.then(data => this.response = data)
|
|
|
|
|
.catch((e) => console.log(e))
|
|
|
|
|
.then(()=>console.log(this.response))
|
|
|
|
|
.then(()=>this.showModal=!this.showModal)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
|
result(){
|
|
|
|
|
if (this.response.status === "Success") {
|
|
|
|
|
return {
|
|
|
|
|
status: "Success!",
|
|
|
|
|
message: `Accepted: ${this.response.accepted}\nProcessed: ${this.response.processed}\nProcessing time ${this.response.process_time}`
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
return {
|
|
|
|
|
status: "Failure!",
|
|
|
|
|
message: this.response.detail
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|