From 361849b9dbbc11a49a251f81c4ff7bed06d243f4 Mon Sep 17 00:00:00 2001 From: mhsanaei Date: Thu, 6 Mar 2025 20:35:17 +0100 Subject: [PATCH] Balancer fallbackTag #2724 --- web/html/xui/xray.html | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/web/html/xui/xray.html b/web/html/xui/xray.html index ac8ed80a..288b69fc 100644 --- a/web/html/xui/xray.html +++ b/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;