Skip to content

Commit 361849b

Browse files
committed
Balancer fallbackTag #2724
1 parent c13db79 commit 361849b

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

web/html/xui/xray.html

+7-5
Original file line numberDiff line numberDiff line change
@@ -1384,8 +1384,7 @@
13841384
}
13851385
newTemplateSettings.routing.balancers.push(tmpBalancer);
13861386
this.templateSettings = newTemplateSettings;
1387-
if (balancer.strategy == 'leastPing' || balancer.strategy == 'leastLoad')
1388-
this.updateObservatorySelectors();
1387+
this.updateObservatorySelectors();
13891388
balancerModal.close();
13901389
this.changeObsCode();
13911390
},
@@ -1433,8 +1432,7 @@
14331432
});
14341433
}
14351434
this.templateSettings = newTemplateSettings;
1436-
if (balancer.strategy == 'leastPing' || balancer.strategy == 'leastLoad')
1437-
this.updateObservatorySelectors();
1435+
this.updateObservatorySelectors();
14381436
balancerModal.close();
14391437
this.changeObsCode();
14401438
},
@@ -1444,7 +1442,11 @@
14441442
updateObservatorySelectors(){
14451443
newTemplateSettings = this.templateSettings;
14461444
const leastPings = this.balancersData.filter((b) => b.strategy == 'leastPing');
1447-
const leastLoads = this.balancersData.filter((b) => b.strategy == 'leastLoad');
1445+
const leastLoads = this.balancersData.filter((b) =>
1446+
b.strategy === 'leastLoad' ||
1447+
b.strategy === 'roundRobin' ||
1448+
b.strategy === 'random'
1449+
);
14481450
if (leastPings.length>0){
14491451
if (!newTemplateSettings.observatory)
14501452
newTemplateSettings.observatory = this.defaultObservatory;

0 commit comments

Comments
 (0)