balancerTags with a default empty entry

This commit is contained in:
MHSanaei 2026-04-21 17:24:42 +02:00
parent faec3ca038
commit 733f44ef0f
No known key found for this signature in database
GPG key ID: 7E4060F2FBE5AB7A
2 changed files with 10 additions and 0 deletions

View file

@ -203,6 +203,7 @@
} }
if (app.templateSettings.reverse.portals) this.outboundTags.push(...app.templateSettings.reverse.portals.map(b => b.tag)); 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) { if (app.templateSettings.routing && app.templateSettings.routing.balancers) {
this.balancerTags = ["", ...app.templateSettings.routing.balancers.filter((o) => !ObjectUtil.isEmpty(o.tag)).map(obj => obj.tag)]; this.balancerTags = ["", ...app.templateSettings.routing.balancers.filter((o) => !ObjectUtil.isEmpty(o.tag)).map(obj => obj.tag)];
} }

View file

@ -938,6 +938,15 @@
if (newTemplateSettings.routing.balancers.length === 0) { if (newTemplateSettings.routing.balancers.length === 0) {
delete newTemplateSettings.routing.balancers; 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.templateSettings = newTemplateSettings;
this.updateObservatorySelectors(); this.updateObservatorySelectors();
this.obsSettings = ''; this.obsSettings = '';