mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-04-26 17:36:15 +00:00
balancerTags with a default empty entry
This commit is contained in:
parent
faec3ca038
commit
733f44ef0f
2 changed files with 10 additions and 0 deletions
|
|
@ -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)];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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 = '';
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue