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 | |
| parent | 77edea5419aabd319c712b78c33f613869e8bcc8 (diff) | |
update noise to noises
+ type
Diffstat (limited to 'web')
| -rw-r--r-- | web/assets/js/model/outbound.js | 20 | ||||
| -rw-r--r-- | web/assets/js/model/setting.js | 2 | ||||
| -rw-r--r-- | web/entity/entity.go | 2 | ||||
| -rw-r--r-- | web/html/xui/form/outbound.html | 15 | ||||
| -rw-r--r-- | web/html/xui/settings.html | 73 | ||||
| -rw-r--r-- | web/service/setting.go | 6 | ||||
| -rw-r--r-- | web/translation/translate.en_US.toml | 4 | ||||
| -rw-r--r-- | web/translation/translate.es_ES.toml | 4 | ||||
| -rw-r--r-- | web/translation/translate.fa_IR.toml | 4 | ||||
| -rw-r--r-- | web/translation/translate.id_ID.toml | 4 | ||||
| -rw-r--r-- | web/translation/translate.pt_BR.toml | 4 | ||||
| -rw-r--r-- | web/translation/translate.ru_RU.toml | 4 | ||||
| -rw-r--r-- | web/translation/translate.tr_TR.toml | 4 | ||||
| -rw-r--r-- | web/translation/translate.uk_UA.toml | 4 | ||||
| -rw-r--r-- | web/translation/translate.vi_VN.toml | 4 | ||||
| -rw-r--r-- | web/translation/translate.zh_CN.toml | 4 |
16 files changed, 96 insertions, 62 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 = ""; diff --git a/web/entity/entity.go b/web/entity/entity.go index ae11d614..7e00fbf3 100644 --- a/web/entity/entity.go +++ b/web/entity/entity.go @@ -52,7 +52,7 @@ type AllSetting struct { SubJsonPath string `json:"subJsonPath" form:"subJsonPath"` SubJsonURI string `json:"subJsonURI" form:"subJsonURI"` SubJsonFragment string `json:"subJsonFragment" form:"subJsonFragment"` - SubJsonNoise string `json:"subJsonNoise" form:"subJsonNoise"` + SubJsonNoises string `json:"subJsonNoises" form:"subJsonNoises"` SubJsonMux string `json:"subJsonMux" form:"subJsonMux"` SubJsonRules string `json:"subJsonRules" form:"subJsonRules"` Datepicker string `json:"datepicker" form:"datepicker"` diff --git a/web/html/xui/form/outbound.html b/web/html/xui/form/outbound.html index abc96bb4..21fedd88 100644 --- a/web/html/xui/form/outbound.html +++ b/web/html/xui/form/outbound.html @@ -46,15 +46,20 @@ <a-input v-model.trim="outbound.settings.fragment.interval"></a-input> </a-form-item> </template> - <a-form-item label='Noise'> - <a-switch :checked="Object.keys(outbound.settings.noise).length >0" @change="checked => outbound.settings.noise = checked ? new Outbound.FreedomSettings.Noise() : {}"></a-switch> + <a-form-item label='Noises'> + <a-switch :checked="Object.keys(outbound.settings.noises).length >0" @change="checked => outbound.settings.noises = checked ? new Outbound.FreedomSettings.Noises() : {}"></a-switch> </a-form-item> - <template v-if="Object.keys(outbound.settings.noise).length >0"> + <template v-if="Object.keys(outbound.settings.noises).length >0"> + <a-form-item label='Type'> + <a-select v-model="outbound.settings.noises.type" :dropdown-class-name="themeSwitcher.currentTheme"> + <a-select-option v-for="s in ['rand','base64','str']" :value="s">[[ s ]]</a-select-option> + </a-select> + </a-form-item> <a-form-item label='Packet'> - <a-input v-model.trim="outbound.settings.noise.packet"></a-input> + <a-input v-model.trim="outbound.settings.noises.packet"></a-input> </a-form-item> <a-form-item label='Delay'> - <a-input v-model.trim="outbound.settings.noise.delay"></a-input> + <a-input v-model.trim="outbound.settings.noises.delay"></a-input> </a-form-item> </template> </template> 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); } } }, diff --git a/web/service/setting.go b/web/service/setting.go index ba620e8f..90bf8fc4 100644 --- a/web/service/setting.go +++ b/web/service/setting.go @@ -62,7 +62,7 @@ var defaultValueMap = map[string]string{ "subJsonPath": "/json/", "subJsonURI": "", "subJsonFragment": "", - "subJsonNoise": "", + "subJsonNoises": "", "subJsonMux": "", "subJsonRules": "", "datepicker": "gregorian", @@ -459,8 +459,8 @@ func (s *SettingService) GetSubJsonFragment() (string, error) { return s.getString("subJsonFragment") } -func (s *SettingService) GetSubJsonNoise() (string, error) { - return s.getString("subJsonNoise") +func (s *SettingService) GetSubJsonNoises() (string, error) { + return s.getString("subJsonNoises") } func (s *SettingService) GetSubJsonMux() (string, error) { diff --git a/web/translation/translate.en_US.toml b/web/translation/translate.en_US.toml index b1207dc0..f92f46ed 100644 --- a/web/translation/translate.en_US.toml +++ b/web/translation/translate.en_US.toml @@ -309,8 +309,8 @@ "fragment" = "Fragmentation" "fragmentDesc" = "Enable fragmentation for TLS hello packet." "fragmentSett" = "Fragmentation Settings" -"noiseDesc" = "Enable Noise." -"noiseSett" = "Noise Settings" +"noisesDesc" = "Enable Noises." +"noisesSett" = "Noises Settings" "mux" = "Mux" "muxDesc" = "Transmit multiple independent data streams within an established data stream." "muxSett" = "Mux Settings" diff --git a/web/translation/translate.es_ES.toml b/web/translation/translate.es_ES.toml index 1791cf20..462e534e 100644 --- a/web/translation/translate.es_ES.toml +++ b/web/translation/translate.es_ES.toml @@ -309,8 +309,8 @@ "fragment" = "Fragmentación"
"fragmentDesc" = "Habilitar la fragmentación para el paquete de saludo de TLS"
"fragmentSett" = "Configuración de Fragmentación"
-"noiseDesc" = "Activar Noise."
-"noiseSett" = "Configuración de Noise"
+"noisesDesc" = "Activar Noises."
+"noisesSett" = "Configuración de Noises"
"mux" = "Mux"
"muxDesc" = "Transmite múltiples flujos de datos independientes dentro de un flujo de datos establecido."
"muxSett" = "Configuración Mux"
diff --git a/web/translation/translate.fa_IR.toml b/web/translation/translate.fa_IR.toml index c208bfd4..0b4e7854 100644 --- a/web/translation/translate.fa_IR.toml +++ b/web/translation/translate.fa_IR.toml @@ -309,8 +309,8 @@ "fragment" = "فرگمنت" "fragmentDesc" = "فعال کردن فرگمنت برای بستهی نخست تیالاس" "fragmentSett" = "تنظیمات فرگمنت" -"noiseDesc" = "فعال کردن Noise." -"noiseSett" = "تنظیمات Noise" +"noisesDesc" = "فعال کردن Noises." +"noisesSett" = "تنظیمات Noises" "mux" = "ماکس" "muxDesc" = "چندین جریان داده مستقل را در یک جریان داده ثابت منتقل می کند" "muxSett" = "تنظیمات ماکس" diff --git a/web/translation/translate.id_ID.toml b/web/translation/translate.id_ID.toml index d913b4a3..b59c5fc7 100644 --- a/web/translation/translate.id_ID.toml +++ b/web/translation/translate.id_ID.toml @@ -309,8 +309,8 @@ "fragment" = "Fragmentasi" "fragmentDesc" = "Aktifkan fragmentasi untuk paket hello TLS" "fragmentSett" = "Pengaturan Fragmentasi" -"noiseDesc" = "Aktifkan Noise." -"noiseSett" = "Pengaturan Noise" +"noisesDesc" = "Aktifkan Noises." +"noisesSett" = "Pengaturan Noises" "mux" = "Mux" "muxDesc" = "Mengirimkan beberapa aliran data independen dalam aliran data yang sudah ada." "muxSett" = "Pengaturan Mux" diff --git a/web/translation/translate.pt_BR.toml b/web/translation/translate.pt_BR.toml index c25c6df0..4da6d8f9 100644 --- a/web/translation/translate.pt_BR.toml +++ b/web/translation/translate.pt_BR.toml @@ -309,8 +309,8 @@ "fragment" = "Fragmentação" "fragmentDesc" = "Ativa a fragmentação para o pacote TLS hello." "fragmentSett" = "Configurações de Fragmentação" -"noiseDesc" = "Ativar Noise." -"noiseSett" = "Configurações de Noise" +"noisesDesc" = "Ativar Noises." +"noisesSett" = "Configurações de Noises" "mux" = "Mux" "muxDesc" = "Transmitir múltiplos fluxos de dados independentes dentro de um fluxo de dados estabelecido." "muxSett" = "Configurações de Mux" diff --git a/web/translation/translate.ru_RU.toml b/web/translation/translate.ru_RU.toml index 88db2ab2..59196c00 100644 --- a/web/translation/translate.ru_RU.toml +++ b/web/translation/translate.ru_RU.toml @@ -309,8 +309,8 @@ "fragment" = "Фрагментация" "fragmentDesc" = "Включить фрагментацию для пакета приветствия TLS" "fragmentSett" = "Настройки фрагментации" -"noiseDesc" = "Включить Noise." -"noiseSett" = "Настройки Noise" +"noisesDesc" = "Включить Noises." +"noisesSett" = "Настройки Noises" "mux" = "Mux" "muxDesc" = "Передача нескольких независимых потоков данных в рамках установленного потока данных." "muxSett" = "Mux Настройки" diff --git a/web/translation/translate.tr_TR.toml b/web/translation/translate.tr_TR.toml index af22826c..1274941f 100644 --- a/web/translation/translate.tr_TR.toml +++ b/web/translation/translate.tr_TR.toml @@ -309,8 +309,8 @@ "fragment" = "Parçalama" "fragmentDesc" = "TLS merhaba paketinin parçalanmasını etkinleştir." "fragmentSett" = "Parçalama Ayarları" -"noiseDesc" = "Noise'i Etkinleştir." -"noiseSett" = "Noise Ayarları" +"noisesDesc" = "Noises'i Etkinleştir." +"noisesSett" = "Noises Ayarları" "mux" = "Mux" "muxDesc" = "Kurulmuş bir veri akışında birden çok bağımsız veri akışını iletir." "muxSett" = "Mux Ayarları" diff --git a/web/translation/translate.uk_UA.toml b/web/translation/translate.uk_UA.toml index de115d7a..221c34d5 100644 --- a/web/translation/translate.uk_UA.toml +++ b/web/translation/translate.uk_UA.toml @@ -309,8 +309,8 @@ "fragment" = "Фрагментація" "fragmentDesc" = "Увімкнути фрагментацію для пакету привітання TLS" "fragmentSett" = "Параметри фрагментації" -"noiseDesc" = "Увімкнути Noise." -"noiseSett" = "Налаштування Noise" +"noisesDesc" = "Увімкнути Noises." +"noisesSett" = "Налаштування Noises" "mux" = "Mux" "muxDesc" = "Передавати кілька незалежних потоків даних у межах встановленого потоку даних." "muxSett" = "Налаштування Mux" diff --git a/web/translation/translate.vi_VN.toml b/web/translation/translate.vi_VN.toml index 2447607c..e45c664b 100644 --- a/web/translation/translate.vi_VN.toml +++ b/web/translation/translate.vi_VN.toml @@ -309,8 +309,8 @@ "fragment" = "Sự phân mảnh"
"fragmentDesc" = "Kích hoạt phân mảnh cho gói TLS hello"
"fragmentSett" = "Cài đặt phân mảnh"
-"noiseDesc" = "Bật Noise."
-"noiseSett" = "Cài đặt Noise"
+"noisesDesc" = "Bật Noises."
+"noisesSett" = "Cài đặt Noises"
"mux" = "Mux"
"muxDesc" = "Truyền nhiều luồng dữ liệu độc lập trong luồng dữ liệu đã thiết lập."
"muxSett" = "Mux Cài đặt"
diff --git a/web/translation/translate.zh_CN.toml b/web/translation/translate.zh_CN.toml index 2d2cf715..0314b0ab 100644 --- a/web/translation/translate.zh_CN.toml +++ b/web/translation/translate.zh_CN.toml @@ -309,8 +309,8 @@ "fragment" = "分片" "fragmentDesc" = "启用 TLS hello 数据包分片" "fragmentSett" = "设置" -"noiseDesc" = "启用 Noise." -"noiseSett" = "Noise 设置" +"noisesDesc" = "启用 Noises." +"noisesSett" = "Noises 设置" "mux" = "多路复用器" "muxDesc" = "在已建立的数据流内传输多个独立的数据流" "muxSett" = "复用器设置" |
