AddAsyncUpload.vue: add asyncupload form

This commit is contained in:
nobohan 2022-02-24 09:05:16 +01:00
parent 5f71b46bb7
commit f19a090549
2 changed files with 35 additions and 4 deletions

View File

@ -13,7 +13,7 @@
</template> </template>
<template v-slot:body> <template v-slot:body>
<div id="dropZoneWrapper"> <div id="dropZoneWrapper" ref="dropZoneWrapper">
<div <div
data-stored-object="data-stored-object" data-stored-object="data-stored-object"
data-label-preparing="Preparing" data-label-preparing="Preparing"
@ -29,6 +29,26 @@
data-dict-remove="Remove existing file" data-dict-remove="Remove existing file"
data-allow-remove="true" data-allow-remove="true"
data-temp-url-generator="url"> data-temp-url-generator="url">
<input
type="hidden"
data-async-file-upload="data-async-file-upload"
data-generate-temp-url-post="/asyncupload/temp_url/generate/post?expires_delay=180&amp;submit_delay=3600"
data-temp-url-get="/asyncupload/temp_url/generate/GET"
:data-max-files="options.maxFiles"
:data-max-post-size="options.maxPostSize"
>
<input
type="hidden"
data-stored-object-key="1"
>
<input
type="hidden"
data-stored-object-iv="1"
>
<input
type="hidden"
data-async-file-type="1"
>
</div> </div>
</div> </div>
</template> </template>
@ -53,6 +73,7 @@ export default {
}, },
props: [ props: [
'buttonTitle', 'buttonTitle',
'options'
], ],
data() { data() {
return { return {
@ -62,12 +83,17 @@ export default {
}, },
} }
}, },
updated() {
if (this.modal.showModal){
searchForZones(this.$refs.dropZoneWrapper);
}
},
// mounted() {
// console.log(this.options)
// },
methods: { methods: {
openModal() { openModal() {
this.modal.showModal = true; this.modal.showModal = true;
let dropZoneWrapper = document.getElementById('dropZoneWrapper');
console.log(dropZoneWrapper)
searchForZones(document); //TODO: only searchforzone in modal body
}, },
} }
} }

View File

@ -106,6 +106,7 @@
<li> <li>
<add-async-upload <add-async-upload
:buttonTitle="$t('browse')" :buttonTitle="$t('browse')"
:options="asyncUploadOptions"
> >
</add-async-upload> </add-async-upload>
</li> </li>
@ -163,6 +164,10 @@ export default {
return { return {
editor: ClassicEditor, editor: ClassicEditor,
template: null, template: null,
asyncUploadOptions: {
maxFiles: 1,
maxPostSize: 15000000
}
} }
}, },
computed: { computed: {