diff options
| author | mhsanaei <ho3ein.sanaei@gmail.com> | 2024-09-17 10:33:44 +0300 |
|---|---|---|
| committer | mhsanaei <ho3ein.sanaei@gmail.com> | 2024-09-17 10:51:57 +0300 |
| commit | 6b0c9a5fad333a491ddac65126783481c638672f (patch) | |
| tree | 0b1ca5f4c0114d88da0b28070f7ef28372cc222e /web/assets | |
| parent | 77edea5419aabd319c712b78c33f613869e8bcc8 (diff) | |
update noise to noises
+ type
Diffstat (limited to 'web/assets')
| -rw-r--r-- | web/assets/js/model/outbound.js | 20 | ||||
| -rw-r--r-- | web/assets/js/model/setting.js | 2 |
2 files changed, 14 insertions, 8 deletions
diff --git a/web/assets/js/model/outbound.js b/web/assets/js/model/outbound.js index 53497548..bc4ad735 100644 --- a/web/assets/js/model/outbound.js +++ b/web/assets/js/model/outbound.js @@ -854,14 +854,14 @@ Outbound.FreedomSettings = class extends CommonClass { timeout = 10, redirect = '', fragment = {}, - noise = {} + noises = {} ) { super(); this.domainStrategy = domainStrategy; this.timeout = timeout; this.redirect = redirect; this.fragment = fragment; - this.noise = noise; + this.noises = noises; } static fromJson(json = {}) { @@ -870,7 +870,7 @@ Outbound.FreedomSettings = class extends CommonClass { json.timeout, json.redirect, json.fragment ? Outbound.FreedomSettings.Fragment.fromJson(json.fragment) : undefined, - json.noise ? Outbound.FreedomSettings.Noise.fromJson(json.noise) : undefined, + json.noises ? Outbound.FreedomSettings.Noises.fromJson(json.noises) : undefined, ); } @@ -880,7 +880,7 @@ Outbound.FreedomSettings = class extends CommonClass { timeout: this.timeout, redirect: this.redirect, fragment: Object.keys(this.fragment).length === 0 ? undefined : this.fragment, - noise: Object.keys(this.noise).length === 0 ? undefined : this.noise, + noises: Object.keys(this.noises).length === 0 ? undefined : this.noises, }; } }; @@ -900,15 +900,21 @@ Outbound.FreedomSettings.Fragment = class extends CommonClass { ); } }; -Outbound.FreedomSettings.Noise = class extends CommonClass { - constructor(packet = 'rand:100-200', delay = '10-20') { +Outbound.FreedomSettings.Noises = class extends CommonClass { + constructor( + type = 'rand', + packet = '10-20', + delay = '10-16' + ) { super(); + this.type = type; this.packet = packet; this.delay = delay; } static fromJson(json = {}) { - return new Outbound.FreedomSettings.Noise( + return new Outbound.FreedomSettings.Noises( + json.type, json.packet, json.delay, ); diff --git a/web/assets/js/model/setting.js b/web/assets/js/model/setting.js index 75424bd3..b73d6008 100644 --- a/web/assets/js/model/setting.js +++ b/web/assets/js/model/setting.js @@ -38,7 +38,7 @@ class AllSetting { this.subURI = ""; this.subJsonURI = ""; this.subJsonFragment = ""; - this.subJsonNoise = ""; + this.subJsonNoises = ""; this.subJsonMux = ""; this.subJsonRules = ""; |
