Forráskód Böngészése

balancerTags with a default empty entry

MHSanaei 4 napja
szülő
commit
733f44ef0f
2 módosított fájl, 10 hozzáadás és 0 törlés
  1. 1 0
      web/html/modals/xray_rule_modal.html
  2. 9 0
      web/html/xray.html

+ 1 - 0
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)];
       }

+ 9 - 0
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 = '';