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:
-rw-r--r--web/assets/js/model/outbound.js14
-rw-r--r--web/html/form/outbound.html11
2 files changed, 20 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,
};
}
};
diff --git a/web/html/form/outbound.html b/web/html/form/outbound.html
index fe76b518..f4cb6467 100644
--- a/web/html/form/outbound.html
+++ b/web/html/form/outbound.html
@@ -51,6 +51,17 @@
<a-form-item label="Redirect">
<a-input v-model="outbound.settings.redirect"></a-input>
</a-form-item>
+ <a-form-item label="IPs Blocked">
+ <a-select
+ mode="tags"
+ v-model="outbound.settings.ipsBlocked"
+ :style="{ width: '100%' }"
+ :dropdown-class-name="themeSwitcher.currentTheme"
+ :token-separators="[',']"
+ placeholder="IP/CIDR/geoip:*/ext:*"
+ >
+ </a-select>
+ </a-form-item>
<a-form-item label="Fragment">
<a-switch
:checked="Object.keys(outbound.settings.fragment).length >0"