Explorar o código

Balancer fallbackTag #2724

mhsanaei hai 4 semanas
pai
achega
361849b9db
Modificáronse 1 ficheiros con 7 adicións e 5 borrados
  1. 7 5
      web/html/xui/xray.html

+ 7 - 5
web/html/xui/xray.html

@@ -1384,8 +1384,7 @@
                         }
                         newTemplateSettings.routing.balancers.push(tmpBalancer);
                         this.templateSettings = newTemplateSettings;
-                        if (balancer.strategy == 'leastPing' || balancer.strategy == 'leastLoad')
-                            this.updateObservatorySelectors();
+                        this.updateObservatorySelectors();
                         balancerModal.close();
                         this.changeObsCode();
                     },
@@ -1433,8 +1432,7 @@
                             });
                         }
                         this.templateSettings = newTemplateSettings;
-                        if (balancer.strategy == 'leastPing' || balancer.strategy == 'leastLoad')
-                            this.updateObservatorySelectors();
+                        this.updateObservatorySelectors();
                         balancerModal.close();
                         this.changeObsCode();
                     },
@@ -1444,7 +1442,11 @@
             updateObservatorySelectors(){
                 newTemplateSettings = this.templateSettings;
                 const leastPings = this.balancersData.filter((b) => b.strategy == 'leastPing');
-                const leastLoads = this.balancersData.filter((b) => b.strategy == 'leastLoad');
+                const leastLoads = this.balancersData.filter((b) =>
+                    b.strategy === 'leastLoad' ||
+                    b.strategy === 'roundRobin' ||
+                    b.strategy === 'random'
+                );
                 if (leastPings.length>0){
                     if (!newTemplateSettings.observatory)
                         newTemplateSettings.observatory = this.defaultObservatory;