-
⋅
-
⋅
-
⋅
-
/
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{$t("allowedIPs")}}
+
+
+
-
-
-
-
+
+
+
+
+
diff --git a/src/www/js/api.js b/src/www/js/api.js
index 242f505d..a32bfbf1 100644
--- a/src/www/js/api.js
+++ b/src/www/js/api.js
@@ -93,11 +93,11 @@ class API {
})));
}
- async createClient({ name, allowedIps }) {
+ async createClient({ name }) {
return this.call({
method: 'post',
path: '/wireguard/client',
- body: { name, allowedIps },
+ body: { name },
});
}
diff --git a/src/www/js/app.js b/src/www/js/app.js
index 954159d1..9631da77 100644
--- a/src/www/js/app.js
+++ b/src/www/js/app.js
@@ -59,13 +59,12 @@ new Vue({
clientDelete: null,
clientCreate: null,
clientCreateName: '',
- clientCreateAllowedIps: '',
clientEditName: null,
clientEditNameId: null,
clientEditAddress: null,
clientEditAddressId: null,
clientEditAllowedIPs: null,
- userInputIP: [0, 0, 0, 0, 0],
+ userInputIP: [],
qrcode: null,
currentRelease: null,
@@ -271,10 +270,9 @@ new Vue({
},
createClient() {
const name = this.clientCreateName;
- const allowedIps = this.clientCreateAllowedIps;
if (!name) return;
- this.api.createClient({ name, allowedIps })
+ this.api.createClient({ name })
.catch((err) => alert(err.message || err.toString()))
.finally(() => this.refresh().catch(console.error));
},
@@ -324,13 +322,19 @@ new Vue({
.catch((err) => alert(err.message || err.toString()))
.finally(() => this.refresh().catch(console.error));
},
+ handleKeyDown(event, key, nextInputRef) {
+ if (event.key === key) {
+ event.preventDefault();
+ this.$refs[nextInputRef].focus();
+ }
+ },
addNewIP() {
const address = this.userInputIP.slice(0, 4).join('.');
const allowedIPs = [...this.clientEditAllowedIPs.allowedIPs];
const obj = { type: 'ipv4', address, cidr: this.userInputIP[4] };
allowedIPs.push(obj);
this.clientEditAllowedIPs.allowedIPs = allowedIPs;
- this.userInputIP = [0, 0, 0, 0, 0];
+ this.userInputIP = [];
},
removeIP(index) {
const allowedIPs = [...this.clientEditAllowedIPs.allowedIPs];
diff --git a/src/www/js/i18n.js b/src/www/js/i18n.js
index 3b616e4c..76b61fd2 100644
--- a/src/www/js/i18n.js
+++ b/src/www/js/i18n.js
@@ -34,6 +34,8 @@ const messages = { // eslint-disable-line no-unused-vars
backup: 'Backup',
titleRestoreConfig: 'Restore your configuration',
titleBackupConfig: 'Backup your configuration',
+ editAllowedIPs: 'Edit server AllowedIPs parameter',
+ allowedIPs: 'Server AllowedIPs',
},
ua: {
name: 'Ім`я',
@@ -174,14 +176,14 @@ const messages = { // eslint-disable-line no-unused-vars
fr: { // github.com/clem3109
name: 'Nom',
password: 'Mot de passe',
- signIn: 'Se Connecter',
+ signIn: 'Se connecter',
logout: 'Se déconnecter',
updateAvailable: 'Une mise à jour est disponible !',
update: 'Mise à jour',
clients: 'Clients',
new: 'Nouveau',
deleteClient: 'Supprimer ce client',
- deleteDialog1: 'Êtes-vous que vous voulez supprimer',
+ deleteDialog1: 'Êtes-vous sûr de vouloir supprimer ?',
deleteDialog2: 'Cette action ne peut pas être annulée.',
cancel: 'Annuler',
create: 'Créer',
@@ -193,7 +195,7 @@ const messages = { // eslint-disable-line no-unused-vars
disableClient: 'Désactiver ce client',
enableClient: 'Activer ce client',
noClients: 'Aucun client pour le moment.',
- showQR: 'Afficher le code à réponse rapide (QR Code)',
+ showQR: 'Afficher le QR Code',
downloadConfig: 'Télécharger la configuration',
madeBy: 'Développé par',
donate: 'Soutenir',
@@ -201,6 +203,8 @@ const messages = { // eslint-disable-line no-unused-vars
backup: 'Sauvegarder',
titleRestoreConfig: 'Restaurer votre configuration',
titleBackupConfig: 'Sauvegarder votre configuration',
+ editAllowedIPs: 'Editer le paramètre AllowedIPs du serveur',
+ allowedIPs: 'Serveur AllowedIPs',
},
de: { // github.com/florian-asche
name: 'Name',