mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2026-04-20 19:56:17 +00:00
feat: working AWG 2.0 parameters
This commit is contained in:
@@ -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){
|
||||
|
||||
Reference in New Issue
Block a user