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/html/xui/settings.html | |
| parent | 77edea5419aabd319c712b78c33f613869e8bcc8 (diff) | |
update noise to noises
+ type
Diffstat (limited to 'web/html/xui/settings.html')
| -rw-r--r-- | web/html/xui/settings.html | 73 |
1 files changed, 48 insertions, 25 deletions
diff --git a/web/html/xui/settings.html b/web/html/xui/settings.html index 3433a648..b95ce0a5 100644 --- a/web/html/xui/settings.html +++ b/web/html/xui/settings.html @@ -305,18 +305,30 @@ <a-list-item style="padding: 20px"> <a-row> <a-col :lg="24" :xl="12"> - <a-list-item-meta title='Noise'> - <template slot="description">{{ i18n "pages.settings.noiseDesc"}}</template> + <a-list-item-meta title='Noises'> + <template slot="description">{{ i18n "pages.settings.noisesDesc"}}</template> </a-list-item-meta> </a-col> <a-col :lg="24" :xl="12"> - <a-switch v-model="noise"></a-switch> + <a-switch v-model="noises"></a-switch> </a-col> </a-row> - <a-collapse v-if="noise" style="margin-top: 14px;"> - <a-collapse-panel header='{{ i18n "pages.settings.noiseSett"}}' v-if="noise"> - <setting-list-item style="padding: 10px 20px" type="text" title='Packet (ms)' v-model="noisePacket" placeholder="rand:5-10"></setting-list-item> - <setting-list-item style="padding: 10px 20px" type="text" title='Delay (ms)' v-model="noiseDelay" placeholder="10-20"></setting-list-item> + <a-collapse v-if="noises" style="margin-top: 14px;"> + <a-collapse-panel header='{{ i18n "pages.settings.noisesSett"}}' v-if="noises"> + <a-list-item style="padding: 10px 20px"> + <a-row> + <a-col :lg="24" :xl="12"> + <a-list-item-meta title='Type'></a-list-item-meta> + </a-col> + <a-col :lg="24" :xl="12"> + <a-select v-model="noisesType" style="width: 100%" :dropdown-class-name="themeSwitcher.currentTheme"> + <a-select-option :value="p" :label="p" v-for="p in ['rand', 'base64', 'str']"> [[ p ]] </a-select-option> + </a-select> + </a-col> + </a-row> + </a-list-item> + <setting-list-item style="padding: 10px 20px" type="text" title='Packet (ms)' v-model="noisesPacket" placeholder="5-10"></setting-list-item> + <setting-list-item style="padding: 10px 20px" type="text" title='Delay (ms)' v-model="noisesDelay" placeholder="10-20"></setting-list-item> </a-collapse-panel> </a-collapse> </a-list-item> @@ -419,14 +431,15 @@ } } }, - defaultNoise: { - tag: "noise", + defaultNoises: { + tag: "noises", protocol: "freedom", settings: { domainStrategy: "AsIs", - noise: { - packet: "rand:5-10", - delay: "10-20", + noises: { + type: "rand", + packet: "10-20", + delay: "10-16", } }, }, @@ -629,29 +642,39 @@ } } }, - noise: { - get: function () { return this.allSetting?.subJsonNoise != ""; }, + noises: { + get: function () { return this.allSetting?.subJsonNoises != ""; }, set: function (v) { - this.allSetting.subJsonNoise = v ? JSON.stringify(this.defaultNoise) : ""; + this.allSetting.subJsonNoises = v ? JSON.stringify(this.defaultNoises) : ""; + } + }, + noisesType: { + get: function () { return this.noises ? JSON.parse(this.allSetting.subJsonNoises).settings.noises.type : ""; }, + set: function (v) { + if (v != "") { + newNoises = JSON.parse(this.allSetting.subJsonNoises); + newNoises.settings.noises.type = v; + this.allSetting.subJsonNoises = JSON.stringify(newNoises); + } } }, - noisePacket: { - get: function () { return this.noise ? JSON.parse(this.allSetting.subJsonNoise).settings.noise.packet : ""; }, + noisesPacket: { + get: function () { return this.noises ? JSON.parse(this.allSetting.subJsonNoises).settings.noises.packet : ""; }, set: function (v) { if (v != "") { - newNoise = JSON.parse(this.allSetting.subJsonNoise); - newNoise.settings.noise.packet = v; - this.allSetting.subJsonNoise = JSON.stringify(newNoise); + newNoises = JSON.parse(this.allSetting.subJsonNoises); + newNoises.settings.noises.packet = v; + this.allSetting.subJsonNoises = JSON.stringify(newNoises); } } }, - noiseDelay: { - get: function () { return this.noise ? JSON.parse(this.allSetting.subJsonNoise).settings.noise.delay : ""; }, + noisesDelay: { + get: function () { return this.noises ? JSON.parse(this.allSetting.subJsonNoises).settings.noises.delay : ""; }, set: function (v) { if (v != "") { - newNoise = JSON.parse(this.allSetting.subJsonNoise); - newNoise.settings.noise.delay = v; - this.allSetting.subJsonNoise = JSON.stringify(newNoise); + newNoises = JSON.parse(this.allSetting.subJsonNoises); + newNoises.settings.noises.delay = v; + this.allSetting.subJsonNoises = JSON.stringify(newNoises); } } }, |
