diff options
| author | MHSanaei <ho3ein.sanaei@gmail.com> | 2024-03-13 01:01:37 +0300 |
|---|---|---|
| committer | MHSanaei <ho3ein.sanaei@gmail.com> | 2024-03-13 01:01:37 +0300 |
| commit | c74efa1d432146a0a9630f71320fe446c7b191eb (patch) | |
| tree | d4f17a5f85b030683865e5122db88b18317f1243 /web/html/xui/xray.html | |
| parent | 18af7047f8d37e31c6f04362019e1a45c1f4b41d (diff) | |
fix bug - deleteBalancer
Diffstat (limited to 'web/html/xui/xray.html')
| -rw-r--r-- | web/html/xui/xray.html | 11 |
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; |
