mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 08:17:09 +00:00
Add option to upload the configuration to the server
This commit is contained in:
@@ -139,6 +139,19 @@
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
|
||||
<v-spacer></v-spacer>
|
||||
|
||||
<v-btn
|
||||
class="ml-2"
|
||||
color="warning"
|
||||
:disabled="!configuration"
|
||||
title="Save the configuration on the server. This will replace the existing configuration. The project will be set to INACTIVE. Change its state back to active once you're satisfied with your changes."
|
||||
@click="upload"
|
||||
>
|
||||
<v-icon small left>mdi-cloud-upload</v-icon>
|
||||
Upload
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-col>
|
||||
@@ -577,8 +590,23 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
upload () {
|
||||
console.log("UPLOAD");
|
||||
async upload () {
|
||||
const url = `/project/${this.$route.params.project}/configuration`;
|
||||
const init = {
|
||||
method: "PUT",
|
||||
headers: {
|
||||
//"If-Match": "" // Ensure we're not overwriting someone else's changes
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: {...this.configuration, archived: true}
|
||||
};
|
||||
const res = await this.api([url, init]);
|
||||
if (res && res.id == this.configuration.id) {
|
||||
// In case the server decided to apply any changes
|
||||
this.showSnack(["Configuration uploaded to server", "success"]);
|
||||
this.$nextTick( () => this.configuration = res );
|
||||
}
|
||||
},
|
||||
|
||||
async loadFromFile () {
|
||||
if (!this.fileInputErrors.length) {
|
||||
|
||||
Reference in New Issue
Block a user