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>2024-03-13 01:01:37 +0300
committerMHSanaei <ho3ein.sanaei@gmail.com>2024-03-13 01:01:37 +0300
commitc74efa1d432146a0a9630f71320fe446c7b191eb (patch)
treed4f17a5f85b030683865e5122db88b18317f1243 /web/html/xui/xray.html
parent18af7047f8d37e31c6f04362019e1a45c1f4b41d (diff)
fix bug - deleteBalancer
Diffstat (limited to 'web/html/xui/xray.html')
-rw-r--r--web/html/xui/xray.html11
1 files changed, 7 insertions, 4 deletions
diff --git a/web/html/xui/xray.html b/web/html/xui/xray.html
index 7a54584c..83553656 100644
--- a/web/html/xui/xray.html
+++ b/web/html/xui/xray.html
@@ -1182,7 +1182,7 @@
});
},
deleteBalancer(index) {
- newTemplateSettings = this.templateSettings;
+ let newTemplateSettings = { ...this.templateSettings };
// Remove from balancers
const removedBalancer = this.balancersData.splice(index, 1)[0];
@@ -1192,9 +1192,12 @@
newTemplateSettings.routing.balancers.splice(realIndex, 1);
// Remove related routing rules
- let rules = newTemplateSettings.routing.rules.filter((r) => !r.balancerTag || r.balancerTag !== removedBalancer.tag);
- newTemplateSettings.routing.rules = rules;
-
+ newTemplateSettings.routing.rules.forEach((rule) => {
+ if (rule.balancerTag === removedBalancer.tag) {
+ delete rule.balancerTag;
+ }
+ });
+
// Update balancers property to an empty array if there are no more balancers
if (newTemplateSettings.routing.balancers.length === 0) {
delete newTemplateSettings.routing.balancers;