forked from mirrors/amnezia-wg-easy
fix: reload configuration
* run linter * screenshot update
This commit is contained in:
parent
72ba79b5f2
commit
4deca34faf
5 changed files with 13 additions and 14 deletions
|
@ -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',
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -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));
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue