fix: reload configuration

* run linter
* screenshot update
This commit is contained in:
tetuaoro 2024-07-09 18:53:54 +02:00
parent 72ba79b5f2
commit 4deca34faf
5 changed files with 13 additions and 14 deletions

View file

@ -141,15 +141,15 @@ class API {
async uploadConfiguration(file) {
return this.call({
method: 'put',
path: `/wireguard/upload`,
body: { file }
path: '/wireguard/upload',
body: { file },
});
}
async downloadConfiguration() {
return this.call({
method: 'get',
path: `/wireguard/dl`,
path: '/wireguard/dl',
});
}

View file

@ -303,12 +303,9 @@ new Vue({
e.preventDefault();
const file = e.currentTarget.files.item(0);
file.text()
.then(content => {
.then((content) => {
this.api.uploadConfiguration(content)
.then((_result) => {
alert("The configuration was updated.");
document.location.reload();
})
.then((_result) => alert('The configuration was updated.'))
.catch((err) => alert(err.message || err.toString()))
.finally(() => this.refresh().catch(console.error));
})