From 733f44ef0f593d8eb987e54da7a26d1bc46a6b6e Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Tue, 21 Apr 2026 17:24:42 +0200 Subject: [PATCH] balancerTags with a default empty entry --- web/html/modals/xray_rule_modal.html | 1 + web/html/xray.html | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/web/html/modals/xray_rule_modal.html b/web/html/modals/xray_rule_modal.html index e6a8bf46..ab5389c7 100644 --- a/web/html/modals/xray_rule_modal.html +++ b/web/html/modals/xray_rule_modal.html @@ -203,6 +203,7 @@ } if (app.templateSettings.reverse.portals) this.outboundTags.push(...app.templateSettings.reverse.portals.map(b => b.tag)); } + this.balancerTags = [""]; if (app.templateSettings.routing && app.templateSettings.routing.balancers) { this.balancerTags = ["", ...app.templateSettings.routing.balancers.filter((o) => !ObjectUtil.isEmpty(o.tag)).map(obj => obj.tag)]; } diff --git a/web/html/xray.html b/web/html/xray.html index 01b4e4e2..9c62ba69 100644 --- a/web/html/xray.html +++ b/web/html/xray.html @@ -938,6 +938,15 @@ if (newTemplateSettings.routing.balancers.length === 0) { delete newTemplateSettings.routing.balancers; } + + // Remove orphaned balancer references from routing rules + if (newTemplateSettings.routing.rules) { + newTemplateSettings.routing.rules.forEach((rule) => { + if (rule.balancerTag && rule.balancerTag === removedBalancer.tag) { + delete rule.balancerTag; + } + }); + } this.templateSettings = newTemplateSettings; this.updateObservatorySelectors(); this.obsSettings = '';