feat: working AWG 2.0 parameters

This commit is contained in:
Daan Selen
2026-02-06 20:18:32 +01:00
parent 07534b6f66
commit 8ca0363fd0
54 changed files with 74 additions and 72 deletions

View File

@@ -49,11 +49,11 @@ export default {
H2: 0,
H3: 0,
H4: 0,
I1: "",
I2: "",
I3: "",
I4: "",
I5: ""
I1: "0",
I2: "0",
I3: "0",
I4: "0",
I5: "0"
},
numberOfAvailableIPs: "0",
error: false,
@@ -66,14 +66,16 @@ export default {
},
created() {
this.wireguardGenerateKeypair();
let hValue = []
while ([...new Set(hValue)].length !== 4){
hValue = [this.rand(1, (2**31) - 1), this.rand(1, (2**31) - 1), this.rand(1, (2**31) - 1), this.rand(1, (2**31) - 1)]
}
this.newConfiguration.H1 = hValue[0]
this.newConfiguration.H2 = hValue[1]
this.newConfiguration.H3 = hValue[2]
this.newConfiguration.H4 = hValue[3]
// Generate 4 random numbers for H1, H2, H3, H4
['H1', 'H2', 'H3', 'H4'].forEach(key => {
this.newConfiguration[key] = this.rand(1, 2**31);
});
// Initialize I1 to I5 as "0"
['I1', 'I2', 'I3', 'I4', 'I5'].forEach(key => {
this.newConfiguration[key] = "0";
});
},
methods: {
rand(min, max){