upload nextcloud data from UI

This commit is contained in:
Hayden
2021-01-09 18:55:26 -09:00
parent af87045037
commit 082448c6dc
4 changed files with 126 additions and 6 deletions

View File

@@ -0,0 +1,42 @@
<template>
<v-form ref="file">
<v-file-input
:loading="loading"
label="Upload an Archive"
v-model="file"
accept=".zip"
@change="upload"
>
</v-file-input>
</v-form>
</template>
<script>
import api from "../../../api";
export default {
data() {
return {
file: null,
loading: false,
};
},
methods: {
async upload() {
if (this.file != null) {
this.loading = true;
let formData = new FormData();
formData.append("archive", this.file);
await api.migrations.uploadFile(formData);
this.loading = false;
this.$emit("uploaded");
this.file = null;
}
},
},
};
</script>
<style>
</style>