Philip H.
3 years ago
committed by
Julien COSMAO
No known key found for this signature in database
GPG Key ID: 69153421048939E2
2 changed files with
3 additions and
3 deletions
-
src/lib/WireGuard.js
-
src/www/js/app.js
|
|
@ -240,11 +240,11 @@ Endpoint = ${WG_HOST}:${WG_CONFIG_PORT}`; |
|
|
|
|
|
|
|
|
let address; |
|
|
let address; |
|
|
if (allowedIps) { |
|
|
if (allowedIps) { |
|
|
address = allowedIps |
|
|
address = allowedIps; |
|
|
} else { |
|
|
} else { |
|
|
// Calculate next IP
|
|
|
// Calculate next IP
|
|
|
for (let i = 2; i < 255; i++) { |
|
|
for (let i = 2; i < 255; i++) { |
|
|
const client = Object.values(config.clients).find(client => { |
|
|
const client = Object.values(config.clients).find((client) => { |
|
|
return client.address.includes(WG_DEFAULT_ADDRESS.replace('x', i)); |
|
|
return client.address.includes(WG_DEFAULT_ADDRESS.replace('x', i)); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
@ -273,7 +273,7 @@ new Vue({ |
|
|
if (!name) return; |
|
|
if (!name) return; |
|
|
|
|
|
|
|
|
this.api.createClient({ name, allowedIps }) |
|
|
this.api.createClient({ name, allowedIps }) |
|
|
.catch(err => alert(err.message || err.toString())) |
|
|
.catch((err) => alert(err.message || err.toString())) |
|
|
.finally(() => this.refresh().catch(console.error)); |
|
|
.finally(() => this.refresh().catch(console.error)); |
|
|
}, |
|
|
}, |
|
|
deleteClient(client) { |
|
|
deleteClient(client) { |
|
|
|