Single Config-file Upload Support (#150)

Allow a single .json config file to be uploaded.
This commit is contained in:
Chris Gerth
2020-11-07 19:21:07 -06:00
committed by GitHub
parent 8109a2a437
commit bf7c9fea44
4 changed files with 111 additions and 16 deletions

View File

@@ -115,7 +115,7 @@
<input
ref="importSettings"
type="file"
accept=".zip"
accept=".zip, .json"
style="display: none;"
@change="readImportedSettings"
@@ -184,11 +184,23 @@ export default {
text: "Settings imported successfully! Program will now exit...",
};
this.snack = true;
}).catch(() => {
this.snackbar = {
color: "success",
text: "Settings imported successfully! Program will now exit...",
};
}).catch(err => {
if (err.response) {
this.snackbar = {
color: "error",
text: "Error while uploading settings file! Could not process provided file.",
};
} else if (err.request) {
this.snackbar = {
color: "error",
text: "Error while uploading settings file! No respond to upload attempt.",
};
} else {
this.snackbar = {
color: "error",
text: "Error while uploading settings file!",
};
}
this.snack = true;
});
},