mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-08-16 16:20:59 +00:00
balancerTags with a default empty entry
This commit is contained in:
@@ -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 = '';
|
||||||
|
|||||||
Reference in New Issue
Block a user