4
0
mirror of https://github.com/AzuraCast/AzuraCast.git synced 2024-06-13 12:46:41 +00:00
AzuraCast/frontend/vue/components/Stations/Media/FileUpload.vue
2022-06-06 04:06:28 -05:00

50 lines
1.1 KiB
Vue

<template>
<flow-upload :target-url="uploadUrl" :flow-configuration="flowConfiguration"
:valid-mime-types="validMimeTypes" allow-multiple
@complete="onFlowUpload" @error="onFlowUpload">
</flow-upload>
</template>
<script>
import FlowUpload from '~/components/Common/FlowUpload';
export default {
name: 'FileUpload',
components: {FlowUpload},
props: {
uploadUrl: String,
currentDirectory: String,
searchPhrase: String,
validMimeTypes: {
type: Array,
default() {
return ['audio/*'];
}
}
},
data() {
return {
flow: null,
files: []
};
},
computed: {
flowConfiguration() {
return {
query: () => {
return {
'currentDirectory': this.currentDirectory,
'searchPhrase': this.searchPhrase
};
}
};
}
},
methods: {
onFlowUpload() {
this.$emit('relist');
}
}
};
</script>