Compare commits
19 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e0f005bd96 | ||
|
|
2cacc372ad | ||
|
|
0b1b681655 | ||
|
|
deafd73306 | ||
|
|
317a5da120 | ||
|
|
071cefc511 | ||
|
|
32a5cc8aa3 | ||
|
|
c41378a085 | ||
|
|
6910e03ef4 | ||
|
|
5060a358db | ||
|
|
b3e9a957c4 | ||
|
|
f6dbfc2dac | ||
|
|
2966a34e63 | ||
|
|
50959951ae | ||
|
|
c2e1cf7bdb | ||
|
|
51ac7cc8be | ||
|
|
3144f1d1c2 | ||
|
|
a176e7b912 | ||
|
|
1198ec0f74 |
8
.github/workflows/build-linux.yml
vendored
8
.github/workflows/build-linux.yml
vendored
@@ -36,10 +36,10 @@ jobs:
|
||||
- name: Build
|
||||
run: |
|
||||
cd v2rayN
|
||||
dotnet publish ./v2rayN.Desktop/v2rayN.Desktop.csproj -c Release -r linux-x64 --self-contained=true -p:PublishReadyToRun=false -p:PublishSingleFile=true -o $OutputPath64
|
||||
dotnet publish ./v2rayN.Desktop/v2rayN.Desktop.csproj -c Release -r linux-arm64 --self-contained=true -p:PublishReadyToRun=false -p:PublishSingleFile=true -o $OutputPathArm64
|
||||
dotnet publish ./AmazTool/AmazTool.csproj -c Release -r linux-x64 --self-contained=true -p:PublishReadyToRun=false -p:PublishSingleFile=true -p:PublishTrimmed=true -o $OutputPath64
|
||||
dotnet publish ./AmazTool/AmazTool.csproj -c Release -r linux-arm64 --self-contained=true -p:PublishReadyToRun=false -p:PublishSingleFile=true -p:PublishTrimmed=true -o $OutputPathArm64
|
||||
dotnet publish ./v2rayN.Desktop/v2rayN.Desktop.csproj -c Release -r linux-x64 --self-contained=true -o $OutputPath64
|
||||
dotnet publish ./v2rayN.Desktop/v2rayN.Desktop.csproj -c Release -r linux-arm64 --self-contained=true -o $OutputPathArm64
|
||||
dotnet publish ./AmazTool/AmazTool.csproj -c Release -r linux-x64 --self-contained=true -p:PublishTrimmed=true -o $OutputPath64
|
||||
dotnet publish ./AmazTool/AmazTool.csproj -c Release -r linux-arm64 --self-contained=true -p:PublishTrimmed=true -o $OutputPathArm64
|
||||
|
||||
- name: Upload build artifacts
|
||||
uses: actions/upload-artifact@v4.6.0
|
||||
|
||||
8
.github/workflows/build-osx.yml
vendored
8
.github/workflows/build-osx.yml
vendored
@@ -36,10 +36,10 @@ jobs:
|
||||
- name: Build
|
||||
run: |
|
||||
cd v2rayN
|
||||
dotnet publish ./v2rayN.Desktop/v2rayN.Desktop.csproj -c Release -r osx-x64 --self-contained=true -p:PublishReadyToRun=false -p:PublishSingleFile=true -o $OutputPath64
|
||||
dotnet publish ./v2rayN.Desktop/v2rayN.Desktop.csproj -c Release -r osx-arm64 --self-contained=true -p:PublishReadyToRun=false -p:PublishSingleFile=true -o $OutputPathArm64
|
||||
dotnet publish ./AmazTool/AmazTool.csproj -c Release -r osx-x64 --self-contained=true -p:PublishReadyToRun=false -p:PublishSingleFile=true -p:PublishTrimmed=true -o $OutputPath64
|
||||
dotnet publish ./AmazTool/AmazTool.csproj -c Release -r osx-arm64 --self-contained=true -p:PublishReadyToRun=false -p:PublishSingleFile=true -p:PublishTrimmed=true -o $OutputPathArm64
|
||||
dotnet publish ./v2rayN.Desktop/v2rayN.Desktop.csproj -c Release -r osx-x64 --self-contained=true -o $OutputPath64
|
||||
dotnet publish ./v2rayN.Desktop/v2rayN.Desktop.csproj -c Release -r osx-arm64 --self-contained=true -o $OutputPathArm64
|
||||
dotnet publish ./AmazTool/AmazTool.csproj -c Release -r osx-x64 --self-contained=true -p:PublishTrimmed=true -o $OutputPath64
|
||||
dotnet publish ./AmazTool/AmazTool.csproj -c Release -r osx-arm64 --self-contained=true -p:PublishTrimmed=true -o $OutputPathArm64
|
||||
|
||||
- name: Upload build artifacts
|
||||
uses: actions/upload-artifact@v4.6.0
|
||||
|
||||
28
.github/workflows/build-windows-desktop.yml
vendored
28
.github/workflows/build-windows-desktop.yml
vendored
@@ -36,10 +36,10 @@ jobs:
|
||||
- name: Build
|
||||
run: |
|
||||
cd v2rayN
|
||||
dotnet publish ./v2rayN.Desktop/v2rayN.Desktop.csproj -c Release -r win-x64 --self-contained=true -p:PublishReadyToRun=false -p:PublishSingleFile=true -p:EnableWindowsTargeting=true -o $OutputPath64
|
||||
dotnet publish ./v2rayN.Desktop/v2rayN.Desktop.csproj -c Release -r win-arm64 --self-contained=true -p:PublishReadyToRun=false -p:PublishSingleFile=true -p:EnableWindowsTargeting=true -o $OutputPathArm64
|
||||
dotnet publish ./AmazTool/AmazTool.csproj -c Release -r win-x64 --self-contained=true -p:PublishReadyToRun=false -p:PublishSingleFile=true -p:PublishTrimmed=true -p:EnableWindowsTargeting=true -o $OutputPath64
|
||||
dotnet publish ./AmazTool/AmazTool.csproj -c Release -r win-arm64 --self-contained=true -p:PublishReadyToRun=false -p:PublishSingleFile=true -p:PublishTrimmed=true -p:EnableWindowsTargeting=true -o $OutputPathArm64
|
||||
dotnet publish ./v2rayN.Desktop/v2rayN.Desktop.csproj -c Release -r win-x64 --self-contained=true -p:EnableWindowsTargeting=true -o $OutputPath64
|
||||
dotnet publish ./v2rayN.Desktop/v2rayN.Desktop.csproj -c Release -r win-arm64 --self-contained=true -p:EnableWindowsTargeting=true -o $OutputPathArm64
|
||||
dotnet publish ./AmazTool/AmazTool.csproj -c Release -r win-x64 --self-contained=true -p:EnableWindowsTargeting=true -p:PublishTrimmed=true -o $OutputPath64
|
||||
dotnet publish ./AmazTool/AmazTool.csproj -c Release -r win-arm64 --self-contained=true -p:EnableWindowsTargeting=true -p:PublishTrimmed=true -o $OutputPathArm64
|
||||
|
||||
- name: Upload build artifacts
|
||||
uses: actions/upload-artifact@v4.6.0
|
||||
@@ -47,4 +47,22 @@ jobs:
|
||||
name: v2rayN-windows-desktop
|
||||
path: |
|
||||
${{ github.workspace }}/v2rayN/Release/windows*
|
||||
|
||||
|
||||
# release zip archive
|
||||
- name: Package release zip archive
|
||||
if: github.event.inputs.release_tag != ''
|
||||
run: |
|
||||
chmod 755 package-release-zip.sh
|
||||
./package-release-zip.sh $OutputArch $OutputPath64
|
||||
mv "v2rayN-${OutputArch}.zip" "v2rayN-${OutputArch}-desktop.zip"
|
||||
./package-release-zip.sh $OutputArchArm $OutputPathArm64
|
||||
mv "v2rayN-${OutputArchArm}.zip" "v2rayN-${OutputArchArm}-desktop.zip"
|
||||
|
||||
- name: Upload zip archive to release
|
||||
uses: svenstaro/upload-release-action@v2
|
||||
if: github.event.inputs.release_tag != ''
|
||||
with:
|
||||
file: ${{ github.workspace }}/v2rayN*.zip
|
||||
tag: ${{ github.event.inputs.release_tag }}
|
||||
file_glob: true
|
||||
prerelease: true
|
||||
|
||||
12
.github/workflows/build-windows.yml
vendored
12
.github/workflows/build-windows.yml
vendored
@@ -37,12 +37,12 @@ jobs:
|
||||
- name: Build
|
||||
run: |
|
||||
cd v2rayN
|
||||
dotnet publish ./v2rayN/v2rayN.csproj -c Release -r win-x64 --self-contained=false -p:PublishReadyToRun=false -p:PublishSingleFile=true -p:EnableWindowsTargeting=true -o $OutputPath64
|
||||
dotnet publish ./v2rayN/v2rayN.csproj -c Release -r win-arm64 --self-contained=false -p:PublishReadyToRun=false -p:PublishSingleFile=true -p:EnableWindowsTargeting=true -o $OutputPathArm64
|
||||
dotnet publish ./v2rayN/v2rayN.csproj -c Release -r win-x64 --self-contained=true -p:PublishReadyToRun=false -p:PublishSingleFile=true -p:EnableWindowsTargeting=true -o $OutputPath64Sc
|
||||
dotnet publish ./AmazTool/AmazTool.csproj -c Release -r win-x64 --self-contained=false -p:PublishReadyToRun=false -p:PublishSingleFile=true -p:EnableWindowsTargeting=true -o $OutputPath64
|
||||
dotnet publish ./AmazTool/AmazTool.csproj -c Release -r win-arm64 --self-contained=false -p:PublishReadyToRun=false -p:PublishSingleFile=true -p:EnableWindowsTargeting=true -o $OutputPathArm64
|
||||
dotnet publish ./AmazTool/AmazTool.csproj -c Release -r win-x64 --self-contained=true -p:PublishReadyToRun=false -p:PublishSingleFile=true -p:PublishTrimmed=true -p:EnableWindowsTargeting=true -o $OutputPath64Sc
|
||||
dotnet publish ./v2rayN/v2rayN.csproj -c Release -r win-x64 --self-contained=false -p:EnableWindowsTargeting=true -o $OutputPath64
|
||||
dotnet publish ./v2rayN/v2rayN.csproj -c Release -r win-arm64 --self-contained=false -p:EnableWindowsTargeting=true -o $OutputPathArm64
|
||||
dotnet publish ./v2rayN/v2rayN.csproj -c Release -r win-x64 --self-contained=true -p:EnableWindowsTargeting=true -o $OutputPath64Sc
|
||||
dotnet publish ./AmazTool/AmazTool.csproj -c Release -r win-x64 --self-contained=false -p:EnableWindowsTargeting=true -o $OutputPath64
|
||||
dotnet publish ./AmazTool/AmazTool.csproj -c Release -r win-arm64 --self-contained=false -p:EnableWindowsTargeting=true -o $OutputPathArm64
|
||||
dotnet publish ./AmazTool/AmazTool.csproj -c Release -r win-x64 --self-contained=true -p:EnableWindowsTargeting=true -p:PublishTrimmed=true -o $OutputPath64Sc
|
||||
|
||||
|
||||
- name: Upload build artifacts
|
||||
|
||||
@@ -17,11 +17,9 @@ echo "When this file exists, app will not store configs under this folder" >"${P
|
||||
if [ $Arch = "linux-64" ]; then
|
||||
Arch2="x86_64"
|
||||
Arch3="amd64"
|
||||
Interpreter="ld-linux-x86-64.so.2"
|
||||
else
|
||||
Arch2="aarch64"
|
||||
Arch3="arm64"
|
||||
Interpreter="ld-linux-aarch64.so.1"
|
||||
fi
|
||||
echo $Arch2
|
||||
|
||||
@@ -31,7 +29,6 @@ cat >"${PackagePath}/AppDir/AppRun" <<-EOF
|
||||
HERE="\$(dirname "\$(readlink -f "\${0}")")"
|
||||
export PATH="\${HERE}"/opt/v2rayN/:"\${PATH}"
|
||||
export LD_LIBRARY_PATH="\${HERE}"/opt/v2rayN/:"\${LD_LIBRARY_PATH}"
|
||||
cd "\${HERE}/opt/v2rayN"
|
||||
exec "\${HERE}/opt/v2rayN/v2rayN" \$@
|
||||
EOF
|
||||
|
||||
@@ -48,41 +45,9 @@ EOF
|
||||
|
||||
sudo cp "${PackagePath}/AppDir/opt/v2rayN/v2rayN.png" "${PackagePath}/AppDir/v2rayN.png"
|
||||
sudo dpkg --add-architecture ${Arch3}
|
||||
sudo apt update
|
||||
mkdir deb_folder
|
||||
cd deb_folder
|
||||
apt download libstdc++6:${Arch3}
|
||||
apt download libc6:${Arch3}
|
||||
apt download libcrypt1:${Arch3}
|
||||
apt download libgcc-s1:${Arch3}
|
||||
apt download libidn2-0:${Arch3}
|
||||
apt download gcc-12-base:${Arch3}
|
||||
apt download zlib1g:${Arch3}
|
||||
apt download libfreetype6:${Arch3}
|
||||
apt download libexpat1:${Arch3}
|
||||
apt download libbrotli1:${Arch3}
|
||||
apt download libx11-6:${Arch3}
|
||||
apt download libx11-xcb1:${Arch3}
|
||||
apt download libxcb1:${Arch3}
|
||||
apt download libxau6:${Arch3}
|
||||
apt download libxdmcp6:${Arch3}
|
||||
apt download libbsd0:${Arch3}
|
||||
apt download libmd0:${Arch3}
|
||||
apt download libice6:${Arch3}
|
||||
apt download libsm6:${Arch3}
|
||||
apt download libuuid1:${Arch3}
|
||||
apt download libxrandr2:${Arch3}
|
||||
apt download libxext6:${Arch3}
|
||||
apt download libxrender1:${Arch3}
|
||||
apt download libxi6:${Arch3}
|
||||
apt download libsm6:${Arch3}
|
||||
apt download libxcursor1:${Arch3}
|
||||
apt download libxfixes3:${Arch3}
|
||||
apt download libpng16-16:${Arch3} || true
|
||||
apt download libpng16-16t64:${Arch3} || true
|
||||
apt download libicu66:${Arch3} || true
|
||||
apt download libicu70:${Arch3} || true
|
||||
apt download libicu74:${Arch3} || true
|
||||
apt download libicu74:${Arch3}
|
||||
apt download libfontconfig1:${Arch3} || true
|
||||
apt download libfontconfig:${Arch3} || true
|
||||
mkdir ../output_folder
|
||||
@@ -97,12 +62,6 @@ rm -rf deb_folder output_folder
|
||||
sudo chmod 0755 "${PackagePath}/AppDir/opt/v2rayN/v2rayN"
|
||||
sudo chmod 0755 "${PackagePath}/AppDir/AppRun"
|
||||
|
||||
sudo apt install -y patchelf
|
||||
|
||||
pushd "${PackagePath}/AppDir/opt/v2rayN"
|
||||
patchelf --set-interpreter ${Interpreter} v2rayN
|
||||
popd
|
||||
|
||||
# desktop && PATH
|
||||
|
||||
wget "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project>
|
||||
|
||||
<PropertyGroup>
|
||||
<Version>7.8.3</Version>
|
||||
<Version>7.9.1</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
@@ -28,5 +28,6 @@
|
||||
|
||||
<UseSystemResourceKeys>true</UseSystemResourceKeys>
|
||||
<PublishSingleFile>true</PublishSingleFile>
|
||||
<PublishReadyToRun>false</PublishReadyToRun>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
<CentralPackageVersionOverrideEnabled>false</CentralPackageVersionOverrideEnabled>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageVersion Include="Avalonia.Controls.DataGrid" Version="11.2.3" />
|
||||
<PackageVersion Include="Avalonia.Desktop" Version="11.2.3" />
|
||||
<PackageVersion Include="Avalonia.Diagnostics" Version="11.2.3" />
|
||||
<PackageVersion Include="Avalonia.ReactiveUI" Version="11.2.3" />
|
||||
<PackageVersion Include="CliWrap" Version="3.7.1" />
|
||||
<PackageVersion Include="Avalonia.Controls.DataGrid" Version="11.2.4" />
|
||||
<PackageVersion Include="Avalonia.Desktop" Version="11.2.4" />
|
||||
<PackageVersion Include="Avalonia.Diagnostics" Version="11.2.4" />
|
||||
<PackageVersion Include="Avalonia.ReactiveUI" Version="11.2.4" />
|
||||
<PackageVersion Include="CliWrap" Version="3.8.0" />
|
||||
<PackageVersion Include="Downloader" Version="3.3.3" />
|
||||
<PackageVersion Include="H.NotifyIcon.Wpf" Version="2.2.0" />
|
||||
<PackageVersion Include="MaterialDesignThemes" Version="5.2.1" />
|
||||
|
||||
@@ -86,17 +86,43 @@ public static class ProcUtils
|
||||
GetProcessKeyInfo(proc, review, out var procId, out var fileName, out var processName);
|
||||
|
||||
try
|
||||
{ proc?.Kill(true); }
|
||||
catch (Exception ex) { Logging.SaveLog(_tag, ex); }
|
||||
{
|
||||
if (Utils.IsNonWindows())
|
||||
{
|
||||
proc?.Kill(true);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logging.SaveLog(_tag, ex);
|
||||
}
|
||||
|
||||
try
|
||||
{ proc?.Kill(); }
|
||||
catch (Exception ex) { Logging.SaveLog(_tag, ex); }
|
||||
{
|
||||
proc?.Kill();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logging.SaveLog(_tag, ex);
|
||||
}
|
||||
|
||||
try
|
||||
{ proc?.Close(); }
|
||||
catch (Exception ex) { Logging.SaveLog(_tag, ex); }
|
||||
{
|
||||
proc?.Close();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logging.SaveLog(_tag, ex);
|
||||
}
|
||||
|
||||
try
|
||||
{ proc?.Dispose(); }
|
||||
catch (Exception ex) { Logging.SaveLog(_tag, ex); }
|
||||
{
|
||||
proc?.Dispose();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logging.SaveLog(_tag, ex);
|
||||
}
|
||||
|
||||
await Task.Delay(300);
|
||||
await ProcessKillByKeyInfo(review, procId, fileName, processName);
|
||||
|
||||
@@ -433,10 +433,22 @@ namespace ServiceLib.Common
|
||||
{
|
||||
try
|
||||
{
|
||||
var ipProperties = IPGlobalProperties.GetIPGlobalProperties();
|
||||
var ipEndPoints = ipProperties.GetActiveTcpListeners();
|
||||
//var lstIpEndPoints = new List<IPEndPoint>(IPGlobalProperties.GetIPGlobalProperties().GetActiveTcpListeners());
|
||||
return ipEndPoints.Any(endPoint => endPoint.Port == port);
|
||||
List<IPEndPoint> lstIpEndPoints = new();
|
||||
List<TcpConnectionInformation> lstTcpConns = new();
|
||||
|
||||
lstIpEndPoints.AddRange(IPGlobalProperties.GetIPGlobalProperties().GetActiveTcpListeners());
|
||||
lstIpEndPoints.AddRange(IPGlobalProperties.GetIPGlobalProperties().GetActiveUdpListeners());
|
||||
lstTcpConns.AddRange(IPGlobalProperties.GetIPGlobalProperties().GetActiveTcpConnections());
|
||||
|
||||
if (lstIpEndPoints?.FindIndex(it => it.Port == port) >= 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (lstTcpConns?.FindIndex(it => it.LocalEndPoint.Port == port) >= 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -786,6 +798,24 @@ namespace ServiceLib.Common
|
||||
}
|
||||
}
|
||||
|
||||
public static string GetBinConfigPath(string filename = "")
|
||||
{
|
||||
var tempPath = Path.Combine(StartupPath(), "binConfigs");
|
||||
if (!Directory.Exists(tempPath))
|
||||
{
|
||||
Directory.CreateDirectory(tempPath);
|
||||
}
|
||||
|
||||
if (Utils.IsNullOrEmpty(filename))
|
||||
{
|
||||
return tempPath;
|
||||
}
|
||||
else
|
||||
{
|
||||
return Path.Combine(tempPath, filename);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion TempPath
|
||||
|
||||
#region Platform
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace ServiceLib
|
||||
public const string ConfigFileName = "guiNConfig.json";
|
||||
public const string CoreConfigFileName = "config.json";
|
||||
public const string CorePreConfigFileName = "configPre.json";
|
||||
public const string CoreSpeedtestConfigFileName = "configSpeedtest.json";
|
||||
public const string CoreSpeedtestConfigFileName = "configTest{0}.json";
|
||||
public const string CoreMultipleLoadConfigFileName = "configMultipleLoad.json";
|
||||
public const string ClashMixinConfigFileName = "Mixin.yaml";
|
||||
|
||||
@@ -64,8 +64,6 @@ namespace ServiceLib
|
||||
public const string GrpcGunMode = "gun";
|
||||
public const string GrpcMultiMode = "multi";
|
||||
public const int MaxPort = 65536;
|
||||
public const string DelayUnit = "";
|
||||
public const string SpeedUnit = "";
|
||||
public const int MinFontSize = 8;
|
||||
public const string RebootAs = "rebootas";
|
||||
public const string AvaAssets = "avares://v2rayN/Assets/";
|
||||
@@ -105,10 +103,10 @@ namespace ServiceLib
|
||||
|
||||
public static readonly List<string> SpeedTestUrls =
|
||||
[
|
||||
@"https://speed.cloudflare.com/__down?bytes=100000000",
|
||||
@"https://speed.cloudflare.com/__down?bytes=50000000",
|
||||
@"https://cachefly.cachefly.net/50mb.test",
|
||||
@"https://speed.cloudflare.com/__down?bytes=10000000",
|
||||
@"https://cachefly.cachefly.net/50mb.test"
|
||||
@"https://speed.cloudflare.com/__down?bytes=50000000",
|
||||
@"https://speed.cloudflare.com/__down?bytes=100000000",
|
||||
];
|
||||
|
||||
public static readonly List<string> SpeedPingTestUrls =
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace ServiceLib.Handler
|
||||
namespace ServiceLib.Handler
|
||||
{
|
||||
public sealed class AppHandler
|
||||
{
|
||||
@@ -98,6 +98,7 @@
|
||||
{
|
||||
FileManager.DeleteExpiredFiles(Utils.GetLogPath(), DateTime.Now.AddMonths(-1));
|
||||
FileManager.DeleteExpiredFiles(Utils.GetTempPath(), DateTime.Now.AddMonths(-1));
|
||||
FileManager.DeleteExpiredFiles(Utils.GetBinConfigPath(), DateTime.Now.AddHours(-1));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -252,4 +253,4 @@
|
||||
|
||||
#endregion Core Type
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,6 +125,10 @@ namespace ServiceLib.Handler
|
||||
{
|
||||
config.SpeedTestItem.SpeedPingTestUrl = Global.SpeedPingTestUrl;
|
||||
}
|
||||
if (config.SpeedTestItem.MixedConcurrencyCount < 1)
|
||||
{
|
||||
config.SpeedTestItem.MixedConcurrencyCount = 5;
|
||||
}
|
||||
|
||||
config.Mux4RayItem ??= new()
|
||||
{
|
||||
@@ -290,7 +294,7 @@ namespace ServiceLib.Handler
|
||||
/// <param name="config"></param>
|
||||
/// <param name="indexes"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<int> RemoveServer(Config config, List<ProfileItem> indexes)
|
||||
public static async Task<int> RemoveServers(Config config, List<ProfileItem> indexes)
|
||||
{
|
||||
var subid = "TempRemoveSubId";
|
||||
foreach (var item in indexes)
|
||||
@@ -299,7 +303,7 @@ namespace ServiceLib.Handler
|
||||
}
|
||||
|
||||
await SQLiteHelper.Instance.UpdateAllAsync(indexes);
|
||||
await RemoveServerViaSubid(config, subid, false);
|
||||
await RemoveServersViaSubid(config, subid, false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -754,9 +758,9 @@ namespace ServiceLib.Handler
|
||||
Security = t.Security,
|
||||
Network = t.Network,
|
||||
StreamSecurity = t.StreamSecurity,
|
||||
Delay = t33 == null ? 0 : t33.Delay,
|
||||
Speed = t33 == null ? 0 : t33.Speed,
|
||||
Sort = t33 == null ? 0 : t33.Sort
|
||||
Delay = t33?.Delay ?? 0,
|
||||
Speed = t33?.Speed ?? 0,
|
||||
Sort = t33?.Sort ?? 0
|
||||
}).ToList();
|
||||
|
||||
Enum.TryParse(colName, true, out EServerColName name);
|
||||
@@ -882,7 +886,7 @@ namespace ServiceLib.Handler
|
||||
lstRemove.Add(item);
|
||||
}
|
||||
}
|
||||
await RemoveServer(config, lstRemove);
|
||||
await RemoveServers(config, lstRemove);
|
||||
|
||||
return new Tuple<int, int>(lstProfile.Count, lstKeep.Count);
|
||||
}
|
||||
@@ -1047,6 +1051,24 @@ namespace ServiceLib.Handler
|
||||
return itemSocks;
|
||||
}
|
||||
|
||||
public static async Task<int> RemoveInvalidServerResult(Config config, string subid)
|
||||
{
|
||||
var lstModel = await AppHandler.Instance.ProfileItems(subid, "");
|
||||
if (lstModel is { Count: <= 0 })
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
var lstProfileExs = await ProfileExHandler.Instance.GetProfileExs();
|
||||
var lstProfile = (from t in lstModel
|
||||
join t2 in lstProfileExs on t.IndexId equals t2.IndexId
|
||||
where t2.Delay == -1
|
||||
select t).ToList();
|
||||
|
||||
await RemoveServers(config, JsonUtils.Deserialize<List<ProfileItem>>(JsonUtils.Serialize(lstProfile)));
|
||||
|
||||
return lstProfile.Count;
|
||||
}
|
||||
|
||||
#endregion Server
|
||||
|
||||
#region Batch add servers
|
||||
@@ -1069,7 +1091,7 @@ namespace ServiceLib.Handler
|
||||
//remove sub items
|
||||
if (isSub && Utils.IsNotEmpty(subid))
|
||||
{
|
||||
await RemoveServerViaSubid(config, subid, isSub);
|
||||
await RemoveServersViaSubid(config, subid, isSub);
|
||||
subFilter = (await AppHandler.Instance.GetSubItem(subid))?.Filter ?? "";
|
||||
}
|
||||
|
||||
@@ -1163,7 +1185,7 @@ namespace ServiceLib.Handler
|
||||
{
|
||||
if (isSub && Utils.IsNotEmpty(subid))
|
||||
{
|
||||
await RemoveServerViaSubid(config, subid, isSub);
|
||||
await RemoveServersViaSubid(config, subid, isSub);
|
||||
}
|
||||
int count = 0;
|
||||
foreach (var it in lstProfiles)
|
||||
@@ -1219,7 +1241,7 @@ namespace ServiceLib.Handler
|
||||
|
||||
if (isSub && Utils.IsNotEmpty(subid))
|
||||
{
|
||||
await RemoveServerViaSubid(config, subid, isSub);
|
||||
await RemoveServersViaSubid(config, subid, isSub);
|
||||
}
|
||||
|
||||
profileItem.Subid = subid;
|
||||
@@ -1244,7 +1266,7 @@ namespace ServiceLib.Handler
|
||||
|
||||
if (isSub && Utils.IsNotEmpty(subid))
|
||||
{
|
||||
await RemoveServerViaSubid(config, subid, isSub);
|
||||
await RemoveServersViaSubid(config, subid, isSub);
|
||||
}
|
||||
|
||||
var lstSsServer = ShadowsocksFmt.ResolveSip008(strData);
|
||||
@@ -1431,7 +1453,7 @@ namespace ServiceLib.Handler
|
||||
/// <param name="config"></param>
|
||||
/// <param name="subid"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<int> RemoveServerViaSubid(Config config, string subid, bool isSub)
|
||||
public static async Task<int> RemoveServersViaSubid(Config config, string subid, bool isSub)
|
||||
{
|
||||
if (Utils.IsNullOrEmpty(subid))
|
||||
{
|
||||
@@ -1462,7 +1484,7 @@ namespace ServiceLib.Handler
|
||||
return 0;
|
||||
}
|
||||
await SQLiteHelper.Instance.DeleteAsync(item);
|
||||
await RemoveServerViaSubid(config, id, false);
|
||||
await RemoveServersViaSubid(config, id, false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace ServiceLib.Handler
|
||||
namespace ServiceLib.Handler
|
||||
{
|
||||
/// <summary>
|
||||
/// Core configuration file processing class
|
||||
@@ -109,6 +109,30 @@
|
||||
return result;
|
||||
}
|
||||
|
||||
public static async Task<RetResult> GenerateClientSpeedtestConfig(Config config, ProfileItem node, ServerTestItem testItem, string fileName)
|
||||
{
|
||||
var result = new RetResult();
|
||||
var initPort = AppHandler.Instance.GetLocalPort(EInboundProtocol.speedtest);
|
||||
var port = Utils.GetFreePort(initPort + testItem.QueueNum);
|
||||
testItem.Port = port;
|
||||
|
||||
if (AppHandler.Instance.GetCoreType(node, node.ConfigType) == ECoreType.sing_box)
|
||||
{
|
||||
result = await new CoreConfigSingboxService(config).GenerateClientSpeedtestConfig(node, port);
|
||||
}
|
||||
else
|
||||
{
|
||||
result = await new CoreConfigV2rayService(config).GenerateClientSpeedtestConfig(node, port);
|
||||
}
|
||||
if (result.Success != true)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
await File.WriteAllTextAsync(fileName, result.Data.ToString());
|
||||
return result;
|
||||
}
|
||||
|
||||
public static async Task<RetResult> GenerateClientMultipleLoadConfig(Config config, string fileName, List<ProfileItem> selecteds, ECoreType coreType)
|
||||
{
|
||||
var result = new RetResult();
|
||||
@@ -129,4 +153,4 @@
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace ServiceLib.Handler
|
||||
return;
|
||||
}
|
||||
|
||||
var fileName = Utils.GetConfigPath(Global.CoreConfigFileName);
|
||||
var fileName = Utils.GetBinConfigPath(Global.CoreConfigFileName);
|
||||
var result = await CoreConfigHandler.GenerateClientConfig(node, fileName);
|
||||
if (result.Success != true)
|
||||
{
|
||||
@@ -101,7 +101,8 @@ namespace ServiceLib.Handler
|
||||
public async Task<int> LoadCoreConfigSpeedtest(List<ServerTestItem> selecteds)
|
||||
{
|
||||
var coreType = selecteds.Exists(t => t.ConfigType is EConfigType.Hysteria2 or EConfigType.TUIC or EConfigType.WireGuard) ? ECoreType.sing_box : ECoreType.Xray;
|
||||
var configPath = Utils.GetConfigPath(Global.CoreSpeedtestConfigFileName);
|
||||
var fileName = string.Format(Global.CoreSpeedtestConfigFileName, Utils.GetGuid(false));
|
||||
var configPath = Utils.GetBinConfigPath(fileName);
|
||||
var result = await CoreConfigHandler.GenerateClientSpeedtestConfig(_config, configPath, selecteds, coreType);
|
||||
UpdateFunc(false, result.Msg);
|
||||
if (result.Success != true)
|
||||
@@ -113,7 +114,34 @@ namespace ServiceLib.Handler
|
||||
UpdateFunc(false, configPath);
|
||||
|
||||
var coreInfo = CoreInfoHandler.Instance.GetCoreInfo(coreType);
|
||||
var proc = await RunProcess(coreInfo, Global.CoreSpeedtestConfigFileName, true, false);
|
||||
var proc = await RunProcess(coreInfo, fileName, true, false);
|
||||
if (proc is null)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
return proc.Id;
|
||||
}
|
||||
|
||||
public async Task<int> LoadCoreConfigSpeedtest(ServerTestItem testItem)
|
||||
{
|
||||
var node = await AppHandler.Instance.GetProfileItem(testItem.IndexId);
|
||||
if (node is null)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
var fileName = string.Format(Global.CoreSpeedtestConfigFileName, Utils.GetGuid(false));
|
||||
var configPath = Utils.GetBinConfigPath(fileName);
|
||||
var result = await CoreConfigHandler.GenerateClientSpeedtestConfig(_config, node, testItem, configPath);
|
||||
if (result.Success != true)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
var coreType = AppHandler.Instance.GetCoreType(node, node.ConfigType);
|
||||
var coreInfo = CoreInfoHandler.Instance.GetCoreInfo(coreType);
|
||||
var proc = await RunProcess(coreInfo, fileName, true, false);
|
||||
if (proc is null)
|
||||
{
|
||||
return -1;
|
||||
@@ -175,7 +203,7 @@ namespace ServiceLib.Handler
|
||||
if (itemSocks != null)
|
||||
{
|
||||
var preCoreType = itemSocks.CoreType ?? ECoreType.sing_box;
|
||||
var fileName = Utils.GetConfigPath(Global.CorePreConfigFileName);
|
||||
var fileName = Utils.GetBinConfigPath(Global.CorePreConfigFileName);
|
||||
var result = await CoreConfigHandler.GenerateClientConfig(itemSocks, fileName);
|
||||
if (result.Success)
|
||||
{
|
||||
@@ -225,8 +253,8 @@ namespace ServiceLib.Handler
|
||||
StartInfo = new()
|
||||
{
|
||||
FileName = fileName,
|
||||
Arguments = string.Format(coreInfo.Arguments, coreInfo.AbsolutePath ? Utils.GetConfigPath(configPath) : configPath),
|
||||
WorkingDirectory = Utils.GetConfigPath(),
|
||||
Arguments = string.Format(coreInfo.Arguments, coreInfo.AbsolutePath ? Utils.GetBinConfigPath(configPath) : configPath),
|
||||
WorkingDirectory = Utils.GetBinConfigPath(),
|
||||
UseShellExecute = false,
|
||||
RedirectStandardOutput = displayLog,
|
||||
RedirectStandardError = displayLog,
|
||||
@@ -298,7 +326,7 @@ namespace ServiceLib.Handler
|
||||
|
||||
private async Task RunProcessAsLinuxSudo(Process proc, string fileName, CoreInfo coreInfo, string configPath)
|
||||
{
|
||||
var cmdLine = $"{fileName.AppendQuotes()} {string.Format(coreInfo.Arguments, Utils.GetConfigPath(configPath).AppendQuotes())}";
|
||||
var cmdLine = $"{fileName.AppendQuotes()} {string.Format(coreInfo.Arguments, Utils.GetBinConfigPath(configPath).AppendQuotes())}";
|
||||
|
||||
var shFilePath = await CreateLinuxShellFile(cmdLine, "run_as_sudo.sh");
|
||||
proc.StartInfo.FileName = shFilePath;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Concurrent;
|
||||
|
||||
//using System.Reactive.Linq;
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace ServiceLib.Handler
|
||||
{
|
||||
private static readonly Lazy<ProfileExHandler> _instance = new(() => new());
|
||||
private ConcurrentBag<ProfileExItem> _lstProfileEx = [];
|
||||
private Queue<string> _queIndexIds = new();
|
||||
private readonly Queue<string> _queIndexIds = new();
|
||||
public static ProfileExHandler Instance => _instance.Value;
|
||||
private static readonly string _tag = "ProfileExHandler";
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace ServiceLib.Handler
|
||||
List<ProfileExItem> lstInserts = [];
|
||||
List<ProfileExItem> lstUpdates = [];
|
||||
|
||||
for (int i = 0; i < cnt; i++)
|
||||
for (var i = 0; i < cnt; i++)
|
||||
{
|
||||
var id = _queIndexIds.Dequeue();
|
||||
var item = lstExists.FirstOrDefault(t => t.IndexId == id);
|
||||
@@ -78,13 +78,18 @@ namespace ServiceLib.Handler
|
||||
lstInserts.Add(itemNew);
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
if (lstInserts.Count() > 0)
|
||||
if (lstInserts.Count > 0)
|
||||
{
|
||||
await SQLiteHelper.Instance.InsertAllAsync(lstInserts);
|
||||
}
|
||||
|
||||
if (lstUpdates.Count() > 0)
|
||||
if (lstUpdates.Count > 0)
|
||||
{
|
||||
await SQLiteHelper.Instance.UpdateAllAsync(lstUpdates);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -93,17 +98,24 @@ namespace ServiceLib.Handler
|
||||
}
|
||||
}
|
||||
|
||||
private void AddProfileEx(string indexId, ref ProfileExItem? profileEx)
|
||||
private ProfileExItem AddProfileEx(string indexId)
|
||||
{
|
||||
profileEx = new()
|
||||
var profileEx = new ProfileExItem()
|
||||
{
|
||||
IndexId = indexId,
|
||||
Delay = 0,
|
||||
Speed = 0,
|
||||
Sort = 0
|
||||
Sort = 0,
|
||||
Message = string.Empty
|
||||
};
|
||||
_lstProfileEx.Add(profileEx);
|
||||
IndexIdEnqueue(indexId);
|
||||
return profileEx;
|
||||
}
|
||||
|
||||
private ProfileExItem GetProfileExItem(string? indexId)
|
||||
{
|
||||
return _lstProfileEx.FirstOrDefault(t => t.IndexId == indexId) ?? AddProfileEx(indexId);
|
||||
}
|
||||
|
||||
public async Task ClearAll()
|
||||
@@ -124,39 +136,34 @@ namespace ServiceLib.Handler
|
||||
}
|
||||
}
|
||||
|
||||
public void SetTestDelay(string indexId, string delayVal)
|
||||
public void SetTestDelay(string indexId, int delay)
|
||||
{
|
||||
var profileEx = _lstProfileEx.FirstOrDefault(t => t.IndexId == indexId);
|
||||
if (profileEx == null)
|
||||
{
|
||||
AddProfileEx(indexId, ref profileEx);
|
||||
}
|
||||
var profileEx = GetProfileExItem(indexId);
|
||||
|
||||
int.TryParse(delayVal, out int delay);
|
||||
profileEx.Delay = delay;
|
||||
IndexIdEnqueue(indexId);
|
||||
}
|
||||
|
||||
public void SetTestSpeed(string indexId, string speedVal)
|
||||
public void SetTestSpeed(string indexId, decimal speed)
|
||||
{
|
||||
var profileEx = _lstProfileEx.FirstOrDefault(t => t.IndexId == indexId);
|
||||
if (profileEx == null)
|
||||
{
|
||||
AddProfileEx(indexId, ref profileEx);
|
||||
}
|
||||
var profileEx = GetProfileExItem(indexId);
|
||||
|
||||
decimal.TryParse(speedVal, out decimal speed);
|
||||
profileEx.Speed = speed;
|
||||
IndexIdEnqueue(indexId);
|
||||
}
|
||||
|
||||
public void SetTestMessage(string indexId, string message)
|
||||
{
|
||||
var profileEx = GetProfileExItem(indexId);
|
||||
|
||||
profileEx.Message = message;
|
||||
IndexIdEnqueue(indexId);
|
||||
}
|
||||
|
||||
public void SetSort(string indexId, int sort)
|
||||
{
|
||||
var profileEx = _lstProfileEx.FirstOrDefault(t => t.IndexId == indexId);
|
||||
if (profileEx == null)
|
||||
{
|
||||
AddProfileEx(indexId, ref profileEx);
|
||||
}
|
||||
var profileEx = GetProfileExItem(indexId);
|
||||
|
||||
profileEx.Sort = sort;
|
||||
IndexIdEnqueue(indexId);
|
||||
}
|
||||
@@ -180,4 +187,4 @@ namespace ServiceLib.Handler
|
||||
return _lstProfileEx.Max(t => t == null ? 0 : t.Sort);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace ServiceLib.Models
|
||||
namespace ServiceLib.Models
|
||||
{
|
||||
[Serializable]
|
||||
public class CoreBasicItem
|
||||
@@ -156,7 +156,7 @@
|
||||
public int SpeedTestTimeout { get; set; }
|
||||
public string SpeedTestUrl { get; set; }
|
||||
public string SpeedPingTestUrl { get; set; }
|
||||
public int SpeedTestPageSize { get; set; }
|
||||
public int MixedConcurrencyCount { get; set; }
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
@@ -244,4 +244,4 @@
|
||||
public string? Length { get; set; }
|
||||
public string? Interval { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using SQLite;
|
||||
using SQLite;
|
||||
|
||||
namespace ServiceLib.Models
|
||||
{
|
||||
@@ -11,5 +11,6 @@ namespace ServiceLib.Models
|
||||
public int Delay { get; set; }
|
||||
public decimal Speed { get; set; }
|
||||
public int Sort { get; set; }
|
||||
public string? Message { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace ServiceLib.Models
|
||||
namespace ServiceLib.Models
|
||||
{
|
||||
[Serializable]
|
||||
public class ServerTestItem
|
||||
@@ -8,6 +8,6 @@
|
||||
public int Port { get; set; }
|
||||
public EConfigType ConfigType { get; set; }
|
||||
public bool AllowTest { get; set; }
|
||||
public int Delay { get; set; }
|
||||
public int QueueNum { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
82
v2rayN/ServiceLib/Resx/ResUI.Designer.cs
generated
82
v2rayN/ServiceLib/Resx/ResUI.Designer.cs
generated
@@ -61,7 +61,7 @@ namespace ServiceLib.Resx {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Do you want to append rules? Choose yes to append, choose otherwise to replace 的本地化字符串。
|
||||
/// 查找类似 Do you want to append rules? Choose yes to append, choose otherwise to replace. 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string AddBatchRoutingRulesYesNo {
|
||||
get {
|
||||
@@ -196,7 +196,7 @@ namespace ServiceLib.Resx {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Failed to run Core, please see the log 的本地化字符串。
|
||||
/// 查找类似 Failed to run Core, please check the prompt information 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string FailedToRunCore {
|
||||
get {
|
||||
@@ -1311,6 +1311,15 @@ namespace ServiceLib.Resx {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Remove invalid by test results 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string menuRemoveInvalidServerResult {
|
||||
get {
|
||||
return ResourceManager.GetString("menuRemoveInvalidServerResult", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Remove selected servers (Delete) 的本地化字符串。
|
||||
/// </summary>
|
||||
@@ -1680,6 +1689,15 @@ namespace ServiceLib.Resx {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 By test result 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string menuTestServerResult {
|
||||
get {
|
||||
return ResourceManager.GetString("menuTestServerResult", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 {0} Website 的本地化字符串。
|
||||
/// </summary>
|
||||
@@ -1689,15 +1707,6 @@ namespace ServiceLib.Resx {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Clear original subscription content 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string MsgClearSubscription {
|
||||
get {
|
||||
return ResourceManager.GetString("MsgClearSubscription", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Download GeoFile: {0} successfully 的本地化字符串。
|
||||
/// </summary>
|
||||
@@ -2004,6 +2013,15 @@ namespace ServiceLib.Resx {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Removed {0} invalid test results. 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string RemoveInvalidServerResultTip {
|
||||
get {
|
||||
return ResourceManager.GetString("RemoveInvalidServerResultTip", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Are you sure to remove the rules? 的本地化字符串。
|
||||
/// </summary>
|
||||
@@ -2204,7 +2222,7 @@ namespace ServiceLib.Resx {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 AutoRefresh 的本地化字符串。
|
||||
/// 查找类似 Auto refresh 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string TbAutoRefresh {
|
||||
get {
|
||||
@@ -2213,7 +2231,7 @@ namespace ServiceLib.Resx {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Auto ScrollToEnd 的本地化字符串。
|
||||
/// 查找类似 Auto scroll to end 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string TbAutoScrollToEnd {
|
||||
get {
|
||||
@@ -3112,15 +3130,6 @@ namespace ServiceLib.Resx {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 HTTP Port 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string TbSettingsHttpPort {
|
||||
get {
|
||||
return ResourceManager.GetString("TbSettingsHttpPort", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Hysteria Max bandwidth (Up/Dw) 的本地化字符串。
|
||||
/// </summary>
|
||||
@@ -3176,7 +3185,7 @@ namespace ServiceLib.Resx {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 The password is encrypted and stored only in local files. 的本地化字符串。
|
||||
/// 查找类似 The password is encrypted and stored only in local files 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string TbSettingsLinuxSudoPasswordTip {
|
||||
get {
|
||||
@@ -3220,6 +3229,15 @@ namespace ServiceLib.Resx {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 The number of concurrent during multi-test 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string TbSettingsMixedConcurrencyCount {
|
||||
get {
|
||||
return ResourceManager.GetString("TbSettingsMixedConcurrencyCount", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 sing-box Mux Protocol 的本地化字符串。
|
||||
/// </summary>
|
||||
@@ -3355,15 +3373,6 @@ namespace ServiceLib.Resx {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Number per time for auto batch during speedtest(max 1000) 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string TbSettingsSpeedTestPageSize {
|
||||
get {
|
||||
return ResourceManager.GetString("TbSettingsSpeedTestPageSize", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 SpeedTest Single Timeout Value 的本地化字符串。
|
||||
/// </summary>
|
||||
@@ -3877,15 +3886,6 @@ namespace ServiceLib.Resx {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 You are currently running a standalone package, please manually download the SelfContained.7z file to unzip and overwrite it! 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string UpdateStandalonePackageTip {
|
||||
get {
|
||||
return ResourceManager.GetString("UpdateStandalonePackageTip", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 UpgradeApp does not exist 的本地化字符串。
|
||||
/// </summary>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
@@ -210,9 +210,6 @@
|
||||
<data name="LvTransportProtocol" xml:space="preserve">
|
||||
<value>جابجایی</value>
|
||||
</data>
|
||||
<data name="MsgClearSubscription" xml:space="preserve">
|
||||
<value>محتوای اشتراک اصلی را پاک کنید</value>
|
||||
</data>
|
||||
<data name="MsgDownloadV2rayCoreSuccessfully" xml:space="preserve">
|
||||
<value>دانلود Core با موفقیت</value>
|
||||
</data>
|
||||
@@ -715,9 +712,6 @@
|
||||
<data name="TbSettingsExceptionTip" xml:space="preserve">
|
||||
<value>استثناها: از سرور پروکسی برای آدرس هایی که با موارد زیر شروع می شوند استفاده نکنید. برای جدا کردن ورودی ها از نقطه ویرگول (;) استفاده کنید.</value>
|
||||
</data>
|
||||
<data name="TbSettingsHttpPort" xml:space="preserve">
|
||||
<value>پورت Http</value>
|
||||
</data>
|
||||
<data name="TbSettingsDisplayRealTimeSpeed" xml:space="preserve">
|
||||
<value>نمایش سرعت واقعی (نیاز به راه اندازی مجدد)</value>
|
||||
</data>
|
||||
@@ -1051,9 +1045,6 @@
|
||||
<data name="menuShowOrHideMainWindow" xml:space="preserve">
|
||||
<value>نمایش یا پنهان کردن پنجره اصلی</value>
|
||||
</data>
|
||||
<data name="UpdateStandalonePackageTip" xml:space="preserve">
|
||||
<value>شما در حال حاضر در حال اجرای یک بسته مستقل هستید، لطفاً فایل SelfContained.7z را به صورت دستی دانلود کنید تا آن را از حالت فشرده خارج کرده و بازنویسی کنید!</value>
|
||||
</data>
|
||||
<data name="TbPreSocksPort4Sub" xml:space="preserve">
|
||||
<value>پیکربندی سفارشی ساکس پورت</value>
|
||||
</data>
|
||||
@@ -1372,8 +1363,8 @@
|
||||
<data name="TbSettingsHide2TrayWhenClose" xml:space="preserve">
|
||||
<value>هنگام بستن پنجره در سینی پنهان شوید</value>
|
||||
</data>
|
||||
<data name="TbSettingsSpeedTestPageSize" xml:space="preserve">
|
||||
<value>تعداد در هر زمان برای دسته خودکار در طول تست سرعت (حداکثر 1000)</value>
|
||||
<data name="TbSettingsMixedConcurrencyCount" xml:space="preserve">
|
||||
<value>The number of concurrent during multi-test</value>
|
||||
</data>
|
||||
<data name="TbSettingsExceptionTip2" xml:space="preserve">
|
||||
<value>موارد استثنا: از سرور پروکسی برای آدرس های زیر استفاده نکنید. برای جدا کردن ورودی ها از کاما (،) استفاده کنید.</value>
|
||||
@@ -1396,4 +1387,13 @@
|
||||
<data name="SpeedtestingTestFailedPart" xml:space="preserve">
|
||||
<value>شروع آزمایش مجدد قطعات ناموفق، {0} باقی مانده است. برای خاتمه ESC را فشار دهید...</value>
|
||||
</data>
|
||||
</root>
|
||||
<data name="menuTestServerResult" xml:space="preserve">
|
||||
<value>By test result</value>
|
||||
</data>
|
||||
<data name="menuRemoveInvalidServerResult" xml:space="preserve">
|
||||
<value>Remove invalid by test results</value>
|
||||
</data>
|
||||
<data name="RemoveInvalidServerResultTip" xml:space="preserve">
|
||||
<value>Removed {0} invalid test results.</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
@@ -210,9 +210,6 @@
|
||||
<data name="LvTransportProtocol" xml:space="preserve">
|
||||
<value>Szállítás</value>
|
||||
</data>
|
||||
<data name="MsgClearSubscription" xml:space="preserve">
|
||||
<value>Eredeti előfizetési tartalom törlése</value>
|
||||
</data>
|
||||
<data name="MsgDownloadV2rayCoreSuccessfully" xml:space="preserve">
|
||||
<value>A Core letöltése sikerült</value>
|
||||
</data>
|
||||
@@ -715,9 +712,6 @@
|
||||
<data name="TbSettingsExceptionTip" xml:space="preserve">
|
||||
<value>Kivétel. Ne használjon proxy szervert a címek esetében, amelyek pontosan itt kezdődnek, használjon pontosvesszőt (;)</value>
|
||||
</data>
|
||||
<data name="TbSettingsHttpPort" xml:space="preserve">
|
||||
<value>HTTP Port</value>
|
||||
</data>
|
||||
<data name="TbSettingsDisplayRealTimeSpeed" xml:space="preserve">
|
||||
<value>Display real-time speed</value>
|
||||
</data>
|
||||
@@ -1255,9 +1249,6 @@
|
||||
<data name="menuShowOrHideMainWindow" xml:space="preserve">
|
||||
<value>Fő ablak megjelenítése vagy elrejtése</value>
|
||||
</data>
|
||||
<data name="UpdateStandalonePackageTip" xml:space="preserve">
|
||||
<value>Jelenleg egy önálló csomagot futtatsz, kérlek, töltsd le manuálisan a SelfContained.7z fájlt, bontsd ki és írd felül!</value>
|
||||
</data>
|
||||
<data name="TbPreSocksPort4Sub" xml:space="preserve">
|
||||
<value>Testreszabott konfigurációs socks port</value>
|
||||
</data>
|
||||
@@ -1372,8 +1363,8 @@
|
||||
<data name="TbSettingsHide2TrayWhenClose" xml:space="preserve">
|
||||
<value>Minimálás tálcára ablak zárásakor</value>
|
||||
</data>
|
||||
<data name="TbSettingsSpeedTestPageSize" xml:space="preserve">
|
||||
<value>Szám / időszak az automatikus batch során a sebességvizsgálat során (maximum 1000)</value>
|
||||
<data name="TbSettingsMixedConcurrencyCount" xml:space="preserve">
|
||||
<value>The number of concurrent during multi-test</value>
|
||||
</data>
|
||||
<data name="TbSettingsExceptionTip2" xml:space="preserve">
|
||||
<value>Kivétel. Ne használj proxy szervert a címeknél, évezz pontosvesszőt (,)</value>
|
||||
@@ -1396,4 +1387,13 @@
|
||||
<data name="SpeedtestingTestFailedPart" xml:space="preserve">
|
||||
<value>Starting retesting failed parts, {0} remaining. Press ESC to terminate...</value>
|
||||
</data>
|
||||
<data name="menuTestServerResult" xml:space="preserve">
|
||||
<value>By test result</value>
|
||||
</data>
|
||||
<data name="menuRemoveInvalidServerResult" xml:space="preserve">
|
||||
<value>Remove invalid by test results</value>
|
||||
</data>
|
||||
<data name="RemoveInvalidServerResultTip" xml:space="preserve">
|
||||
<value>Removed {0} invalid test results.</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
@@ -210,9 +210,6 @@
|
||||
<data name="LvTransportProtocol" xml:space="preserve">
|
||||
<value>Transport</value>
|
||||
</data>
|
||||
<data name="MsgClearSubscription" xml:space="preserve">
|
||||
<value>Clear original subscription content</value>
|
||||
</data>
|
||||
<data name="MsgDownloadV2rayCoreSuccessfully" xml:space="preserve">
|
||||
<value>Download Core successfully</value>
|
||||
</data>
|
||||
@@ -329,7 +326,7 @@
|
||||
<value>Please fill in the URL</value>
|
||||
</data>
|
||||
<data name="AddBatchRoutingRulesYesNo" xml:space="preserve">
|
||||
<value>Do you want to append rules? Choose yes to append, choose otherwise to replace</value>
|
||||
<value>Do you want to append rules? Choose yes to append, choose otherwise to replace.</value>
|
||||
</data>
|
||||
<data name="MsgDownloadGeoFileSuccessfully" xml:space="preserve">
|
||||
<value>Download GeoFile: {0} successfully</value>
|
||||
@@ -715,9 +712,6 @@
|
||||
<data name="TbSettingsExceptionTip" xml:space="preserve">
|
||||
<value>Exclusions: Do not use proxy server for addresses beginning with the following. Use semicolon (;) to separate entries.</value>
|
||||
</data>
|
||||
<data name="TbSettingsHttpPort" xml:space="preserve">
|
||||
<value>HTTP Port</value>
|
||||
</data>
|
||||
<data name="TbSettingsDisplayRealTimeSpeed" xml:space="preserve">
|
||||
<value>Display real-time speed (requires restart)</value>
|
||||
</data>
|
||||
@@ -926,7 +920,7 @@
|
||||
<value>Speed(M/s)</value>
|
||||
</data>
|
||||
<data name="FailedToRunCore" xml:space="preserve">
|
||||
<value>Failed to run Core, please see the log</value>
|
||||
<value>Failed to run Core, please check the prompt information</value>
|
||||
</data>
|
||||
<data name="LvFilter" xml:space="preserve">
|
||||
<value>Remarks regular filter</value>
|
||||
@@ -950,7 +944,7 @@
|
||||
<value>Enable sorting servers by drag-n-drop (requires restart)</value>
|
||||
</data>
|
||||
<data name="TbAutoRefresh" xml:space="preserve">
|
||||
<value>AutoRefresh</value>
|
||||
<value>Auto refresh</value>
|
||||
</data>
|
||||
<data name="SpeedtestingSkip" xml:space="preserve">
|
||||
<value>Skip test</value>
|
||||
@@ -1115,7 +1109,7 @@
|
||||
<value>(Domain or IP or ProcName) and Port and Protocol and InboundTag => OutboundTag</value>
|
||||
</data>
|
||||
<data name="TbAutoScrollToEnd" xml:space="preserve">
|
||||
<value>Auto ScrollToEnd</value>
|
||||
<value>Auto scroll to end</value>
|
||||
</data>
|
||||
<data name="TbSettingsSpeedPingTestUrl" xml:space="preserve">
|
||||
<value>Speed Ping Test URL</value>
|
||||
@@ -1255,9 +1249,6 @@
|
||||
<data name="menuShowOrHideMainWindow" xml:space="preserve">
|
||||
<value>Show or hide the main window</value>
|
||||
</data>
|
||||
<data name="UpdateStandalonePackageTip" xml:space="preserve">
|
||||
<value>You are currently running a standalone package, please manually download the SelfContained.7z file to unzip and overwrite it!</value>
|
||||
</data>
|
||||
<data name="TbPreSocksPort4Sub" xml:space="preserve">
|
||||
<value>Custom config socks port</value>
|
||||
</data>
|
||||
@@ -1355,7 +1346,7 @@
|
||||
<value>System sudo password</value>
|
||||
</data>
|
||||
<data name="TbSettingsLinuxSudoPasswordTip" xml:space="preserve">
|
||||
<value>The password is encrypted and stored only in local files.</value>
|
||||
<value>The password is encrypted and stored only in local files</value>
|
||||
</data>
|
||||
<data name="TbSettingsLinuxSudoPasswordIsEmpty" xml:space="preserve">
|
||||
<value>Please set the sudo password in Tun mode settings first</value>
|
||||
@@ -1372,8 +1363,8 @@
|
||||
<data name="TbSettingsHide2TrayWhenClose" xml:space="preserve">
|
||||
<value>Hide to tray when closing the window</value>
|
||||
</data>
|
||||
<data name="TbSettingsSpeedTestPageSize" xml:space="preserve">
|
||||
<value>Number per time for auto batch during speedtest(max 1000)</value>
|
||||
<data name="TbSettingsMixedConcurrencyCount" xml:space="preserve">
|
||||
<value>The number of concurrent during multi-test</value>
|
||||
</data>
|
||||
<data name="TbSettingsExceptionTip2" xml:space="preserve">
|
||||
<value>Exclusions: Do not use proxy server for the following addresses. Use comma (,) to separate entries.</value>
|
||||
@@ -1396,4 +1387,13 @@
|
||||
<data name="SpeedtestingTestFailedPart" xml:space="preserve">
|
||||
<value>Starting retesting failed parts, {0} remaining. Press ESC to terminate...</value>
|
||||
</data>
|
||||
<data name="menuTestServerResult" xml:space="preserve">
|
||||
<value>By test result</value>
|
||||
</data>
|
||||
<data name="menuRemoveInvalidServerResult" xml:space="preserve">
|
||||
<value>Remove invalid by test results</value>
|
||||
</data>
|
||||
<data name="RemoveInvalidServerResultTip" xml:space="preserve">
|
||||
<value>Removed {0} invalid test results.</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
@@ -210,9 +210,6 @@
|
||||
<data name="LvTransportProtocol" xml:space="preserve">
|
||||
<value>Протокол</value>
|
||||
</data>
|
||||
<data name="MsgClearSubscription" xml:space="preserve">
|
||||
<value>Очистить контент оригинальной подписки</value>
|
||||
</data>
|
||||
<data name="MsgDownloadV2rayCoreSuccessfully" xml:space="preserve">
|
||||
<value>Ядро успешно загружено</value>
|
||||
</data>
|
||||
@@ -721,9 +718,6 @@
|
||||
<data name="TbSettingsExceptionTip" xml:space="preserve">
|
||||
<value>Исключение. Не используйте прокси-сервер для адресов, начинающихся с (,), используйте точку с запятой (;)</value>
|
||||
</data>
|
||||
<data name="TbSettingsHttpPort" xml:space="preserve">
|
||||
<value>HTTP порт</value>
|
||||
</data>
|
||||
<data name="TbSettingsDisplayRealTimeSpeed" xml:space="preserve">
|
||||
<value>Display real-time speed</value>
|
||||
</data>
|
||||
@@ -1210,9 +1204,6 @@
|
||||
<data name="menuAddTuicServer" xml:space="preserve">
|
||||
<value>Add [TUIC] server</value>
|
||||
</data>
|
||||
<data name="UpdateStandalonePackageTip" xml:space="preserve">
|
||||
<value>You are currently running a standalone package, please manually download the SelfContained.7z file to unzip and overwrite it!</value>
|
||||
</data>
|
||||
<data name="TbSettingsEnableIPv6Address" xml:space="preserve">
|
||||
<value>Enable IPv6 Address</value>
|
||||
</data>
|
||||
@@ -1372,8 +1363,8 @@
|
||||
<data name="TbSettingsHide2TrayWhenClose" xml:space="preserve">
|
||||
<value>Hide to tray when closing the window</value>
|
||||
</data>
|
||||
<data name="TbSettingsSpeedTestPageSize" xml:space="preserve">
|
||||
<value>Number per time for auto batch during speedtest(max 1000)</value>
|
||||
<data name="TbSettingsMixedConcurrencyCount" xml:space="preserve">
|
||||
<value>The number of concurrent during multi-test</value>
|
||||
</data>
|
||||
<data name="TbSettingsExceptionTip2" xml:space="preserve">
|
||||
<value>Exception. Do not use proxy server for addresses,with a comma (,)</value>
|
||||
@@ -1396,4 +1387,13 @@
|
||||
<data name="SpeedtestingTestFailedPart" xml:space="preserve">
|
||||
<value>Starting retesting failed parts, {0} remaining. Press ESC to terminate...</value>
|
||||
</data>
|
||||
<data name="menuTestServerResult" xml:space="preserve">
|
||||
<value>By test result</value>
|
||||
</data>
|
||||
<data name="menuRemoveInvalidServerResult" xml:space="preserve">
|
||||
<value>Remove invalid by test results</value>
|
||||
</data>
|
||||
<data name="RemoveInvalidServerResultTip" xml:space="preserve">
|
||||
<value>Removed {0} invalid test results.</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
@@ -175,10 +175,10 @@
|
||||
<value>初始化配置</value>
|
||||
</data>
|
||||
<data name="IsLatestCore" xml:space="preserve">
|
||||
<value>{0} {1} 已是最新版本</value>
|
||||
<value>{0} {1} 已是最新版本。</value>
|
||||
</data>
|
||||
<data name="IsLatestN" xml:space="preserve">
|
||||
<value>{0} {1} 已是最新版本</value>
|
||||
<value>{0} {1} 已是最新版本。</value>
|
||||
</data>
|
||||
<data name="LvAddress" xml:space="preserve">
|
||||
<value>地址</value>
|
||||
@@ -210,9 +210,6 @@
|
||||
<data name="LvTransportProtocol" xml:space="preserve">
|
||||
<value>传输协议</value>
|
||||
</data>
|
||||
<data name="MsgClearSubscription" xml:space="preserve">
|
||||
<value>清除原订阅内容</value>
|
||||
</data>
|
||||
<data name="MsgDownloadV2rayCoreSuccessfully" xml:space="preserve">
|
||||
<value>下载Core成功</value>
|
||||
</data>
|
||||
@@ -277,7 +274,7 @@
|
||||
<value>请先选择服务器</value>
|
||||
</data>
|
||||
<data name="RemoveDuplicateServerResult" xml:space="preserve">
|
||||
<value>服务器去重完成。原数量: {0},现数量: {1}</value>
|
||||
<value>服务器去重完成。原数量: {0},现数量: {1}。</value>
|
||||
</data>
|
||||
<data name="RemoveServer" xml:space="preserve">
|
||||
<value>是否确定移除服务器?</value>
|
||||
@@ -715,9 +712,6 @@
|
||||
<data name="TbSettingsExceptionTip" xml:space="preserve">
|
||||
<value>例外:对于下列字符开头的地址,不使用代理配置文件。使用分号(;)分隔。</value>
|
||||
</data>
|
||||
<data name="TbSettingsHttpPort" xml:space="preserve">
|
||||
<value>本地http监听端口</value>
|
||||
</data>
|
||||
<data name="TbSettingsDisplayRealTimeSpeed" xml:space="preserve">
|
||||
<value>显示实时速度(需重启)</value>
|
||||
</data>
|
||||
@@ -926,7 +920,7 @@
|
||||
<value>速度(M/s)</value>
|
||||
</data>
|
||||
<data name="FailedToRunCore" xml:space="preserve">
|
||||
<value>运行Core失败,请查看日志</value>
|
||||
<value>运行 Core 失败,请查看提示信息</value>
|
||||
</data>
|
||||
<data name="LvFilter" xml:space="preserve">
|
||||
<value>别名正则过滤</value>
|
||||
@@ -1252,9 +1246,6 @@
|
||||
<data name="menuShowOrHideMainWindow" xml:space="preserve">
|
||||
<value>显示或隐藏主界面</value>
|
||||
</data>
|
||||
<data name="UpdateStandalonePackageTip" xml:space="preserve">
|
||||
<value>您当前运行的是独立包,请手动下载 SelfContained.7z文件解压覆盖!</value>
|
||||
</data>
|
||||
<data name="TbPreSocksPort4Sub" xml:space="preserve">
|
||||
<value>自定义配置的Socks端口</value>
|
||||
</data>
|
||||
@@ -1369,8 +1360,8 @@
|
||||
<data name="TbSettingsHide2TrayWhenClose" xml:space="preserve">
|
||||
<value>关闭窗口时隐藏至托盘</value>
|
||||
</data>
|
||||
<data name="TbSettingsSpeedTestPageSize" xml:space="preserve">
|
||||
<value>测试时自动分批的每批数量(最大1000)</value>
|
||||
<data name="TbSettingsMixedConcurrencyCount" xml:space="preserve">
|
||||
<value>多线程测试时的并发数量</value>
|
||||
</data>
|
||||
<data name="TbSettingsExceptionTip2" xml:space="preserve">
|
||||
<value>例外:对于下列地址不使用代理配置文件。使用逗号(,)分隔。</value>
|
||||
@@ -1393,4 +1384,13 @@
|
||||
<data name="SpeedtestingTestFailedPart" xml:space="preserve">
|
||||
<value>开始对失败部分进行重新测试,剩余 {0} 个。可按 ESC 终止...</value>
|
||||
</data>
|
||||
<data name="menuTestServerResult" xml:space="preserve">
|
||||
<value>按测试结果</value>
|
||||
</data>
|
||||
<data name="menuRemoveInvalidServerResult" xml:space="preserve">
|
||||
<value>按测试结果移除无效</value>
|
||||
</data>
|
||||
<data name="RemoveInvalidServerResultTip" xml:space="preserve">
|
||||
<value>移除无效测试结果 {0} 个。</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -175,10 +175,10 @@
|
||||
<value>初始化設定</value>
|
||||
</data>
|
||||
<data name="IsLatestCore" xml:space="preserve">
|
||||
<value>{0} {1} 已是最新版本</value>
|
||||
<value>{0} {1} 已是最新版本。</value>
|
||||
</data>
|
||||
<data name="IsLatestN" xml:space="preserve">
|
||||
<value>{0} {1} 已是最新版本</value>
|
||||
<value>{0} {1} 已是最新版本。</value>
|
||||
</data>
|
||||
<data name="LvAddress" xml:space="preserve">
|
||||
<value>位址</value>
|
||||
@@ -210,9 +210,6 @@
|
||||
<data name="LvTransportProtocol" xml:space="preserve">
|
||||
<value>傳輸協定</value>
|
||||
</data>
|
||||
<data name="MsgClearSubscription" xml:space="preserve">
|
||||
<value>清除原訂閱內容</value>
|
||||
</data>
|
||||
<data name="MsgDownloadV2rayCoreSuccessfully" xml:space="preserve">
|
||||
<value>下載Core成功</value>
|
||||
</data>
|
||||
@@ -277,7 +274,7 @@
|
||||
<value>請先選擇伺服器</value>
|
||||
</data>
|
||||
<data name="RemoveDuplicateServerResult" xml:space="preserve">
|
||||
<value>伺服器去重完成。原數量: {0},現數量: {1}</value>
|
||||
<value>伺服器去重完成。原數量: {0},現數量: {1}。</value>
|
||||
</data>
|
||||
<data name="RemoveServer" xml:space="preserve">
|
||||
<value>是否確定移除伺服器?</value>
|
||||
@@ -716,9 +713,6 @@
|
||||
<data name="TbSettingsExceptionTip" xml:space="preserve">
|
||||
<value>例外:對於下列字元開頭的位址,不使用代理設定檔。使用分號(;)分隔。</value>
|
||||
</data>
|
||||
<data name="TbSettingsHttpPort" xml:space="preserve">
|
||||
<value>本機HTTP偵聽埠</value>
|
||||
</data>
|
||||
<data name="TbSettingsDisplayRealTimeSpeed" xml:space="preserve">
|
||||
<value>顯示即時速度(需重啟)</value>
|
||||
</data>
|
||||
@@ -927,7 +921,7 @@
|
||||
<value>速度(M/s)</value>
|
||||
</data>
|
||||
<data name="FailedToRunCore" xml:space="preserve">
|
||||
<value>執行Core失敗,請查閲日誌</value>
|
||||
<value>執行Core失敗,請查看提示訊息</value>
|
||||
</data>
|
||||
<data name="LvFilter" xml:space="preserve">
|
||||
<value>別名正則過濾</value>
|
||||
@@ -1133,9 +1127,6 @@
|
||||
<data name="menuShowOrHideMainWindow" xml:space="preserve">
|
||||
<value>顯示或隱藏主介面</value>
|
||||
</data>
|
||||
<data name="UpdateStandalonePackageTip" xml:space="preserve">
|
||||
<value>您目前運行的是獨立包,請手動下載 SelfContained.7z檔案解壓縮覆蓋!</value>
|
||||
</data>
|
||||
<data name="TbPreSocksPort4Sub" xml:space="preserve">
|
||||
<value>自訂設定的Socks連接埠</value>
|
||||
</data>
|
||||
@@ -1370,8 +1361,8 @@
|
||||
<data name="TbSettingsHide2TrayWhenClose" xml:space="preserve">
|
||||
<value>關閉視窗時隱藏至托盤</value>
|
||||
</data>
|
||||
<data name="TbSettingsSpeedTestPageSize" xml:space="preserve">
|
||||
<value>測試時自動分批的每批數量(最大1000)</value>
|
||||
<data name="TbSettingsMixedConcurrencyCount" xml:space="preserve">
|
||||
<value>多執行緒測試時的並發數量</value>
|
||||
</data>
|
||||
<data name="TbSettingsExceptionTip2" xml:space="preserve">
|
||||
<value>例外:對於下列位址不使用代理設定檔,使用逗號(,)分隔。</value>
|
||||
@@ -1394,4 +1385,13 @@
|
||||
<data name="SpeedtestingTestFailedPart" xml:space="preserve">
|
||||
<value>開始對失敗部分進行重新測試,剩餘 {0} 個。可按 ESC 終止...</value>
|
||||
</data>
|
||||
<data name="menuTestServerResult" xml:space="preserve">
|
||||
<value>按測試結果</value>
|
||||
</data>
|
||||
<data name="menuRemoveInvalidServerResult" xml:space="preserve">
|
||||
<value>按測試結果移除無效</value>
|
||||
</data>
|
||||
<data name="RemoveInvalidServerResultTip" xml:space="preserve">
|
||||
<value>移除無效測試結果 {0} 個。</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -242,6 +242,66 @@ namespace ServiceLib.Services.CoreConfig
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<RetResult> GenerateClientSpeedtestConfig(ProfileItem node, int port)
|
||||
{
|
||||
var ret = new RetResult();
|
||||
try
|
||||
{
|
||||
if (node is not { Port: > 0 })
|
||||
{
|
||||
ret.Msg = ResUI.CheckServerSettings;
|
||||
return ret;
|
||||
}
|
||||
if (node.GetNetwork() is nameof(ETransport.kcp) or nameof(ETransport.xhttp))
|
||||
{
|
||||
ret.Msg = ResUI.Incorrectconfiguration + $" - {node.GetNetwork()}";
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret.Msg = ResUI.InitialConfiguration;
|
||||
|
||||
var result = EmbedUtils.GetEmbedText(Global.SingboxSampleClient);
|
||||
if (Utils.IsNullOrEmpty(result))
|
||||
{
|
||||
ret.Msg = ResUI.FailedGetDefaultConfiguration;
|
||||
return ret;
|
||||
}
|
||||
|
||||
var singboxConfig = JsonUtils.Deserialize<SingboxConfig>(result);
|
||||
if (singboxConfig == null)
|
||||
{
|
||||
ret.Msg = ResUI.FailedGenDefaultConfiguration;
|
||||
return ret;
|
||||
}
|
||||
|
||||
await GenLog(singboxConfig);
|
||||
await GenOutbound(node, singboxConfig.outbounds.First());
|
||||
await GenMoreOutbounds(node, singboxConfig);
|
||||
await GenDnsDomains(null, singboxConfig, null);
|
||||
|
||||
singboxConfig.route.rules.Clear();
|
||||
singboxConfig.inbounds.Clear();
|
||||
singboxConfig.inbounds.Add(new()
|
||||
{
|
||||
tag = $"{EInboundProtocol.mixed}{port}",
|
||||
listen = Global.Loopback,
|
||||
listen_port = port,
|
||||
type = EInboundProtocol.mixed.ToString(),
|
||||
});
|
||||
|
||||
ret.Msg = string.Format(ResUI.SuccessfulConfiguration, "");
|
||||
ret.Success = true;
|
||||
ret.Data = JsonUtils.Serialize(singboxConfig);
|
||||
return ret;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logging.SaveLog(_tag, ex);
|
||||
ret.Msg = ResUI.FailedGenDefaultConfiguration;
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<RetResult> GenerateClientMultipleLoadConfig(List<ProfileItem> selecteds)
|
||||
{
|
||||
var ret = new RetResult();
|
||||
@@ -1264,7 +1324,7 @@ namespace ServiceLib.Services.CoreConfig
|
||||
singboxConfig.experimental.cache_file = new CacheFile4Sbox()
|
||||
{
|
||||
enabled = true,
|
||||
path = Utils.GetConfigPath("cache.db")
|
||||
path = Utils.GetBinConfigPath("cache.db")
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -353,6 +353,64 @@ namespace ServiceLib.Services.CoreConfig
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<RetResult> GenerateClientSpeedtestConfig(ProfileItem node, int port)
|
||||
{
|
||||
var ret = new RetResult();
|
||||
try
|
||||
{
|
||||
if (node is not { Port: > 0 })
|
||||
{
|
||||
ret.Msg = ResUI.CheckServerSettings;
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (node.GetNetwork() is nameof(ETransport.quic))
|
||||
{
|
||||
ret.Msg = ResUI.Incorrectconfiguration + $" - {node.GetNetwork()}";
|
||||
return ret;
|
||||
}
|
||||
|
||||
var result = EmbedUtils.GetEmbedText(Global.V2raySampleClient);
|
||||
if (Utils.IsNullOrEmpty(result))
|
||||
{
|
||||
ret.Msg = ResUI.FailedGetDefaultConfiguration;
|
||||
return ret;
|
||||
}
|
||||
|
||||
var v2rayConfig = JsonUtils.Deserialize<V2rayConfig>(result);
|
||||
if (v2rayConfig == null)
|
||||
{
|
||||
ret.Msg = ResUI.FailedGenDefaultConfiguration;
|
||||
return ret;
|
||||
}
|
||||
|
||||
await GenLog(v2rayConfig);
|
||||
await GenOutbound(node, v2rayConfig.outbounds.First());
|
||||
await GenMoreOutbounds(node, v2rayConfig);
|
||||
|
||||
v2rayConfig.routing.rules.Clear();
|
||||
v2rayConfig.inbounds.Clear();
|
||||
v2rayConfig.inbounds.Add(new()
|
||||
{
|
||||
tag = $"{EInboundProtocol.socks}{port}",
|
||||
listen = Global.Loopback,
|
||||
port = port,
|
||||
protocol = EInboundProtocol.socks.ToString(),
|
||||
});
|
||||
|
||||
ret.Msg = string.Format(ResUI.SuccessfulConfiguration, "");
|
||||
ret.Success = true;
|
||||
ret.Data = JsonUtils.Serialize(v2rayConfig);
|
||||
return ret;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logging.SaveLog(_tag, ex);
|
||||
ret.Msg = ResUI.FailedGenDefaultConfiguration;
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion public gen function
|
||||
|
||||
#region private gen function
|
||||
|
||||
@@ -22,12 +22,11 @@ namespace ServiceLib.Services
|
||||
{
|
||||
Task.Run(async () =>
|
||||
{
|
||||
var exitLoopKey = Utils.GetGuid(false);
|
||||
_lstExitLoop.Add(exitLoopKey);
|
||||
|
||||
var lstSelected = GetClearItem(actionType, selecteds);
|
||||
await RunAsync(actionType, lstSelected, exitLoopKey);
|
||||
await RunAsync(actionType, selecteds);
|
||||
await ProfileExHandler.Instance.SaveTo();
|
||||
UpdateFunc("", ResUI.SpeedtestingCompleted);
|
||||
|
||||
FileManager.DeleteExpiredFiles(Utils.GetBinConfigPath(), DateTime.Now.AddHours(-1));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -41,49 +40,30 @@ namespace ServiceLib.Services
|
||||
}
|
||||
}
|
||||
|
||||
private async Task RunAsync(ESpeedActionType actionType, List<ServerTestItem> lstSelected, string exitLoopKey, int pageSize = 0)
|
||||
private async Task RunAsync(ESpeedActionType actionType, List<ProfileItem> selecteds)
|
||||
{
|
||||
if (actionType == ESpeedActionType.Tcping)
|
||||
{
|
||||
await RunTcpingAsync(lstSelected);
|
||||
return;
|
||||
}
|
||||
var exitLoopKey = Utils.GetGuid(false);
|
||||
_lstExitLoop.Add(exitLoopKey);
|
||||
|
||||
if (pageSize <= 0)
|
||||
{
|
||||
pageSize = lstSelected.Count < Global.SpeedTestPageSize ? lstSelected.Count : Global.SpeedTestPageSize;
|
||||
}
|
||||
var lstTest = GetTestBatchItem(lstSelected, pageSize);
|
||||
var lstSelected = GetClearItem(actionType, selecteds);
|
||||
|
||||
List<ServerTestItem> lstFailed = new();
|
||||
foreach (var lst in lstTest)
|
||||
switch (actionType)
|
||||
{
|
||||
var ret = actionType switch
|
||||
{
|
||||
ESpeedActionType.Realping => await RunRealPingAsync(lst, exitLoopKey),
|
||||
ESpeedActionType.Speedtest => await RunSpeedTestAsync(lst, exitLoopKey),
|
||||
ESpeedActionType.Mixedtest => await RunMixedTestAsync(lst, exitLoopKey),
|
||||
_ => true
|
||||
};
|
||||
if (ret == false)
|
||||
{
|
||||
lstFailed.AddRange(lst);
|
||||
}
|
||||
await Task.Delay(100);
|
||||
}
|
||||
case ESpeedActionType.Tcping:
|
||||
await RunTcpingAsync(lstSelected);
|
||||
break;
|
||||
|
||||
//Retest the failed part
|
||||
var pageSizeNext = pageSize / 2;
|
||||
if (lstFailed.Count > 0 && pageSizeNext > 0)
|
||||
{
|
||||
if (_lstExitLoop.Any(p => p == exitLoopKey) == false)
|
||||
{
|
||||
UpdateFunc("", ResUI.SpeedtestingSkip);
|
||||
return;
|
||||
}
|
||||
case ESpeedActionType.Realping:
|
||||
await RunRealPingBatchAsync(lstSelected, exitLoopKey);
|
||||
break;
|
||||
|
||||
UpdateFunc("", string.Format(ResUI.SpeedtestingTestFailedPart, lstFailed.Count));
|
||||
await RunAsync(actionType, lstFailed, exitLoopKey, pageSizeNext);
|
||||
case ESpeedActionType.Speedtest:
|
||||
await RunMixedTestAsync(lstSelected, 1, true, exitLoopKey);
|
||||
break;
|
||||
|
||||
case ESpeedActionType.Mixedtest:
|
||||
await RunMixedTestAsync(lstSelected, _config.SpeedTestItem.MixedConcurrencyCount, true, exitLoopKey);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,7 +87,8 @@ namespace ServiceLib.Services
|
||||
IndexId = it.IndexId,
|
||||
Address = it.Address,
|
||||
Port = it.Port,
|
||||
ConfigType = it.ConfigType
|
||||
ConfigType = it.ConfigType,
|
||||
QueueNum = selecteds.IndexOf(it)
|
||||
});
|
||||
}
|
||||
|
||||
@@ -119,18 +100,18 @@ namespace ServiceLib.Services
|
||||
case ESpeedActionType.Tcping:
|
||||
case ESpeedActionType.Realping:
|
||||
UpdateFunc(it.IndexId, ResUI.Speedtesting, "");
|
||||
ProfileExHandler.Instance.SetTestDelay(it.IndexId, "0");
|
||||
ProfileExHandler.Instance.SetTestDelay(it.IndexId, 0);
|
||||
break;
|
||||
|
||||
case ESpeedActionType.Speedtest:
|
||||
UpdateFunc(it.IndexId, "", ResUI.SpeedtestingWait);
|
||||
ProfileExHandler.Instance.SetTestSpeed(it.IndexId, "0");
|
||||
ProfileExHandler.Instance.SetTestSpeed(it.IndexId, 0);
|
||||
break;
|
||||
|
||||
case ESpeedActionType.Mixedtest:
|
||||
UpdateFunc(it.IndexId, ResUI.Speedtesting, ResUI.SpeedtestingWait);
|
||||
ProfileExHandler.Instance.SetTestDelay(it.IndexId, "0");
|
||||
ProfileExHandler.Instance.SetTestSpeed(it.IndexId, "0");
|
||||
ProfileExHandler.Instance.SetTestDelay(it.IndexId, 0);
|
||||
ProfileExHandler.Instance.SetTestSpeed(it.IndexId, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -138,60 +119,73 @@ namespace ServiceLib.Services
|
||||
return lstSelected;
|
||||
}
|
||||
|
||||
private List<List<ServerTestItem>> GetTestBatchItem(List<ServerTestItem> lstSelected, int pageSize)
|
||||
{
|
||||
List<List<ServerTestItem>> lstTest = new();
|
||||
var lst1 = lstSelected.Where(t => t.ConfigType is not (EConfigType.Hysteria2 or EConfigType.TUIC or EConfigType.WireGuard)).ToList();
|
||||
var lst2 = lstSelected.Where(t => t.ConfigType is EConfigType.Hysteria2 or EConfigType.TUIC or EConfigType.WireGuard).ToList();
|
||||
|
||||
for (var num = 0; num < (int)Math.Ceiling(lst1.Count * 1.0 / pageSize); num++)
|
||||
{
|
||||
lstTest.Add(lst1.Skip(num * pageSize).Take(pageSize).ToList());
|
||||
}
|
||||
for (var num = 0; num < (int)Math.Ceiling(lst2.Count * 1.0 / pageSize); num++)
|
||||
{
|
||||
lstTest.Add(lst2.Skip(num * pageSize).Take(pageSize).ToList());
|
||||
}
|
||||
|
||||
return lstTest;
|
||||
}
|
||||
|
||||
private async Task RunTcpingAsync(List<ServerTestItem> selecteds)
|
||||
{
|
||||
try
|
||||
List<Task> tasks = [];
|
||||
foreach (var it in selecteds)
|
||||
{
|
||||
List<Task> tasks = [];
|
||||
foreach (var it in selecteds)
|
||||
if (it.ConfigType == EConfigType.Custom)
|
||||
{
|
||||
if (it.ConfigType == EConfigType.Custom)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
tasks.Add(Task.Run(async () =>
|
||||
{
|
||||
try
|
||||
{
|
||||
var time = await GetTcpingTime(it.Address, it.Port);
|
||||
var output = FormatOut(time, Global.DelayUnit);
|
||||
|
||||
ProfileExHandler.Instance.SetTestDelay(it.IndexId, output);
|
||||
UpdateFunc(it.IndexId, output);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logging.SaveLog(_tag, ex);
|
||||
}
|
||||
}));
|
||||
continue;
|
||||
}
|
||||
Task.WaitAll([.. tasks]);
|
||||
tasks.Add(Task.Run(async () =>
|
||||
{
|
||||
try
|
||||
{
|
||||
var responseTime = await GetTcpingTime(it.Address, it.Port);
|
||||
|
||||
ProfileExHandler.Instance.SetTestDelay(it.IndexId, responseTime);
|
||||
UpdateFunc(it.IndexId, responseTime.ToString());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logging.SaveLog(_tag, ex);
|
||||
}
|
||||
}));
|
||||
}
|
||||
catch (Exception ex)
|
||||
Task.WaitAll([.. tasks]);
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
|
||||
private async Task RunRealPingBatchAsync(List<ServerTestItem> lstSelected, string exitLoopKey, int pageSize = 0)
|
||||
{
|
||||
if (pageSize <= 0)
|
||||
{
|
||||
Logging.SaveLog(_tag, ex);
|
||||
pageSize = lstSelected.Count < Global.SpeedTestPageSize ? lstSelected.Count : Global.SpeedTestPageSize;
|
||||
}
|
||||
finally
|
||||
var lstTest = GetTestBatchItem(lstSelected, pageSize);
|
||||
|
||||
List<ServerTestItem> lstFailed = new();
|
||||
foreach (var lst in lstTest)
|
||||
{
|
||||
await ProfileExHandler.Instance.SaveTo();
|
||||
var ret = await RunRealPingAsync(lst, exitLoopKey);
|
||||
if (ret == false)
|
||||
{
|
||||
lstFailed.AddRange(lst);
|
||||
}
|
||||
await Task.Delay(100);
|
||||
}
|
||||
|
||||
//Retest the failed part
|
||||
var pageSizeNext = pageSize / 2;
|
||||
if (lstFailed.Count > 0 && pageSizeNext > 0)
|
||||
{
|
||||
if (_lstExitLoop.Any(p => p == exitLoopKey) == false)
|
||||
{
|
||||
UpdateFunc("", ResUI.SpeedtestingSkip);
|
||||
return;
|
||||
}
|
||||
|
||||
UpdateFunc("", string.Format(ResUI.SpeedtestingTestFailedPart, lstFailed.Count));
|
||||
|
||||
if (pageSizeNext > _config.SpeedTestItem.MixedConcurrencyCount)
|
||||
{
|
||||
await RunRealPingBatchAsync(lstFailed, exitLoopKey, pageSizeNext);
|
||||
}
|
||||
else
|
||||
{
|
||||
await RunMixedTestAsync(lstSelected, _config.SpeedTestItem.MixedConcurrencyCount, false, exitLoopKey);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -221,20 +215,7 @@ namespace ServiceLib.Services
|
||||
}
|
||||
tasks.Add(Task.Run(async () =>
|
||||
{
|
||||
try
|
||||
{
|
||||
var webProxy = new WebProxy($"socks5://{Global.Loopback}:{it.Port}");
|
||||
var output = await GetRealPingTime(downloadHandle, webProxy);
|
||||
|
||||
ProfileExHandler.Instance.SetTestDelay(it.IndexId, output);
|
||||
UpdateFunc(it.IndexId, output);
|
||||
int.TryParse(output, out var delay);
|
||||
it.Delay = delay;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logging.SaveLog(_tag, ex);
|
||||
}
|
||||
await DoRealPing(downloadHandle, it);
|
||||
}));
|
||||
}
|
||||
Task.WaitAll(tasks.ToArray());
|
||||
@@ -249,25 +230,15 @@ namespace ServiceLib.Services
|
||||
{
|
||||
await ProcUtils.ProcessKill(pid);
|
||||
}
|
||||
await ProfileExHandler.Instance.SaveTo();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private async Task<bool> RunSpeedTestAsync(List<ServerTestItem> selecteds, string exitLoopKey)
|
||||
private async Task RunMixedTestAsync(List<ServerTestItem> selecteds, int concurrencyCount, bool blSpeedTest, string exitLoopKey)
|
||||
{
|
||||
var pid = -1;
|
||||
pid = await CoreHandler.Instance.LoadCoreConfigSpeedtest(selecteds);
|
||||
if (pid < 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var url = _config.SpeedTestItem.SpeedTestUrl;
|
||||
var timeout = _config.SpeedTestItem.SpeedTestTimeout;
|
||||
|
||||
DownloadService downloadHandle = new();
|
||||
|
||||
using var concurrencySemaphore = new SemaphoreSlim(concurrencyCount);
|
||||
var downloadHandle = new DownloadService();
|
||||
List<Task> tasks = new();
|
||||
foreach (var it in selecteds)
|
||||
{
|
||||
if (_lstExitLoop.Any(p => p == exitLoopKey) == false)
|
||||
@@ -275,135 +246,74 @@ namespace ServiceLib.Services
|
||||
UpdateFunc(it.IndexId, "", ResUI.SpeedtestingSkip);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!it.AllowTest)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (it.ConfigType == EConfigType.Custom)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
//if (it.delay < 0)
|
||||
//{
|
||||
// UpdateFunc(it.indexId, "", ResUI.SpeedtestingSkip);
|
||||
// continue;
|
||||
//}
|
||||
ProfileExHandler.Instance.SetTestSpeed(it.IndexId, "-1");
|
||||
UpdateFunc(it.IndexId, "", ResUI.Speedtesting);
|
||||
await concurrencySemaphore.WaitAsync();
|
||||
|
||||
var item = await AppHandler.Instance.GetProfileItem(it.IndexId);
|
||||
if (item is null)
|
||||
continue;
|
||||
|
||||
var webProxy = new WebProxy($"socks5://{Global.Loopback}:{it.Port}");
|
||||
|
||||
await downloadHandle.DownloadDataAsync(url, webProxy, timeout, (success, msg) =>
|
||||
tasks.Add(Task.Run(async () =>
|
||||
{
|
||||
decimal.TryParse(msg, out var dec);
|
||||
if (dec > 0)
|
||||
var pid = -1;
|
||||
try
|
||||
{
|
||||
ProfileExHandler.Instance.SetTestSpeed(it.IndexId, msg);
|
||||
pid = await CoreHandler.Instance.LoadCoreConfigSpeedtest(it);
|
||||
if (pid > 0)
|
||||
{
|
||||
await Task.Delay(500);
|
||||
await DoRealPing(downloadHandle, it);
|
||||
if (blSpeedTest)
|
||||
{
|
||||
await DoSpeedTest(downloadHandle, it);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
UpdateFunc(it.IndexId, "", ResUI.FailedToRunCore);
|
||||
}
|
||||
}
|
||||
UpdateFunc(it.IndexId, "", msg);
|
||||
});
|
||||
}
|
||||
|
||||
if (pid > 0)
|
||||
{
|
||||
await ProcUtils.ProcessKill(pid);
|
||||
}
|
||||
await ProfileExHandler.Instance.SaveTo();
|
||||
return true;
|
||||
}
|
||||
|
||||
private async Task<bool> RunSpeedTestMultiAsync(List<ServerTestItem> selecteds, string exitLoopKey)
|
||||
{
|
||||
var pid = -1;
|
||||
pid = await CoreHandler.Instance.LoadCoreConfigSpeedtest(selecteds);
|
||||
if (pid < 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var url = _config.SpeedTestItem.SpeedTestUrl;
|
||||
var timeout = _config.SpeedTestItem.SpeedTestTimeout;
|
||||
|
||||
DownloadService downloadHandle = new();
|
||||
|
||||
foreach (var it in selecteds)
|
||||
{
|
||||
if (_lstExitLoop.Any(p => p == exitLoopKey) == false)
|
||||
{
|
||||
UpdateFunc(it.IndexId, "", ResUI.SpeedtestingSkip);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!it.AllowTest)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (it.ConfigType == EConfigType.Custom)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (it.Delay < 0)
|
||||
{
|
||||
UpdateFunc(it.IndexId, "", ResUI.SpeedtestingSkip);
|
||||
continue;
|
||||
}
|
||||
ProfileExHandler.Instance.SetTestSpeed(it.IndexId, "-1");
|
||||
UpdateFunc(it.IndexId, "", ResUI.Speedtesting);
|
||||
|
||||
var item = await AppHandler.Instance.GetProfileItem(it.IndexId);
|
||||
if (item is null)
|
||||
continue;
|
||||
|
||||
var webProxy = new WebProxy($"socks5://{Global.Loopback}:{it.Port}");
|
||||
_ = downloadHandle.DownloadDataAsync(url, webProxy, timeout, (success, msg) =>
|
||||
{
|
||||
decimal.TryParse(msg, out var dec);
|
||||
if (dec > 0)
|
||||
catch (Exception ex)
|
||||
{
|
||||
ProfileExHandler.Instance.SetTestSpeed(it.IndexId, msg);
|
||||
Logging.SaveLog(_tag, ex);
|
||||
}
|
||||
UpdateFunc(it.IndexId, "", msg);
|
||||
});
|
||||
await Task.Delay(2000);
|
||||
finally
|
||||
{
|
||||
if (pid > 0)
|
||||
{
|
||||
await ProcUtils.ProcessKill(pid);
|
||||
}
|
||||
concurrencySemaphore.Release();
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
await Task.Delay((timeout + 2) * 1000);
|
||||
|
||||
if (pid > 0)
|
||||
{
|
||||
await ProcUtils.ProcessKill(pid);
|
||||
}
|
||||
await ProfileExHandler.Instance.SaveTo();
|
||||
return true;
|
||||
Task.WaitAll(tasks.ToArray());
|
||||
}
|
||||
|
||||
private async Task<bool> RunMixedTestAsync(List<ServerTestItem> selecteds, string exitLoopKey)
|
||||
{
|
||||
var ret = await RunRealPingAsync(selecteds, exitLoopKey);
|
||||
if (ret == false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
await Task.Delay(1000);
|
||||
|
||||
var ret2 = await RunSpeedTestMultiAsync(selecteds, exitLoopKey);
|
||||
if (ret2 == false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private async Task<string> GetRealPingTime(DownloadService downloadHandle, IWebProxy webProxy)
|
||||
private async Task DoRealPing(DownloadService downloadHandle, ServerTestItem it)
|
||||
{
|
||||
var webProxy = new WebProxy($"socks5://{Global.Loopback}:{it.Port}");
|
||||
var responseTime = await downloadHandle.GetRealPingTime(_config.SpeedTestItem.SpeedPingTestUrl, webProxy, 10);
|
||||
return FormatOut(responseTime, Global.DelayUnit);
|
||||
|
||||
ProfileExHandler.Instance.SetTestDelay(it.IndexId, responseTime);
|
||||
UpdateFunc(it.IndexId, responseTime.ToString());
|
||||
}
|
||||
|
||||
private async Task DoSpeedTest(DownloadService downloadHandle, ServerTestItem it)
|
||||
{
|
||||
UpdateFunc(it.IndexId, "", ResUI.Speedtesting);
|
||||
|
||||
var webProxy = new WebProxy($"socks5://{Global.Loopback}:{it.Port}");
|
||||
var url = _config.SpeedTestItem.SpeedTestUrl;
|
||||
var timeout = _config.SpeedTestItem.SpeedTestTimeout;
|
||||
await downloadHandle.DownloadDataAsync(url, webProxy, timeout, (success, msg) =>
|
||||
{
|
||||
decimal.TryParse(msg, out var dec);
|
||||
if (dec > 0)
|
||||
{
|
||||
ProfileExHandler.Instance.SetTestSpeed(it.IndexId, dec);
|
||||
}
|
||||
UpdateFunc(it.IndexId, "", msg);
|
||||
});
|
||||
}
|
||||
|
||||
private async Task<int> GetTcpingTime(string url, int port)
|
||||
@@ -425,7 +335,10 @@ namespace ServiceLib.Services
|
||||
|
||||
var result = clientSocket.BeginConnect(endPoint, null, null);
|
||||
if (!result.AsyncWaitHandle.WaitOne(TimeSpan.FromSeconds(5)))
|
||||
{
|
||||
throw new TimeoutException("connect timeout (5s): " + url);
|
||||
}
|
||||
|
||||
clientSocket.EndConnect(result);
|
||||
|
||||
timer.Stop();
|
||||
@@ -438,14 +351,31 @@ namespace ServiceLib.Services
|
||||
return responseTime;
|
||||
}
|
||||
|
||||
private string FormatOut(object time, string unit)
|
||||
private List<List<ServerTestItem>> GetTestBatchItem(List<ServerTestItem> lstSelected, int pageSize)
|
||||
{
|
||||
return $"{time}";
|
||||
List<List<ServerTestItem>> lstTest = new();
|
||||
var lst1 = lstSelected.Where(t => t.ConfigType is not (EConfigType.Hysteria2 or EConfigType.TUIC or EConfigType.WireGuard)).ToList();
|
||||
var lst2 = lstSelected.Where(t => t.ConfigType is EConfigType.Hysteria2 or EConfigType.TUIC or EConfigType.WireGuard).ToList();
|
||||
|
||||
for (var num = 0; num < (int)Math.Ceiling(lst1.Count * 1.0 / pageSize); num++)
|
||||
{
|
||||
lstTest.Add(lst1.Skip(num * pageSize).Take(pageSize).ToList());
|
||||
}
|
||||
for (var num = 0; num < (int)Math.Ceiling(lst2.Count * 1.0 / pageSize); num++)
|
||||
{
|
||||
lstTest.Add(lst2.Skip(num * pageSize).Take(pageSize).ToList());
|
||||
}
|
||||
|
||||
return lstTest;
|
||||
}
|
||||
|
||||
private void UpdateFunc(string indexId, string delay, string speed = "")
|
||||
{
|
||||
_updateFunc?.Invoke(new() { IndexId = indexId, Delay = delay, Speed = speed });
|
||||
if (indexId.IsNotEmpty() && speed.IsNotEmpty())
|
||||
{
|
||||
ProfileExHandler.Instance.SetTestMessage(indexId, speed);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -427,22 +427,32 @@ namespace ServiceLib.Services
|
||||
{
|
||||
if (Utils.IsWindows())
|
||||
{
|
||||
//Check for standalone windows .Net version
|
||||
if (coreInfo?.CoreType == ECoreType.v2rayN && RuntimeInformation.ProcessArchitecture == Architecture.X64)
|
||||
{
|
||||
var runtimes = await Utils.GetCliWrapOutput("dotnet", "--list-runtimes");
|
||||
if (runtimes == null || runtimes.Contains("Microsoft.WindowsDesktop.App 8") == false)
|
||||
{
|
||||
return coreInfo?.DownloadUrlWin64?.Replace(".zip", "-SelfContained.zip");
|
||||
}
|
||||
}
|
||||
|
||||
return RuntimeInformation.ProcessArchitecture switch
|
||||
var url = RuntimeInformation.ProcessArchitecture switch
|
||||
{
|
||||
Architecture.Arm64 => coreInfo?.DownloadUrlWinArm64,
|
||||
Architecture.X64 => coreInfo?.DownloadUrlWin64,
|
||||
_ => null,
|
||||
};
|
||||
|
||||
if (coreInfo?.CoreType != ECoreType.v2rayN)
|
||||
{
|
||||
return url;
|
||||
}
|
||||
|
||||
//Check for standalone windows .Net version
|
||||
if (File.Exists(Path.Combine(Utils.GetBaseDirectory(), "wpfgfx_cor3.dll"))
|
||||
&& File.Exists(Path.Combine(Utils.GetBaseDirectory(), "D3DCompiler_47_cor3.dll")))
|
||||
{
|
||||
return url?.Replace(".zip", "-SelfContained.zip");
|
||||
}
|
||||
|
||||
//Check for avalonia desktop windows version
|
||||
if (File.Exists(Path.Combine(Utils.GetBaseDirectory(), "libHarfBuzzSharp.dll")))
|
||||
{
|
||||
return url?.Replace(".zip", "-desktop.zip");
|
||||
}
|
||||
|
||||
return url;
|
||||
}
|
||||
else if (Utils.IsLinux())
|
||||
{
|
||||
|
||||
@@ -173,7 +173,7 @@ namespace ServiceLib.ViewModels
|
||||
var configDirZipTemp = Utils.GetTempPath($"v2rayN_{DateTime.Now:yyyyMMddHHmmss}");
|
||||
var configDirTemp = Path.Combine(configDirZipTemp, _guiConfigs);
|
||||
|
||||
FileManager.CopyDirectory(configDir, configDirTemp, false, true, "cache.db");
|
||||
FileManager.CopyDirectory(configDir, configDirTemp, false, true, "");
|
||||
var ret = FileManager.CreateFromDirectory(configDirZipTemp, fileName);
|
||||
Directory.Delete(configDirZipTemp, true);
|
||||
return await Task.FromResult(ret);
|
||||
|
||||
@@ -63,7 +63,7 @@ namespace ServiceLib.ViewModels
|
||||
[Reactive] public int SpeedTestTimeout { get; set; }
|
||||
[Reactive] public string SpeedTestUrl { get; set; }
|
||||
[Reactive] public string SpeedPingTestUrl { get; set; }
|
||||
//[Reactive] public int SpeedTestPageSize { get; set; }
|
||||
[Reactive] public int MixedConcurrencyCount { get; set; }
|
||||
[Reactive] public bool EnableHWA { get; set; }
|
||||
[Reactive] public string SubConvertUrl { get; set; }
|
||||
[Reactive] public int MainGirdOrientation { get; set; }
|
||||
@@ -178,7 +178,7 @@ namespace ServiceLib.ViewModels
|
||||
CurrentFontFamily = _config.UiItem.CurrentFontFamily;
|
||||
SpeedTestTimeout = _config.SpeedTestItem.SpeedTestTimeout;
|
||||
SpeedTestUrl = _config.SpeedTestItem.SpeedTestUrl;
|
||||
//SpeedTestPageSize = _config.SpeedTestItem.SpeedTestPageSize;
|
||||
MixedConcurrencyCount = _config.SpeedTestItem.MixedConcurrencyCount;
|
||||
SpeedPingTestUrl = _config.SpeedTestItem.SpeedPingTestUrl;
|
||||
EnableHWA = _config.GuiItem.EnableHWA;
|
||||
SubConvertUrl = _config.ConstItem.SubConvertUrl;
|
||||
@@ -332,7 +332,7 @@ namespace ServiceLib.ViewModels
|
||||
_config.GuiItem.TrayMenuServersLimit = TrayMenuServersLimit;
|
||||
_config.UiItem.CurrentFontFamily = CurrentFontFamily;
|
||||
_config.SpeedTestItem.SpeedTestTimeout = SpeedTestTimeout;
|
||||
//_config.SpeedTestItem.SpeedTestPageSize = SpeedTestPageSize;
|
||||
_config.SpeedTestItem.MixedConcurrencyCount = MixedConcurrencyCount;
|
||||
_config.SpeedTestItem.SpeedTestUrl = SpeedTestUrl;
|
||||
_config.SpeedTestItem.SpeedPingTestUrl = SpeedPingTestUrl;
|
||||
_config.GuiItem.EnableHWA = EnableHWA;
|
||||
|
||||
@@ -79,6 +79,7 @@ namespace ServiceLib.ViewModels
|
||||
public ReactiveCommand<Unit, Unit> RealPingServerCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> SpeedServerCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> SortServerResultCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> RemoveInvalidServerResultCmd { get; }
|
||||
|
||||
//servers export
|
||||
public ReactiveCommand<Unit, Unit> Export2ClientConfigCmd { get; }
|
||||
@@ -197,6 +198,10 @@ namespace ServiceLib.ViewModels
|
||||
{
|
||||
await SortServer(EServerColName.DelayVal.ToString());
|
||||
});
|
||||
RemoveInvalidServerResultCmd = ReactiveCommand.CreateFromTask(async () =>
|
||||
{
|
||||
await RemoveInvalidServerResult();
|
||||
});
|
||||
//servers export
|
||||
Export2ClientConfigCmd = ReactiveCommand.CreateFromTask(async () =>
|
||||
{
|
||||
@@ -269,20 +274,22 @@ namespace ServiceLib.ViewModels
|
||||
return;
|
||||
}
|
||||
var item = _profileItems.FirstOrDefault(it => it.IndexId == result.IndexId);
|
||||
if (item != null)
|
||||
if (item == null)
|
||||
{
|
||||
if (Utils.IsNotEmpty(result.Delay))
|
||||
{
|
||||
int.TryParse(result.Delay, out int temp);
|
||||
item.Delay = temp;
|
||||
item.DelayVal = $"{result.Delay} {Global.DelayUnit}";
|
||||
}
|
||||
if (Utils.IsNotEmpty(result.Speed))
|
||||
{
|
||||
item.SpeedVal = $"{result.Speed} {Global.SpeedUnit}";
|
||||
}
|
||||
_profileItems.Replace(item, JsonUtils.DeepCopy(item));
|
||||
return;
|
||||
}
|
||||
|
||||
if (Utils.IsNotEmpty(result.Delay))
|
||||
{
|
||||
int.TryParse(result.Delay, out var temp);
|
||||
item.Delay = temp;
|
||||
item.DelayVal = result.Delay ?? string.Empty;
|
||||
}
|
||||
if (Utils.IsNotEmpty(result.Speed))
|
||||
{
|
||||
item.SpeedVal = result.Speed ?? string.Empty;
|
||||
}
|
||||
_profileItems.Replace(item, JsonUtils.DeepCopy(item));
|
||||
}
|
||||
|
||||
public void UpdateStatistics(ServerSpeedItem update)
|
||||
@@ -421,10 +428,11 @@ namespace ServiceLib.ViewModels
|
||||
Subid = t.Subid,
|
||||
SubRemarks = t.SubRemarks,
|
||||
IsActive = t.IndexId == _config.IndexId,
|
||||
Sort = t33 == null ? 0 : t33.Sort,
|
||||
Delay = t33 == null ? 0 : t33.Delay,
|
||||
DelayVal = t33?.Delay != 0 ? $"{t33?.Delay} {Global.DelayUnit}" : string.Empty,
|
||||
SpeedVal = t33?.Speed != 0 ? $"{t33?.Speed} {Global.SpeedUnit}" : string.Empty,
|
||||
Sort = t33?.Sort ?? 0,
|
||||
Delay = t33?.Delay ?? 0,
|
||||
Speed = t33?.Speed ?? 0,
|
||||
DelayVal = t33?.Delay != 0 ? $"{t33?.Delay}" : string.Empty,
|
||||
SpeedVal = t33?.Speed > 0 ? $"{t33?.Speed}" : t33?.Message ?? string.Empty,
|
||||
TodayDown = t22 == null ? "" : Utils.HumanFy(t22.TodayDown),
|
||||
TodayUp = t22 == null ? "" : Utils.HumanFy(t22.TodayUp),
|
||||
TotalDown = t22 == null ? "" : Utils.HumanFy(t22.TotalDown),
|
||||
@@ -512,7 +520,7 @@ namespace ServiceLib.ViewModels
|
||||
}
|
||||
var exists = lstSelecteds.Exists(t => t.IndexId == _config.IndexId);
|
||||
|
||||
await ConfigHandler.RemoveServer(_config, lstSelecteds);
|
||||
await ConfigHandler.RemoveServers(_config, lstSelecteds);
|
||||
NoticeHandler.Instance.Enqueue(ResUI.OperationSuccess);
|
||||
if (lstSelecteds.Count == _profileItems.Count)
|
||||
{
|
||||
@@ -656,6 +664,13 @@ namespace ServiceLib.ViewModels
|
||||
RefreshServers();
|
||||
}
|
||||
|
||||
public async Task RemoveInvalidServerResult()
|
||||
{
|
||||
var count = await ConfigHandler.RemoveInvalidServerResult(_config, _config.SubIndexId);
|
||||
RefreshServers();
|
||||
NoticeHandler.Instance.Enqueue(string.Format(ResUI.RemoveInvalidServerResultTip, count));
|
||||
}
|
||||
|
||||
//move server
|
||||
private async Task MoveToGroup(bool c)
|
||||
{
|
||||
|
||||
@@ -60,6 +60,9 @@ namespace ServiceLib.ViewModels
|
||||
[Reactive]
|
||||
public int SystemProxySelected { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public bool BlSystemProxyPacVisible { get; set; }
|
||||
|
||||
#endregion System Proxy
|
||||
|
||||
#region UI
|
||||
@@ -96,6 +99,7 @@ namespace ServiceLib.ViewModels
|
||||
SelectedRouting = new();
|
||||
SelectedServer = new();
|
||||
RunningServerToolTipText = "-";
|
||||
BlSystemProxyPacVisible = Utils.IsWindows();
|
||||
|
||||
if (_config.TunModeItem.EnableTun && AllowEnableTun())
|
||||
{
|
||||
|
||||
@@ -46,6 +46,12 @@
|
||||
Header="{x:Static resx:ResUI.menuSystemProxyNothing}"
|
||||
IsChecked="{Binding BlSystemProxyNothing}"
|
||||
ToggleType="Radio" />
|
||||
<NativeMenuItem
|
||||
Command="{Binding SystemProxyPacCmd}"
|
||||
Header="{x:Static resx:ResUI.menuSystemProxyPac}"
|
||||
IsChecked="{Binding BlSystemProxyPac}"
|
||||
IsVisible="{Binding BlSystemProxyPacVisible}"
|
||||
ToggleType="Radio" />
|
||||
<NativeMenuItemSeparator />
|
||||
<NativeMenuItem Click="MenuAddServerViaClipboardClick" Header="{x:Static resx:ResUI.menuAddServerViaClipboard}" />
|
||||
<NativeMenuItem Header="{x:Static resx:ResUI.menuAddServerViaScan}" IsVisible="False" />
|
||||
@@ -61,4 +67,4 @@
|
||||
</TrayIcon>
|
||||
</TrayIcons>
|
||||
</TrayIcon.Icons>
|
||||
</Application>
|
||||
</Application>
|
||||
|
||||
@@ -20,4 +20,7 @@
|
||||
<Style Selector="Grid.Margin8">
|
||||
<Setter Property="Margin" Value="8" />
|
||||
</Style>
|
||||
</Styles>
|
||||
<Style Selector="DataGrid">
|
||||
<Setter Property="RowHeight" Value="24" />
|
||||
</Style>
|
||||
</Styles>
|
||||
|
||||
@@ -119,6 +119,17 @@ namespace v2rayN.Desktop.ViewModels
|
||||
Value = size,
|
||||
});
|
||||
Application.Current?.Styles.Add(style);
|
||||
|
||||
ModifyFontSizeEx(size);
|
||||
}
|
||||
|
||||
private void ModifyFontSizeEx(double size)
|
||||
{
|
||||
//DataGrid
|
||||
var rowHeight = 20 + (size / 2);
|
||||
var style = new Style(x => x.OfType<DataGrid>());
|
||||
style.Add(new Setter(DataGrid.RowHeightProperty, rowHeight));
|
||||
Application.Current?.Styles.Add(style);
|
||||
}
|
||||
|
||||
private void ModifyFontFamily()
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
xmlns:view="using:v2rayN.Desktop.Views"
|
||||
xmlns:vms="clr-namespace:ServiceLib.ViewModels;assembly=ServiceLib"
|
||||
Title="v2rayN"
|
||||
Width="900"
|
||||
Width="1000"
|
||||
Height="600"
|
||||
MinWidth="900"
|
||||
x:DataType="vms:MainWindowViewModel"
|
||||
@@ -166,4 +166,4 @@
|
||||
</Grid>
|
||||
</DockPanel>
|
||||
</dialogHost:DialogHost>
|
||||
</Window>
|
||||
</Window>
|
||||
|
||||
@@ -518,21 +518,20 @@
|
||||
Classes="Margin8"
|
||||
Text="{x:Static resx:ResUI.TbSettingsCurrentFontFamilyLinuxTip}"
|
||||
TextWrapping="Wrap" />
|
||||
<!--
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="16"
|
||||
Grid.Column="0"
|
||||
VerticalAlignment="Center"
|
||||
Classes="Margin8"
|
||||
Text="{x:Static resx:ResUI.TbSettingsSpeedTestPageSize}" />
|
||||
<TextBox
|
||||
x:Name="txtSpeedTestPageSize"
|
||||
Text="{x:Static resx:ResUI.TbSettingsMixedConcurrencyCount}" />
|
||||
<ComboBox
|
||||
x:Name="cmbMixedConcurrencyCount"
|
||||
Grid.Row="16"
|
||||
Grid.Column="1"
|
||||
Width="200"
|
||||
HorizontalAlignment="Left"
|
||||
Classes="Margin8" />
|
||||
-->
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="17"
|
||||
Grid.Column="0"
|
||||
@@ -788,6 +787,7 @@
|
||||
Classes="Margin8" />
|
||||
|
||||
<TextBlock
|
||||
x:Name="labLinuxSudoPassword"
|
||||
Grid.Row="7"
|
||||
Grid.Column="0"
|
||||
VerticalAlignment="Center"
|
||||
@@ -801,6 +801,7 @@
|
||||
HorizontalAlignment="Left"
|
||||
Classes="Margin8" />
|
||||
<TextBlock
|
||||
x:Name="labLinuxSudoPasswordTip"
|
||||
Grid.Row="7"
|
||||
Grid.Column="2"
|
||||
VerticalAlignment="Center"
|
||||
|
||||
@@ -66,7 +66,11 @@ namespace v2rayN.Desktop.Views
|
||||
cmbCoreType6.Items.Add(it);
|
||||
});
|
||||
|
||||
for (int i = 2; i <= 6; i++)
|
||||
for (var i = 2; i <= 8; i++)
|
||||
{
|
||||
cmbMixedConcurrencyCount.Items.Add(i);
|
||||
}
|
||||
for (var i = 2; i <= 6; i++)
|
||||
{
|
||||
cmbSpeedTestTimeout.Items.Add(i * 5);
|
||||
}
|
||||
@@ -139,7 +143,7 @@ namespace v2rayN.Desktop.Views
|
||||
this.Bind(ViewModel, vm => vm.SpeedTestTimeout, v => v.cmbSpeedTestTimeout.SelectedValue).DisposeWith(disposables);
|
||||
this.Bind(ViewModel, vm => vm.SpeedTestUrl, v => v.cmbSpeedTestUrl.SelectedValue).DisposeWith(disposables);
|
||||
this.Bind(ViewModel, vm => vm.SpeedPingTestUrl, v => v.cmbSpeedPingTestUrl.SelectedValue).DisposeWith(disposables);
|
||||
//this.Bind(ViewModel, vm => vm.SpeedTestPageSize, v => v.txtSpeedTestPageSize.Text).DisposeWith(disposables);
|
||||
this.Bind(ViewModel, vm => vm.MixedConcurrencyCount, v => v.cmbMixedConcurrencyCount.SelectedValue).DisposeWith(disposables);
|
||||
this.Bind(ViewModel, vm => vm.SubConvertUrl, v => v.cmbSubConvertUrl.SelectedValue).DisposeWith(disposables);
|
||||
this.Bind(ViewModel, vm => vm.MainGirdOrientation, v => v.cmbMainGirdOrientation.SelectedIndex).DisposeWith(disposables);
|
||||
this.Bind(ViewModel, vm => vm.GeoFileSourceUrl, v => v.cmbGetFilesSourceUrl.SelectedValue).DisposeWith(disposables);
|
||||
@@ -170,6 +174,9 @@ namespace v2rayN.Desktop.Views
|
||||
if (Utils.IsWindows())
|
||||
{
|
||||
txbSettingsExceptionTip2.IsVisible = false;
|
||||
txtLinuxSudoPassword.IsVisible = false;
|
||||
labLinuxSudoPassword.IsVisible = false;
|
||||
labLinuxSudoPasswordTip.IsVisible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -104,14 +104,16 @@
|
||||
<MenuItem x:Name="menuShareServer" Header="{x:Static resx:ResUI.menuShareServer}" />
|
||||
<Separator />
|
||||
<MenuItem x:Name="menuSetDefaultMultipleServer" Header="{x:Static resx:ResUI.menuSetDefaultMultipleServer}" />
|
||||
|
||||
<MenuItem x:Name="menuSetDefaultLoadBalanceServer" Header="{x:Static resx:ResUI.menuSetDefaultLoadBalanceServer}" />
|
||||
<Separator />
|
||||
<MenuItem x:Name="menuMixedTestServer" Header="{x:Static resx:ResUI.menuMixedTestServer}" />
|
||||
<MenuItem x:Name="menuTcpingServer" Header="{x:Static resx:ResUI.menuTcpingServer}" />
|
||||
<MenuItem x:Name="menuRealPingServer" Header="{x:Static resx:ResUI.menuRealPingServer}" />
|
||||
<MenuItem x:Name="menuSpeedServer" Header="{x:Static resx:ResUI.menuSpeedServer}" />
|
||||
<MenuItem x:Name="menuSortServerResult" Header="{x:Static resx:ResUI.menuSortServerResult}" />
|
||||
<MenuItem Header="{x:Static resx:ResUI.menuTestServerResult}">
|
||||
<MenuItem x:Name="menuSortServerResult" Header="{x:Static resx:ResUI.menuSortServerResult}" />
|
||||
<MenuItem x:Name="menuRemoveInvalidServerResult" Header="{x:Static resx:ResUI.menuRemoveInvalidServerResult}" />
|
||||
</MenuItem>
|
||||
<Separator />
|
||||
<MenuItem x:Name="menuMoveToGroup" Header="{x:Static resx:ResUI.menuMoveToGroup}">
|
||||
<MenuItem>
|
||||
@@ -245,4 +247,4 @@
|
||||
</DataGrid>
|
||||
</DockPanel>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
</UserControl>
|
||||
|
||||
@@ -85,7 +85,8 @@ namespace v2rayN.Desktop.Views
|
||||
this.BindCommand(ViewModel, vm => vm.RealPingServerCmd, v => v.menuRealPingServer).DisposeWith(disposables);
|
||||
this.BindCommand(ViewModel, vm => vm.SpeedServerCmd, v => v.menuSpeedServer).DisposeWith(disposables);
|
||||
this.BindCommand(ViewModel, vm => vm.SortServerResultCmd, v => v.menuSortServerResult).DisposeWith(disposables);
|
||||
|
||||
this.BindCommand(ViewModel, vm => vm.RemoveInvalidServerResultCmd, v => v.menuRemoveInvalidServerResult).DisposeWith(disposables);
|
||||
|
||||
//servers export
|
||||
this.BindCommand(ViewModel, vm => vm.Export2ClientConfigCmd, v => v.menuExport2ClientConfig).DisposeWith(disposables);
|
||||
this.BindCommand(ViewModel, vm => vm.Export2ClientConfigClipboardCmd, v => v.menuExport2ClientConfigClipboard).DisposeWith(disposables);
|
||||
|
||||
@@ -60,6 +60,7 @@
|
||||
<ComboBoxItem Content="{x:Static resx:ResUI.menuSystemProxyClear}" />
|
||||
<ComboBoxItem Content="{x:Static resx:ResUI.menuSystemProxySet}" />
|
||||
<ComboBoxItem Content="{x:Static resx:ResUI.menuSystemProxyNothing}" />
|
||||
<ComboBoxItem Content="{x:Static resx:ResUI.menuSystemProxyPac}" />
|
||||
</ComboBox>
|
||||
|
||||
<ComboBox
|
||||
@@ -78,4 +79,4 @@
|
||||
</StackPanel>
|
||||
</DockPanel>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
</UserControl>
|
||||
|
||||
@@ -43,6 +43,11 @@ namespace v2rayN.Desktop.Views
|
||||
});
|
||||
|
||||
//spEnableTun.IsVisible = (Utils.IsWindows() || AppHandler.Instance.IsAdministrator);
|
||||
|
||||
if (Utils.IsNonWindows() && cmbSystemProxy.Items.IsReadOnly == false)
|
||||
{
|
||||
cmbSystemProxy.Items.RemoveAt(cmbSystemProxy.Items.Count - 1);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task<bool> UpdateViewHandler(EViewAction action, object? obj)
|
||||
|
||||
@@ -776,23 +776,22 @@
|
||||
Style="{StaticResource ToolbarTextBlock}"
|
||||
Text="{x:Static resx:ResUI.TbSettingsCurrentFontFamilyTip}"
|
||||
TextWrapping="Wrap" />
|
||||
<!--
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="16"
|
||||
Grid.Column="0"
|
||||
Margin="{StaticResource Margin8}"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource ToolbarTextBlock}"
|
||||
Text="{x:Static resx:ResUI.TbSettingsSpeedTestPageSize}" />
|
||||
<TextBox
|
||||
x:Name="txtSpeedTestPageSize"
|
||||
Text="{x:Static resx:ResUI.TbSettingsMixedConcurrencyCount}" />
|
||||
<ComboBox
|
||||
x:Name="cmbMixedConcurrencyCount"
|
||||
Grid.Row="16"
|
||||
Grid.Column="1"
|
||||
Width="200"
|
||||
Margin="{StaticResource Margin8}"
|
||||
HorizontalAlignment="Left"
|
||||
Style="{StaticResource DefTextBox}" />
|
||||
-->
|
||||
Style="{StaticResource DefComboBox}" />
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="17"
|
||||
Grid.Column="0"
|
||||
|
||||
@@ -68,7 +68,11 @@ namespace v2rayN.Views
|
||||
cmbCoreType6.Items.Add(it);
|
||||
});
|
||||
|
||||
for (int i = 2; i <= 6; i++)
|
||||
for (var i = 2; i <= 8; i++)
|
||||
{
|
||||
cmbMixedConcurrencyCount.Items.Add(i);
|
||||
}
|
||||
for (var i = 2; i <= 6; i++)
|
||||
{
|
||||
cmbSpeedTestTimeout.Items.Add(i * 5);
|
||||
}
|
||||
@@ -150,7 +154,7 @@ namespace v2rayN.Views
|
||||
this.Bind(ViewModel, vm => vm.SpeedTestTimeout, v => v.cmbSpeedTestTimeout.Text).DisposeWith(disposables);
|
||||
this.Bind(ViewModel, vm => vm.SpeedTestUrl, v => v.cmbSpeedTestUrl.Text).DisposeWith(disposables);
|
||||
this.Bind(ViewModel, vm => vm.SpeedPingTestUrl, v => v.cmbSpeedPingTestUrl.Text).DisposeWith(disposables);
|
||||
//this.Bind(ViewModel, vm => vm.SpeedTestPageSize, v => v.txtSpeedTestPageSize.Text).DisposeWith(disposables);
|
||||
this.Bind(ViewModel, vm => vm.MixedConcurrencyCount, v => v.cmbMixedConcurrencyCount.Text).DisposeWith(disposables);
|
||||
this.Bind(ViewModel, vm => vm.EnableHWA, v => v.togEnableHWA.IsChecked).DisposeWith(disposables);
|
||||
this.Bind(ViewModel, vm => vm.SubConvertUrl, v => v.cmbSubConvertUrl.Text).DisposeWith(disposables);
|
||||
this.Bind(ViewModel, vm => vm.MainGirdOrientation, v => v.cmbMainGirdOrientation.SelectedIndex).DisposeWith(disposables);
|
||||
|
||||
@@ -146,10 +146,16 @@
|
||||
x:Name="menuSpeedServer"
|
||||
Height="{StaticResource MenuItemHeight}"
|
||||
Header="{x:Static resx:ResUI.menuSpeedServer}" />
|
||||
<MenuItem
|
||||
x:Name="menuSortServerResult"
|
||||
Height="{StaticResource MenuItemHeight}"
|
||||
Header="{x:Static resx:ResUI.menuSortServerResult}" />
|
||||
<MenuItem Header="{x:Static resx:ResUI.menuTestServerResult}">
|
||||
<MenuItem
|
||||
x:Name="menuSortServerResult"
|
||||
Height="{StaticResource MenuItemHeight}"
|
||||
Header="{x:Static resx:ResUI.menuSortServerResult}" />
|
||||
<MenuItem
|
||||
x:Name="menuRemoveInvalidServerResult"
|
||||
Height="{StaticResource MenuItemHeight}"
|
||||
Header="{x:Static resx:ResUI.menuRemoveInvalidServerResult}" />
|
||||
</MenuItem>
|
||||
<Separator />
|
||||
<MenuItem
|
||||
x:Name="menuMoveToGroup"
|
||||
@@ -321,4 +327,4 @@
|
||||
</DataGrid>
|
||||
</DockPanel>
|
||||
</Grid>
|
||||
</reactiveui:ReactiveUserControl>
|
||||
</reactiveui:ReactiveUserControl>
|
||||
|
||||
@@ -79,6 +79,7 @@ namespace v2rayN.Views
|
||||
this.BindCommand(ViewModel, vm => vm.RealPingServerCmd, v => v.menuRealPingServer).DisposeWith(disposables);
|
||||
this.BindCommand(ViewModel, vm => vm.SpeedServerCmd, v => v.menuSpeedServer).DisposeWith(disposables);
|
||||
this.BindCommand(ViewModel, vm => vm.SortServerResultCmd, v => v.menuSortServerResult).DisposeWith(disposables);
|
||||
this.BindCommand(ViewModel, vm => vm.RemoveInvalidServerResultCmd, v => v.menuRemoveInvalidServerResult).DisposeWith(disposables);
|
||||
|
||||
//servers export
|
||||
this.BindCommand(ViewModel, vm => vm.Export2ClientConfigCmd, v => v.menuExport2ClientConfig).DisposeWith(disposables);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<reactiveui:ReactiveUserControl
|
||||
<reactiveui:ReactiveUserControl
|
||||
x:Class="v2rayN.Views.StatusBarView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
@@ -102,11 +102,9 @@
|
||||
|
||||
<tb:TaskbarIcon
|
||||
x:Name="tbNotify"
|
||||
IconSource="/Resources/v2rayN.ico"
|
||||
NoLeftClickDelay="True"
|
||||
ToolTipText="v2rayN">
|
||||
<tb:TaskbarIcon.IconSource>
|
||||
<tb:GeneratedIconSource Foreground="Red" Text="❤️" />
|
||||
</tb:TaskbarIcon.IconSource>
|
||||
<tb:TaskbarIcon.ContextMenu>
|
||||
<ContextMenu Style="{StaticResource DefContextMenu}">
|
||||
<MenuItem x:Name="menuSystemProxyClear" Height="{StaticResource MenuItemHeight}">
|
||||
@@ -215,4 +213,4 @@
|
||||
</tb:TaskbarIcon.ContextMenu>
|
||||
</tb:TaskbarIcon>
|
||||
</Grid>
|
||||
</reactiveui:ReactiveUserControl>
|
||||
</reactiveui:ReactiveUserControl>
|
||||
|
||||
@@ -32,8 +32,8 @@ namespace v2rayN.Views
|
||||
this.OneWayBind(ViewModel, vm => vm.BlSystemProxyPac, v => v.menuSystemProxyPac2.Visibility, conversionHint: BooleanToVisibilityHint.UseHidden, vmToViewConverterOverride: new BooleanToVisibilityTypeConverter()).DisposeWith(disposables);
|
||||
this.BindCommand(ViewModel, vm => vm.SystemProxyClearCmd, v => v.menuSystemProxyClear).DisposeWith(disposables);
|
||||
this.BindCommand(ViewModel, vm => vm.SystemProxySetCmd, v => v.menuSystemProxySet).DisposeWith(disposables);
|
||||
this.BindCommand(ViewModel, vm => vm.SystemProxyPacCmd, v => v.menuSystemProxyPac).DisposeWith(disposables);
|
||||
this.BindCommand(ViewModel, vm => vm.SystemProxyNothingCmd, v => v.menuSystemProxyNothing).DisposeWith(disposables);
|
||||
this.BindCommand(ViewModel, vm => vm.SystemProxyPacCmd, v => v.menuSystemProxyPac).DisposeWith(disposables);
|
||||
|
||||
//routings and servers
|
||||
this.OneWayBind(ViewModel, vm => vm.RoutingItems, v => v.cmbRoutings.ItemsSource).DisposeWith(disposables);
|
||||
|
||||
Reference in New Issue
Block a user