mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-06-06 21:24:10 +00:00
Add highestPing balancer strategy and update Xray-core download URLs to xAlokyx/Xray-core
Agent-Logs-Url: https://github.com/xAlokyx/3x-ui/sessions/eb6d9a49-be1a-406c-a4a5-a8fea6b1a809 Co-authored-by: xAlokyx <234771438+xAlokyx@users.noreply.github.com>
This commit is contained in:
parent
93c2788562
commit
79cdac52f6
6 changed files with 10 additions and 8 deletions
4
.github/workflows/release.yml
vendored
4
.github/workflows/release.yml
vendored
|
|
@ -126,7 +126,7 @@ jobs:
|
|||
cd x-ui/bin
|
||||
|
||||
# Download dependencies
|
||||
Xray_URL="https://github.com/XTLS/Xray-core/releases/download/v26.2.6/"
|
||||
Xray_URL="https://github.com/xAlokyx/Xray-core/releases/download/v26.2.6/"
|
||||
if [ "${{ matrix.platform }}" == "amd64" ]; then
|
||||
wget -q ${Xray_URL}Xray-linux-64.zip
|
||||
unzip Xray-linux-64.zip
|
||||
|
|
@ -244,7 +244,7 @@ jobs:
|
|||
cd x-ui\bin
|
||||
|
||||
# Download Xray for Windows
|
||||
$Xray_URL = "https://github.com/XTLS/Xray-core/releases/download/v26.2.6/"
|
||||
$Xray_URL = "https://github.com/xAlokyx/Xray-core/releases/download/v26.2.6/"
|
||||
Invoke-WebRequest -Uri "${Xray_URL}Xray-windows-64.zip" -OutFile "Xray-windows-64.zip"
|
||||
Expand-Archive -Path "Xray-windows-64.zip" -DestinationPath .
|
||||
Remove-Item "Xray-windows-64.zip"
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ case $1 in
|
|||
esac
|
||||
mkdir -p build/bin
|
||||
cd build/bin
|
||||
curl -sfLRO "https://github.com/XTLS/Xray-core/releases/download/v26.2.6/Xray-linux-${ARCH}.zip"
|
||||
curl -sfLRO "https://github.com/xAlokyx/Xray-core/releases/download/v26.2.6/Xray-linux-${ARCH}.zip"
|
||||
unzip "Xray-linux-${ARCH}.zip"
|
||||
rm -f "Xray-linux-${ARCH}.zip" geoip.dat geosite.dat
|
||||
mv xray "xray-linux-${FNAME}"
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
<a-select-option value="roundRobin">Round Robin</a-select-option>
|
||||
<a-select-option value="leastLoad">Least Load</a-select-option>
|
||||
<a-select-option value="leastPing">Least Ping</a-select-option>
|
||||
<a-select-option value="highestPing">Highest Ping</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item label='{{ i18n "pages.xray.balancer.balancerSelectors" }}' has-feedback
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@
|
|||
<a-tag :style="{ margin: '0' }" v-if="balancer.strategy=='roundRobin'" color="green">Round Robin</a-tag>
|
||||
<a-tag :style="{ margin: '0' }" v-if="balancer.strategy=='leastLoad'" color="green">Least Load</a-tag>
|
||||
<a-tag :style="{ margin: '0' }" v-if="balancer.strategy=='leastPing'" color="green">Least Ping</a-tag>
|
||||
<a-tag :style="{ margin: '0' }" v-if="balancer.strategy=='highestPing'" color="green">Highest Ping</a-tag>
|
||||
</template>
|
||||
<template slot="selector" slot-scope="text, balancer, index">
|
||||
<a-tag class="info-large-tag" :style="{ margin: '1' }" v-for="sel in balancer.selector">[[ sel ]]</a-tag>
|
||||
|
|
|
|||
|
|
@ -890,17 +890,17 @@
|
|||
},
|
||||
updateObservatorySelectors() {
|
||||
newTemplateSettings = this.templateSettings;
|
||||
const leastPings = this.balancersData.filter((b) => b.strategy == 'leastPing');
|
||||
const pingBasedBalancers = this.balancersData.filter((b) => b.strategy == 'leastPing' || b.strategy == 'highestPing');
|
||||
const leastLoads = this.balancersData.filter((b) =>
|
||||
b.strategy === 'leastLoad' ||
|
||||
b.strategy === 'roundRobin' ||
|
||||
b.strategy === 'random'
|
||||
);
|
||||
if (leastPings.length > 0) {
|
||||
if (pingBasedBalancers.length > 0) {
|
||||
if (!newTemplateSettings.observatory)
|
||||
newTemplateSettings.observatory = this.defaultObservatory;
|
||||
newTemplateSettings.observatory.subjectSelector = [];
|
||||
leastPings.forEach((b) => {
|
||||
pingBasedBalancers.forEach((b) => {
|
||||
b.selector.forEach((s) => {
|
||||
if (!newTemplateSettings.observatory.subjectSelector.includes(s))
|
||||
newTemplateSettings.observatory.subjectSelector.push(s);
|
||||
|
|
|
|||
|
|
@ -519,7 +519,7 @@ func (s *ServerService) sampleCPUUtilization() (float64, error) {
|
|||
|
||||
func (s *ServerService) GetXrayVersions() ([]string, error) {
|
||||
const (
|
||||
XrayURL = "https://api.github.com/repos/XTLS/Xray-core/releases"
|
||||
XrayURL = "https://api.github.com/repos/xAlokyx/Xray-core/releases"
|
||||
bufferSize = 8192
|
||||
)
|
||||
|
||||
|
|
@ -621,7 +621,7 @@ func (s *ServerService) downloadXRay(version string) (string, error) {
|
|||
}
|
||||
|
||||
fileName := fmt.Sprintf("Xray-%s-%s.zip", osName, arch)
|
||||
url := fmt.Sprintf("https://github.com/XTLS/Xray-core/releases/download/%s/%s", version, fileName)
|
||||
url := fmt.Sprintf("https://github.com/xAlokyx/Xray-core/releases/download/%s/%s", version, fileName)
|
||||
resp, err := http.Get(url)
|
||||
if err != nil {
|
||||
return "", err
|
||||
|
|
|
|||
Loading…
Reference in a new issue