Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMHSanaei <ho3ein.sanaei@gmail.com>2026-04-20 19:02:39 +0300
committerMHSanaei <ho3ein.sanaei@gmail.com>2026-04-20 19:02:39 +0300
commiteb16cca551a5880c9567b4d0a0d5fe5ca18b1c21 (patch)
treece810e72b6fe06e2f17b4509cd82ddb54131b55f /web/assets
parentaef0503f8f6cb43faf2583e6ac546623d80f8434 (diff)
Add ipsBlocked to Freedom
Expose an ipsBlocked array on Outbound.FreedomSettings and wire it into the outbound form. The constructor now defaults fragment to {} and noises/ipsBlocked to arrays for robustness; fromJson/toJson handle ipsBlocked and omit it when empty. The outbound HTML adds a tag-style <a-select> bound to outbound.settings.ipsBlocked (with comma tokenization and placeholder) so users can enter IP/CIDR/geoip entries.
Diffstat (limited to 'web/assets')
-rw-r--r--web/assets/js/model/outbound.js14
1 files changed, 9 insertions, 5 deletions
diff --git a/web/assets/js/model/outbound.js b/web/assets/js/model/outbound.js
index 9d2c080b..c0808c1d 100644
--- a/web/assets/js/model/outbound.js
+++ b/web/assets/js/model/outbound.js
@@ -1137,13 +1137,15 @@ Outbound.FreedomSettings = class extends CommonClass {
domainStrategy = '',
redirect = '',
fragment = {},
- noises = []
+ noises = [],
+ ipsBlocked = [],
) {
super();
this.domainStrategy = domainStrategy;
this.redirect = redirect;
- this.fragment = fragment;
- this.noises = noises;
+ this.fragment = fragment || {};
+ this.noises = Array.isArray(noises) ? noises : [];
+ this.ipsBlocked = Array.isArray(ipsBlocked) ? ipsBlocked : [];
}
addNoise() {
@@ -1158,8 +1160,9 @@ Outbound.FreedomSettings = class extends CommonClass {
return new Outbound.FreedomSettings(
json.domainStrategy,
json.redirect,
- json.fragment ? Outbound.FreedomSettings.Fragment.fromJson(json.fragment) : undefined,
- json.noises ? json.noises.map(noise => Outbound.FreedomSettings.Noise.fromJson(noise)) : undefined,
+ json.fragment ? Outbound.FreedomSettings.Fragment.fromJson(json.fragment) : {},
+ json.noises ? json.noises.map(noise => Outbound.FreedomSettings.Noise.fromJson(noise)) : [],
+ json.ipsBlocked || [],
);
}
@@ -1169,6 +1172,7 @@ Outbound.FreedomSettings = class extends CommonClass {
redirect: ObjectUtil.isEmpty(this.redirect) ? undefined : this.redirect,
fragment: Object.keys(this.fragment).length === 0 ? undefined : this.fragment,
noises: this.noises.length === 0 ? undefined : Outbound.FreedomSettings.Noise.toJsonArray(this.noises),
+ ipsBlocked: this.ipsBlocked.length === 0 ? undefined : this.ipsBlocked,
};
}
};