Compare commits
22 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4875b37f70 | ||
|
|
2f3fba73de | ||
|
|
2ab1b9068f | ||
|
|
b9613875ce | ||
|
|
5d2aea6b4f | ||
|
|
5824e18ed6 | ||
|
|
4f8648cbc9 | ||
|
|
01b021b2c3 | ||
|
|
331e8ce960 | ||
|
|
a2cfe6fa51 | ||
|
|
8381fefb78 | ||
|
|
d3b95d781a | ||
|
|
3a4a96f87a | ||
|
|
3d462c4be3 | ||
|
|
82b366cd9b | ||
|
|
897a4e5635 | ||
|
|
8ea76fd318 | ||
|
|
693a96fff2 | ||
|
|
8b4e2f8f23 | ||
|
|
13b164acac | ||
|
|
e590547b30 | ||
|
|
5a0fdd971a |
@@ -1,7 +1,7 @@
|
|||||||
<Project>
|
<Project>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Version>7.12.0</Version>
|
<Version>7.12.5</Version>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
|
|||||||
@@ -5,10 +5,10 @@
|
|||||||
<CentralPackageVersionOverrideEnabled>false</CentralPackageVersionOverrideEnabled>
|
<CentralPackageVersionOverrideEnabled>false</CentralPackageVersionOverrideEnabled>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageVersion Include="Avalonia.Controls.DataGrid" Version="11.2.8" />
|
<PackageVersion Include="Avalonia.Controls.DataGrid" Version="11.3.0" />
|
||||||
<PackageVersion Include="Avalonia.Desktop" Version="11.2.8" />
|
<PackageVersion Include="Avalonia.Desktop" Version="11.3.0" />
|
||||||
<PackageVersion Include="Avalonia.Diagnostics" Version="11.2.8" />
|
<PackageVersion Include="Avalonia.Diagnostics" Version="11.3.0" />
|
||||||
<PackageVersion Include="Avalonia.ReactiveUI" Version="11.2.8" />
|
<PackageVersion Include="Avalonia.ReactiveUI" Version="11.3.0" />
|
||||||
<PackageVersion Include="CliWrap" Version="3.8.2" />
|
<PackageVersion Include="CliWrap" Version="3.8.2" />
|
||||||
<PackageVersion Include="Downloader" Version="3.3.4" />
|
<PackageVersion Include="Downloader" Version="3.3.4" />
|
||||||
<PackageVersion Include="H.NotifyIcon.Wpf" Version="2.3.0" />
|
<PackageVersion Include="H.NotifyIcon.Wpf" Version="2.3.0" />
|
||||||
@@ -27,4 +27,4 @@
|
|||||||
<PackageVersion Include="YamlDotNet" Version="16.3.0" />
|
<PackageVersion Include="YamlDotNet" Version="16.3.0" />
|
||||||
<PackageVersion Include="ZXing.Net.Bindings.SkiaSharp" Version="0.16.14" />
|
<PackageVersion Include="ZXing.Net.Bindings.SkiaSharp" Version="0.16.14" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
@@ -8,9 +8,7 @@ public class Global
|
|||||||
public const string GithubUrl = "https://github.com";
|
public const string GithubUrl = "https://github.com";
|
||||||
public const string GithubApiUrl = "https://api.github.com/repos";
|
public const string GithubApiUrl = "https://api.github.com/repos";
|
||||||
public const string GeoUrl = "https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/{0}.dat";
|
public const string GeoUrl = "https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/{0}.dat";
|
||||||
public const string SpeedPingTestUrl = @"https://www.google.com/generate_204";
|
|
||||||
public const string SingboxRulesetUrl = @"https://raw.githubusercontent.com/2dust/sing-box-rules/rule-set-{0}/{1}.srs";
|
public const string SingboxRulesetUrl = @"https://raw.githubusercontent.com/2dust/sing-box-rules/rule-set-{0}/{1}.srs";
|
||||||
public const string IPAPIUrl = "https://api.ip.sb/geoip";
|
|
||||||
|
|
||||||
public const string PromotionUrl = @"aHR0cHM6Ly85LjIzNDQ1Ni54eXovYWJjLmh0bWw=";
|
public const string PromotionUrl = @"aHR0cHM6Ly85LjIzNDQ1Ni54eXovYWJjLmh0bWw=";
|
||||||
public const string ConfigFileName = "guiNConfig.json";
|
public const string ConfigFileName = "guiNConfig.json";
|
||||||
@@ -519,5 +517,15 @@ public class Global
|
|||||||
@"https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geoip.metadb"
|
@"https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geoip.metadb"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
public static readonly List<string> IPAPIUrls =
|
||||||
|
[
|
||||||
|
@"https://speed.cloudflare.com/meta",
|
||||||
|
@"https://api.ip.sb/geoip",
|
||||||
|
@"https://api-ipv4.ip.sb/geoip",
|
||||||
|
@"https://api-ipv6.ip.sb/geoip",
|
||||||
|
@"https://api.ipapi.is",
|
||||||
|
@""
|
||||||
|
];
|
||||||
|
|
||||||
#endregion const
|
#endregion const
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ public class ConfigHandler
|
|||||||
}
|
}
|
||||||
if (config.SpeedTestItem.SpeedPingTestUrl.IsNullOrEmpty())
|
if (config.SpeedTestItem.SpeedPingTestUrl.IsNullOrEmpty())
|
||||||
{
|
{
|
||||||
config.SpeedTestItem.SpeedPingTestUrl = Global.SpeedPingTestUrl;
|
config.SpeedTestItem.SpeedPingTestUrl = Global.SpeedPingTestUrls.First();
|
||||||
}
|
}
|
||||||
if (config.SpeedTestItem.MixedConcurrencyCount < 1)
|
if (config.SpeedTestItem.MixedConcurrencyCount < 1)
|
||||||
{
|
{
|
||||||
@@ -799,8 +799,11 @@ public class ConfigHandler
|
|||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
var lstServerStat = (config.GuiItem.EnableStatistics ? StatisticsHandler.Instance.ServerStat : null) ?? [];
|
||||||
var lstProfileExs = await ProfileExHandler.Instance.GetProfileExs();
|
var lstProfileExs = await ProfileExHandler.Instance.GetProfileExs();
|
||||||
var lstProfile = (from t in lstModel
|
var lstProfile = (from t in lstModel
|
||||||
|
join t2 in lstServerStat on t.IndexId equals t2.IndexId into t2b
|
||||||
|
from t22 in t2b.DefaultIfEmpty()
|
||||||
join t3 in lstProfileExs on t.IndexId equals t3.IndexId into t3b
|
join t3 in lstProfileExs on t.IndexId equals t3.IndexId into t3b
|
||||||
from t33 in t3b.DefaultIfEmpty()
|
from t33 in t3b.DefaultIfEmpty()
|
||||||
select new ProfileItemModel
|
select new ProfileItemModel
|
||||||
@@ -815,7 +818,11 @@ public class ConfigHandler
|
|||||||
StreamSecurity = t.StreamSecurity,
|
StreamSecurity = t.StreamSecurity,
|
||||||
Delay = t33?.Delay ?? 0,
|
Delay = t33?.Delay ?? 0,
|
||||||
Speed = t33?.Speed ?? 0,
|
Speed = t33?.Speed ?? 0,
|
||||||
Sort = t33?.Sort ?? 0
|
Sort = t33?.Sort ?? 0,
|
||||||
|
TodayDown = (t22?.TodayDown ?? 0).ToString("D16"),
|
||||||
|
TodayUp = (t22?.TodayUp ?? 0).ToString("D16"),
|
||||||
|
TotalDown = (t22?.TotalDown ?? 0).ToString("D16"),
|
||||||
|
TotalUp = (t22?.TotalUp ?? 0).ToString("D16"),
|
||||||
}).ToList();
|
}).ToList();
|
||||||
|
|
||||||
Enum.TryParse(colName, true, out EServerColName name);
|
Enum.TryParse(colName, true, out EServerColName name);
|
||||||
@@ -833,6 +840,10 @@ public class ConfigHandler
|
|||||||
EServerColName.DelayVal => lstProfile.OrderBy(t => t.Delay).ToList(),
|
EServerColName.DelayVal => lstProfile.OrderBy(t => t.Delay).ToList(),
|
||||||
EServerColName.SpeedVal => lstProfile.OrderBy(t => t.Speed).ToList(),
|
EServerColName.SpeedVal => lstProfile.OrderBy(t => t.Speed).ToList(),
|
||||||
EServerColName.SubRemarks => lstProfile.OrderBy(t => t.Subid).ToList(),
|
EServerColName.SubRemarks => lstProfile.OrderBy(t => t.Subid).ToList(),
|
||||||
|
EServerColName.TodayDown => lstProfile.OrderBy(t => t.TodayDown).ToList(),
|
||||||
|
EServerColName.TodayUp => lstProfile.OrderBy(t => t.TodayUp).ToList(),
|
||||||
|
EServerColName.TotalDown => lstProfile.OrderBy(t => t.TotalDown).ToList(),
|
||||||
|
EServerColName.TotalUp => lstProfile.OrderBy(t => t.TotalUp).ToList(),
|
||||||
_ => lstProfile
|
_ => lstProfile
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -849,6 +860,10 @@ public class ConfigHandler
|
|||||||
EServerColName.DelayVal => lstProfile.OrderByDescending(t => t.Delay).ToList(),
|
EServerColName.DelayVal => lstProfile.OrderByDescending(t => t.Delay).ToList(),
|
||||||
EServerColName.SpeedVal => lstProfile.OrderByDescending(t => t.Speed).ToList(),
|
EServerColName.SpeedVal => lstProfile.OrderByDescending(t => t.Speed).ToList(),
|
||||||
EServerColName.SubRemarks => lstProfile.OrderByDescending(t => t.Subid).ToList(),
|
EServerColName.SubRemarks => lstProfile.OrderByDescending(t => t.Subid).ToList(),
|
||||||
|
EServerColName.TodayDown => lstProfile.OrderByDescending(t => t.TodayDown).ToList(),
|
||||||
|
EServerColName.TodayUp => lstProfile.OrderByDescending(t => t.TodayUp).ToList(),
|
||||||
|
EServerColName.TotalDown => lstProfile.OrderByDescending(t => t.TotalDown).ToList(),
|
||||||
|
EServerColName.TotalUp => lstProfile.OrderByDescending(t => t.TotalUp).ToList(),
|
||||||
_ => lstProfile
|
_ => lstProfile
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
42
v2rayN/ServiceLib/Handler/ConnectionHandler.cs
Normal file
42
v2rayN/ServiceLib/Handler/ConnectionHandler.cs
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
namespace ServiceLib.Handler;
|
||||||
|
|
||||||
|
public class ConnectionHandler
|
||||||
|
{
|
||||||
|
private static readonly Lazy<ConnectionHandler> _instance = new(() => new());
|
||||||
|
public static ConnectionHandler Instance => _instance.Value;
|
||||||
|
|
||||||
|
public async Task<string> RunAvailabilityCheck()
|
||||||
|
{
|
||||||
|
var downloadHandle = new DownloadService();
|
||||||
|
var time = await downloadHandle.RunAvailabilityCheck(null);
|
||||||
|
var ip = time > 0 ? await GetIPInfo(downloadHandle) ?? Global.None : Global.None;
|
||||||
|
|
||||||
|
return string.Format(ResUI.TestMeOutput, time, ip);
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task<string?> GetIPInfo(DownloadService downloadHandle)
|
||||||
|
{
|
||||||
|
var url = AppHandler.Instance.Config.SpeedTestItem.IPAPIUrl;
|
||||||
|
if (url.IsNullOrEmpty())
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
var result = await downloadHandle.TryDownloadString(url, true, "");
|
||||||
|
if (result == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
var ipInfo = JsonUtils.Deserialize<IPAPIInfo>(result);
|
||||||
|
if (ipInfo == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
var ip = ipInfo.ip ?? ipInfo.clientIp ?? ipInfo.ip_addr ?? ipInfo.query;
|
||||||
|
var country = ipInfo.country_code ?? ipInfo.country ?? ipInfo.countryCode ?? ipInfo.location?.country_code;
|
||||||
|
|
||||||
|
return $"({country ?? "unknown"}) {ip}";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -6,9 +6,9 @@ public class VmessFmt : BaseFmt
|
|||||||
{
|
{
|
||||||
msg = ResUI.ConfigurationFormatIncorrect;
|
msg = ResUI.ConfigurationFormatIncorrect;
|
||||||
ProfileItem? item;
|
ProfileItem? item;
|
||||||
if (str.IndexOf('?') > 0 && str.IndexOf('&') > 0)
|
if (str.IndexOf('@') > 0)
|
||||||
{
|
{
|
||||||
item = ResolveStdVmess(str);
|
item = ResolveStdVmess(str) ?? ResolveVmess(str, out msg);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -156,6 +156,7 @@ public class SpeedTestItem
|
|||||||
public string SpeedTestUrl { get; set; }
|
public string SpeedTestUrl { get; set; }
|
||||||
public string SpeedPingTestUrl { get; set; }
|
public string SpeedPingTestUrl { get; set; }
|
||||||
public int MixedConcurrencyCount { get; set; }
|
public int MixedConcurrencyCount { get; set; }
|
||||||
|
public string IPAPIUrl { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
[Serializable]
|
[Serializable]
|
||||||
|
|||||||
@@ -3,10 +3,17 @@ namespace ServiceLib.Models;
|
|||||||
internal class IPAPIInfo
|
internal class IPAPIInfo
|
||||||
{
|
{
|
||||||
public string? ip { get; set; }
|
public string? ip { get; set; }
|
||||||
public string? city { get; set; }
|
public string? clientIp { get; set; }
|
||||||
public string? region { get; set; }
|
public string? ip_addr { get; set; }
|
||||||
public string? region_code { get; set; }
|
public string? query { get; set; }
|
||||||
public string? country { get; set; }
|
public string? country { get; set; }
|
||||||
public string? country_name { get; set; }
|
public string? country_name { get; set; }
|
||||||
public string? country_code { get; set; }
|
public string? country_code { get; set; }
|
||||||
|
public string? countryCode { get; set; }
|
||||||
|
public LocationInfo? location { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class LocationInfo
|
||||||
|
{
|
||||||
|
public string? country_code { get; set; }
|
||||||
}
|
}
|
||||||
|
|||||||
9
v2rayN/ServiceLib/Resx/ResUI.Designer.cs
generated
9
v2rayN/ServiceLib/Resx/ResUI.Designer.cs
generated
@@ -3201,6 +3201,15 @@ namespace ServiceLib.Resx {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 Current connection info test URL 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string TbSettingsIPAPIUrl {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("TbSettingsIPAPIUrl", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Keep older entries when de-duplicating 的本地化字符串。
|
/// 查找类似 Keep older entries when de-duplicating 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -1416,4 +1416,7 @@
|
|||||||
<data name="menuExportConfig" xml:space="preserve">
|
<data name="menuExportConfig" xml:space="preserve">
|
||||||
<value>صادر کردن سرور</value>
|
<value>صادر کردن سرور</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="TbSettingsIPAPIUrl" xml:space="preserve">
|
||||||
|
<value>URL آزمایش اطلاعات اتصال فعلی</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
|
|||||||
@@ -1416,4 +1416,7 @@
|
|||||||
<data name="menuExportConfig" xml:space="preserve">
|
<data name="menuExportConfig" xml:space="preserve">
|
||||||
<value>Export server</value>
|
<value>Export server</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="TbSettingsIPAPIUrl" xml:space="preserve">
|
||||||
|
<value>Current connection info test URL</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -1416,4 +1416,7 @@
|
|||||||
<data name="menuExportConfig" xml:space="preserve">
|
<data name="menuExportConfig" xml:space="preserve">
|
||||||
<value>Export Configuration</value>
|
<value>Export Configuration</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="TbSettingsIPAPIUrl" xml:space="preserve">
|
||||||
|
<value>Current connection info test URL</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -1416,4 +1416,7 @@
|
|||||||
<data name="menuExportConfig" xml:space="preserve">
|
<data name="menuExportConfig" xml:space="preserve">
|
||||||
<value>Export server</value>
|
<value>Export server</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="TbSettingsIPAPIUrl" xml:space="preserve">
|
||||||
|
<value>Current connection info test URL</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -1413,4 +1413,7 @@
|
|||||||
<data name="menuExportConfig" xml:space="preserve">
|
<data name="menuExportConfig" xml:space="preserve">
|
||||||
<value>导出配置文件</value>
|
<value>导出配置文件</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="TbSettingsIPAPIUrl" xml:space="preserve">
|
||||||
|
<value>当前连接信息测试地址</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -1413,4 +1413,7 @@
|
|||||||
<data name="menuExportConfig" xml:space="preserve">
|
<data name="menuExportConfig" xml:space="preserve">
|
||||||
<value>匯出設定檔</value>
|
<value>匯出設定檔</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="TbSettingsIPAPIUrl" xml:space="preserve">
|
||||||
|
<value>目前連接資訊測試地址</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -6,11 +6,10 @@
|
|||||||
"servers": [
|
"servers": [
|
||||||
{
|
{
|
||||||
"address": "1.1.1.1",
|
"address": "1.1.1.1",
|
||||||
|
"skipFallback": true,
|
||||||
"domains": [
|
"domains": [
|
||||||
"geosite:geolocation-!cn"
|
"domain:googleapis.cn",
|
||||||
],
|
"domain:gstatic.com"
|
||||||
"expectIPs": [
|
|
||||||
"geoip:!cn"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -23,6 +22,7 @@
|
|||||||
"geoip:cn"
|
"geoip:cn"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"1.1.1.1",
|
||||||
"8.8.8.8",
|
"8.8.8.8",
|
||||||
"https://dns.google/dns-query"
|
"https://dns.google/dns-query"
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -979,26 +979,6 @@ public class CoreConfigSingboxService
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
var dnsOutbound = "dns_out";
|
var dnsOutbound = "dns_out";
|
||||||
if (!_config.Inbound.First().SniffingEnabled)
|
|
||||||
{
|
|
||||||
singboxConfig.route.rules.Add(new()
|
|
||||||
{
|
|
||||||
port = [53],
|
|
||||||
network = ["udp"],
|
|
||||||
outbound = dnsOutbound
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
singboxConfig.route.rules.Insert(0, new()
|
|
||||||
{
|
|
||||||
outbound = Global.DirectTag,
|
|
||||||
clash_mode = ERuleMode.Direct.ToString()
|
|
||||||
});
|
|
||||||
singboxConfig.route.rules.Insert(0, new()
|
|
||||||
{
|
|
||||||
outbound = Global.ProxyTag,
|
|
||||||
clash_mode = ERuleMode.Global.ToString()
|
|
||||||
});
|
|
||||||
|
|
||||||
if (_config.TunModeItem.EnableTun)
|
if (_config.TunModeItem.EnableTun)
|
||||||
{
|
{
|
||||||
@@ -1025,6 +1005,27 @@ public class CoreConfigSingboxService
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!_config.Inbound.First().SniffingEnabled)
|
||||||
|
{
|
||||||
|
singboxConfig.route.rules.Add(new()
|
||||||
|
{
|
||||||
|
port = [53],
|
||||||
|
network = ["udp"],
|
||||||
|
outbound = dnsOutbound
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
singboxConfig.route.rules.Add(new()
|
||||||
|
{
|
||||||
|
outbound = Global.DirectTag,
|
||||||
|
clash_mode = ERuleMode.Direct.ToString()
|
||||||
|
});
|
||||||
|
singboxConfig.route.rules.Add(new()
|
||||||
|
{
|
||||||
|
outbound = Global.ProxyTag,
|
||||||
|
clash_mode = ERuleMode.Global.ToString()
|
||||||
|
});
|
||||||
|
|
||||||
var routing = await ConfigHandler.GetDefaultRouting(_config);
|
var routing = await ConfigHandler.GetDefaultRouting(_config);
|
||||||
if (routing != null)
|
if (routing != null)
|
||||||
{
|
{
|
||||||
@@ -1047,28 +1048,30 @@ public class CoreConfigSingboxService
|
|||||||
|
|
||||||
private void GenRoutingDirectExe(out List<string> lstDnsExe, out List<string> lstDirectExe)
|
private void GenRoutingDirectExe(out List<string> lstDnsExe, out List<string> lstDirectExe)
|
||||||
{
|
{
|
||||||
lstDnsExe = new();
|
var dnsExeSet = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
||||||
lstDirectExe = new();
|
var directExeSet = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
||||||
var coreInfo = CoreInfoHandler.Instance.GetCoreInfo();
|
|
||||||
foreach (var it in coreInfo)
|
var coreInfoResult = CoreInfoHandler.Instance.GetCoreInfo();
|
||||||
|
|
||||||
|
foreach (var coreConfig in coreInfoResult)
|
||||||
{
|
{
|
||||||
if (it.CoreType == ECoreType.v2rayN)
|
if (coreConfig.CoreType == ECoreType.v2rayN)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
foreach (var it2 in it.CoreExes)
|
|
||||||
{
|
|
||||||
if (!lstDnsExe.Contains(it2) && it.CoreType != ECoreType.sing_box)
|
|
||||||
{
|
|
||||||
lstDnsExe.Add($"{it2}.exe");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!lstDirectExe.Contains(it2))
|
foreach (var baseExeName in coreConfig.CoreExes)
|
||||||
|
{
|
||||||
|
if (coreConfig.CoreType != ECoreType.sing_box)
|
||||||
{
|
{
|
||||||
lstDirectExe.Add($"{it2}.exe");
|
dnsExeSet.Add(Utils.GetExeName(baseExeName));
|
||||||
}
|
}
|
||||||
|
directExeSet.Add(Utils.GetExeName(baseExeName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lstDnsExe = new List<string>(dnsExeSet);
|
||||||
|
lstDirectExe = new List<string>(directExeSet);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<int> GenRoutingUserRule(RulesItem item, List<Rule4Sbox> rules)
|
private async Task<int> GenRoutingUserRule(RulesItem item, List<Rule4Sbox> rules)
|
||||||
@@ -1087,14 +1090,11 @@ public class CoreConfigSingboxService
|
|||||||
|
|
||||||
if (item.Port.IsNotEmpty())
|
if (item.Port.IsNotEmpty())
|
||||||
{
|
{
|
||||||
if (item.Port.Contains("-"))
|
var portRanges = item.Port.Split(',').Where(it => it.Contains('-')).Select(it => it.Replace("-", ":")).ToList();
|
||||||
{
|
var ports = item.Port.Split(',').Where(it => !it.Contains('-')).Select(it => it.ToInt()).ToList();
|
||||||
rule.port_range = new List<string> { item.Port.Replace("-", ":") };
|
|
||||||
}
|
rule.port_range = portRanges.Count > 0 ? portRanges : null;
|
||||||
else
|
rule.port = ports.Count > 0 ? ports : null;
|
||||||
{
|
|
||||||
rule.port = new List<int> { item.Port.ToInt() };
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (item.Network.IsNotEmpty())
|
if (item.Network.IsNotEmpty())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -328,7 +328,7 @@ public class CoreConfigV2rayService
|
|||||||
{
|
{
|
||||||
listen = Global.Loopback,
|
listen = Global.Loopback,
|
||||||
port = port,
|
port = port,
|
||||||
protocol = EInboundProtocol.socks.ToString(),
|
protocol = EInboundProtocol.mixed.ToString(),
|
||||||
};
|
};
|
||||||
inbound.tag = inbound.protocol + inbound.port.ToString();
|
inbound.tag = inbound.protocol + inbound.port.ToString();
|
||||||
v2rayConfig.inbounds.Add(inbound);
|
v2rayConfig.inbounds.Add(inbound);
|
||||||
@@ -403,7 +403,7 @@ public class CoreConfigV2rayService
|
|||||||
tag = $"{EInboundProtocol.socks}{port}",
|
tag = $"{EInboundProtocol.socks}{port}",
|
||||||
listen = Global.Loopback,
|
listen = Global.Loopback,
|
||||||
port = port,
|
port = port,
|
||||||
protocol = EInboundProtocol.socks.ToString(),
|
protocol = EInboundProtocol.mixed.ToString(),
|
||||||
});
|
});
|
||||||
|
|
||||||
ret.Msg = string.Format(ResUI.SuccessfulConfiguration, "");
|
ret.Msg = string.Format(ResUI.SuccessfulConfiguration, "");
|
||||||
@@ -507,7 +507,7 @@ public class CoreConfigV2rayService
|
|||||||
}
|
}
|
||||||
inbound.tag = protocol.ToString();
|
inbound.tag = protocol.ToString();
|
||||||
inbound.port = inItem.LocalPort + (int)protocol;
|
inbound.port = inItem.LocalPort + (int)protocol;
|
||||||
inbound.protocol = EInboundProtocol.socks.ToString();
|
inbound.protocol = EInboundProtocol.mixed.ToString();
|
||||||
inbound.settings.udp = inItem.UdpEnabled;
|
inbound.settings.udp = inItem.UdpEnabled;
|
||||||
inbound.sniffing.enabled = inItem.SniffingEnabled;
|
inbound.sniffing.enabled = inItem.SniffingEnabled;
|
||||||
inbound.sniffing.destOverride = inItem.DestOverride;
|
inbound.sniffing.destOverride = inItem.DestOverride;
|
||||||
|
|||||||
@@ -194,11 +194,11 @@ public class UpdateService
|
|||||||
{
|
{
|
||||||
if (Utils.IsBase64String(result2))
|
if (Utils.IsBase64String(result2))
|
||||||
{
|
{
|
||||||
result += Utils.Base64Decode(result2);
|
result += Environment.NewLine + Utils.Base64Decode(result2);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
result += result2;
|
result += Environment.NewLine + result2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -243,21 +243,6 @@ public class UpdateService
|
|||||||
_updateFunc?.Invoke(true, string.Format(ResUI.MsgDownloadGeoFileSuccessfully, "geo"));
|
_updateFunc?.Invoke(true, string.Format(ResUI.MsgDownloadGeoFileSuccessfully, "geo"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<string> RunAvailabilityCheck()
|
|
||||||
{
|
|
||||||
var downloadHandle = new DownloadService();
|
|
||||||
var time = await downloadHandle.RunAvailabilityCheck(null);
|
|
||||||
var ip = Global.None;
|
|
||||||
if (time > 0)
|
|
||||||
{
|
|
||||||
var result = await downloadHandle.TryDownloadString(Global.IPAPIUrl, true, Global.IPAPIUrl);
|
|
||||||
var ipInfo = JsonUtils.Deserialize<IPAPIInfo>(result);
|
|
||||||
ip = $"({ipInfo?.country_code}) {ipInfo?.ip}";
|
|
||||||
}
|
|
||||||
|
|
||||||
return string.Format(ResUI.TestMeOutput, time, ip);
|
|
||||||
}
|
|
||||||
|
|
||||||
#region CheckUpdate private
|
#region CheckUpdate private
|
||||||
|
|
||||||
private async Task<RetResult> CheckUpdateAsync(DownloadService downloadHandle, ECoreType type, bool preRelease)
|
private async Task<RetResult> CheckUpdateAsync(DownloadService downloadHandle, ECoreType type, bool preRelease)
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ public class OptionSettingViewModel : MyReactiveObject
|
|||||||
[Reactive] public string GeoFileSourceUrl { get; set; }
|
[Reactive] public string GeoFileSourceUrl { get; set; }
|
||||||
[Reactive] public string SrsFileSourceUrl { get; set; }
|
[Reactive] public string SrsFileSourceUrl { get; set; }
|
||||||
[Reactive] public string RoutingRulesSourceUrl { get; set; }
|
[Reactive] public string RoutingRulesSourceUrl { get; set; }
|
||||||
|
[Reactive] public string IPAPIUrl { get; set; }
|
||||||
|
|
||||||
#endregion UI
|
#endregion UI
|
||||||
|
|
||||||
@@ -186,6 +187,7 @@ public class OptionSettingViewModel : MyReactiveObject
|
|||||||
GeoFileSourceUrl = _config.ConstItem.GeoSourceUrl;
|
GeoFileSourceUrl = _config.ConstItem.GeoSourceUrl;
|
||||||
SrsFileSourceUrl = _config.ConstItem.SrsSourceUrl;
|
SrsFileSourceUrl = _config.ConstItem.SrsSourceUrl;
|
||||||
RoutingRulesSourceUrl = _config.ConstItem.RouteRulesTemplateSourceUrl;
|
RoutingRulesSourceUrl = _config.ConstItem.RouteRulesTemplateSourceUrl;
|
||||||
|
IPAPIUrl = _config.SpeedTestItem.IPAPIUrl;
|
||||||
|
|
||||||
#endregion UI
|
#endregion UI
|
||||||
|
|
||||||
@@ -344,6 +346,7 @@ public class OptionSettingViewModel : MyReactiveObject
|
|||||||
_config.ConstItem.GeoSourceUrl = GeoFileSourceUrl;
|
_config.ConstItem.GeoSourceUrl = GeoFileSourceUrl;
|
||||||
_config.ConstItem.SrsSourceUrl = SrsFileSourceUrl;
|
_config.ConstItem.SrsSourceUrl = SrsFileSourceUrl;
|
||||||
_config.ConstItem.RouteRulesTemplateSourceUrl = RoutingRulesSourceUrl;
|
_config.ConstItem.RouteRulesTemplateSourceUrl = RoutingRulesSourceUrl;
|
||||||
|
_config.SpeedTestItem.IPAPIUrl = IPAPIUrl;
|
||||||
|
|
||||||
//systemProxy
|
//systemProxy
|
||||||
_config.SystemProxyItem.SystemProxyExceptions = systemProxyExceptions;
|
_config.SystemProxyItem.SystemProxyExceptions = systemProxyExceptions;
|
||||||
@@ -356,7 +359,7 @@ public class OptionSettingViewModel : MyReactiveObject
|
|||||||
_config.TunModeItem.Mtu = TunMtu;
|
_config.TunModeItem.Mtu = TunMtu;
|
||||||
_config.TunModeItem.EnableExInbound = TunEnableExInbound;
|
_config.TunModeItem.EnableExInbound = TunEnableExInbound;
|
||||||
_config.TunModeItem.EnableIPv6Address = TunEnableIPv6Address;
|
_config.TunModeItem.EnableIPv6Address = TunEnableIPv6Address;
|
||||||
|
|
||||||
//coreType
|
//coreType
|
||||||
await SaveCoreType();
|
await SaveCoreType();
|
||||||
|
|
||||||
|
|||||||
@@ -320,7 +320,7 @@ public class StatusBarViewModel : MyReactiveObject
|
|||||||
|
|
||||||
var msg = await Task.Run(async () =>
|
var msg = await Task.Run(async () =>
|
||||||
{
|
{
|
||||||
return await (new UpdateService()).RunAvailabilityCheck();
|
return await ConnectionHandler.Instance.RunAvailabilityCheck();
|
||||||
});
|
});
|
||||||
|
|
||||||
NoticeHandler.Instance.SendMessageEx(msg);
|
NoticeHandler.Instance.SendMessageEx(msg);
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ public partial class App : Application
|
|||||||
{
|
{
|
||||||
if (e.ExceptionObject != null)
|
if (e.ExceptionObject != null)
|
||||||
{
|
{
|
||||||
Logging.SaveLog("CurrentDomain_UnhandledException", (Exception)e.ExceptionObject!);
|
Logging.SaveLog("CurrentDomain_UnhandledException", (Exception)e.ExceptionObject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -52,9 +52,16 @@ public partial class ClashConnectionsView : ReactiveUserControl<ClashConnections
|
|||||||
|
|
||||||
private void AutofitColumnWidth()
|
private void AutofitColumnWidth()
|
||||||
{
|
{
|
||||||
foreach (var it in lstConnections.Columns)
|
try
|
||||||
{
|
{
|
||||||
it.Width = new DataGridLength(1, DataGridLengthUnitType.Auto);
|
foreach (var it in lstConnections.Columns)
|
||||||
|
{
|
||||||
|
it.Width = new DataGridLength(1, DataGridLengthUnitType.Auto);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Logging.SaveLog("ClashConnectionsView", ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -388,7 +388,7 @@ public partial class MainWindow : ReactiveWindow<MainWindowViewModel>
|
|||||||
|
|
||||||
private async void MenuClose_Click(object? sender, RoutedEventArgs e)
|
private async void MenuClose_Click(object? sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
if (await UI.ShowYesNo(this, ResUI.menuExitTips) == ButtonResult.No)
|
if (await UI.ShowYesNo(this, ResUI.menuExitTips) != ButtonResult.Yes)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -343,7 +343,7 @@
|
|||||||
<Grid
|
<Grid
|
||||||
Margin="{StaticResource Margin4}"
|
Margin="{StaticResource Margin4}"
|
||||||
ColumnDefinitions="Auto,Auto,*"
|
ColumnDefinitions="Auto,Auto,*"
|
||||||
RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto">
|
RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto">
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
x:Name="tbAutoRun"
|
x:Name="tbAutoRun"
|
||||||
@@ -655,6 +655,20 @@
|
|||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Text="{x:Static resx:ResUI.TbSettingsChinaUserTip}"
|
Text="{x:Static resx:ResUI.TbSettingsChinaUserTip}"
|
||||||
TextWrapping="Wrap" />
|
TextWrapping="Wrap" />
|
||||||
|
|
||||||
|
<TextBlock
|
||||||
|
Grid.Row="25"
|
||||||
|
Grid.Column="0"
|
||||||
|
Margin="{StaticResource Margin4}"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="{x:Static resx:ResUI.TbSettingsIPAPIUrl}" />
|
||||||
|
<ComboBox
|
||||||
|
x:Name="cmbIPAPIUrl"
|
||||||
|
Grid.Row="25"
|
||||||
|
Grid.Column="1"
|
||||||
|
Width="300"
|
||||||
|
Margin="{StaticResource Margin4}" />
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
|
|||||||
@@ -92,6 +92,10 @@ public partial class OptionSettingWindow : ReactiveWindow<OptionSettingViewModel
|
|||||||
{
|
{
|
||||||
cmbRoutingRulesSourceUrl.Items.Add(it);
|
cmbRoutingRulesSourceUrl.Items.Add(it);
|
||||||
});
|
});
|
||||||
|
Global.IPAPIUrls.ForEach(it =>
|
||||||
|
{
|
||||||
|
cmbIPAPIUrl.Items.Add(it);
|
||||||
|
});
|
||||||
foreach (EGirdOrientation it in Enum.GetValues(typeof(EGirdOrientation)))
|
foreach (EGirdOrientation it in Enum.GetValues(typeof(EGirdOrientation)))
|
||||||
{
|
{
|
||||||
cmbMainGirdOrientation.Items.Add(it.ToString());
|
cmbMainGirdOrientation.Items.Add(it.ToString());
|
||||||
@@ -143,6 +147,7 @@ public partial class OptionSettingWindow : ReactiveWindow<OptionSettingViewModel
|
|||||||
this.Bind(ViewModel, vm => vm.GeoFileSourceUrl, v => v.cmbGetFilesSourceUrl.SelectedValue).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.GeoFileSourceUrl, v => v.cmbGetFilesSourceUrl.SelectedValue).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.SrsFileSourceUrl, v => v.cmbSrsFilesSourceUrl.SelectedValue).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SrsFileSourceUrl, v => v.cmbSrsFilesSourceUrl.SelectedValue).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.RoutingRulesSourceUrl, v => v.cmbRoutingRulesSourceUrl.SelectedValue).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.RoutingRulesSourceUrl, v => v.cmbRoutingRulesSourceUrl.SelectedValue).DisposeWith(disposables);
|
||||||
|
this.Bind(ViewModel, vm => vm.IPAPIUrl, v => v.cmbIPAPIUrl.SelectedValue).DisposeWith(disposables);
|
||||||
|
|
||||||
this.Bind(ViewModel, vm => vm.notProxyLocalAddress, v => v.tognotProxyLocalAddress.IsChecked).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.notProxyLocalAddress, v => v.tognotProxyLocalAddress.IsChecked).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.systemProxyAdvancedProtocol, v => v.cmbsystemProxyAdvancedProtocol.SelectedValue).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.systemProxyAdvancedProtocol, v => v.cmbsystemProxyAdvancedProtocol.SelectedValue).DisposeWith(disposables);
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ public partial class ProfilesView : ReactiveUserControl<ProfilesViewModel>
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case EViewAction.ShowYesNo:
|
case EViewAction.ShowYesNo:
|
||||||
if (await UI.ShowYesNo(_window, ResUI.RemoveServer) == ButtonResult.No)
|
if (await UI.ShowYesNo(_window, ResUI.RemoveServer) != ButtonResult.Yes)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -345,9 +345,16 @@ public partial class ProfilesView : ReactiveUserControl<ProfilesViewModel>
|
|||||||
|
|
||||||
private void AutofitColumnWidth()
|
private void AutofitColumnWidth()
|
||||||
{
|
{
|
||||||
foreach (var it in lstProfiles.Columns)
|
try
|
||||||
{
|
{
|
||||||
it.Width = new DataGridLength(1, DataGridLengthUnitType.Auto);
|
foreach (var it in lstProfiles.Columns)
|
||||||
|
{
|
||||||
|
it.Width = new DataGridLength(1, DataGridLengthUnitType.Auto);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Logging.SaveLog("ProfilesView", ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -80,14 +80,14 @@ public partial class RoutingRuleSettingWindow : ReactiveWindow<RoutingRuleSettin
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case EViewAction.ShowYesNo:
|
case EViewAction.ShowYesNo:
|
||||||
if (await UI.ShowYesNo(this, ResUI.RemoveServer) == ButtonResult.No)
|
if (await UI.ShowYesNo(this, ResUI.RemoveServer) != ButtonResult.Yes)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EViewAction.AddBatchRoutingRulesYesNo:
|
case EViewAction.AddBatchRoutingRulesYesNo:
|
||||||
if (await UI.ShowYesNo(this, ResUI.AddBatchRoutingRulesYesNo) == ButtonResult.No)
|
if (await UI.ShowYesNo(this, ResUI.AddBatchRoutingRulesYesNo) != ButtonResult.Yes)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ public partial class RoutingSettingWindow : ReactiveWindow<RoutingSettingViewMod
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case EViewAction.ShowYesNo:
|
case EViewAction.ShowYesNo:
|
||||||
if (await UI.ShowYesNo(this, ResUI.RemoveRules) == ButtonResult.No)
|
if (await UI.ShowYesNo(this, ResUI.RemoveRules) != ButtonResult.Yes)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ public partial class SubSettingWindow : ReactiveWindow<SubSettingViewModel>
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case EViewAction.ShowYesNo:
|
case EViewAction.ShowYesNo:
|
||||||
if (await UI.ShowYesNo(this, ResUI.RemoveServer) == ButtonResult.No)
|
if (await UI.ShowYesNo(this, ResUI.RemoveServer) != ButtonResult.Yes)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ public partial class App : Application
|
|||||||
{
|
{
|
||||||
if (e.ExceptionObject != null)
|
if (e.ExceptionObject != null)
|
||||||
{
|
{
|
||||||
Logging.SaveLog("CurrentDomain_UnhandledException", (Exception)e.ExceptionObject!);
|
Logging.SaveLog("CurrentDomain_UnhandledException", (Exception)e.ExceptionObject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -55,9 +55,16 @@ public partial class ClashConnectionsView
|
|||||||
|
|
||||||
private void AutofitColumnWidth()
|
private void AutofitColumnWidth()
|
||||||
{
|
{
|
||||||
foreach (var it in lstConnections.Columns)
|
try
|
||||||
{
|
{
|
||||||
it.Width = new DataGridLength(1, DataGridLengthUnitType.Auto);
|
foreach (var it in lstConnections.Columns)
|
||||||
|
{
|
||||||
|
it.Width = new DataGridLength(1, DataGridLengthUnitType.Auto);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Logging.SaveLog("ClashConnectionsView", ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -552,6 +552,7 @@
|
|||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
@@ -942,6 +943,22 @@
|
|||||||
Style="{StaticResource ToolbarTextBlock}"
|
Style="{StaticResource ToolbarTextBlock}"
|
||||||
Text="{x:Static resx:ResUI.TbSettingsChinaUserTip}"
|
Text="{x:Static resx:ResUI.TbSettingsChinaUserTip}"
|
||||||
TextWrapping="Wrap" />
|
TextWrapping="Wrap" />
|
||||||
|
|
||||||
|
<TextBlock
|
||||||
|
Grid.Row="25"
|
||||||
|
Grid.Column="0"
|
||||||
|
Margin="{StaticResource Margin8}"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Style="{StaticResource ToolbarTextBlock}"
|
||||||
|
Text="{x:Static resx:ResUI.TbSettingsIPAPIUrl}" />
|
||||||
|
<ComboBox
|
||||||
|
x:Name="cmbIPAPIUrl"
|
||||||
|
Grid.Row="25"
|
||||||
|
Grid.Column="1"
|
||||||
|
Width="300"
|
||||||
|
Margin="{StaticResource Margin8}"
|
||||||
|
IsEditable="True"
|
||||||
|
Style="{StaticResource DefComboBox}" />
|
||||||
</Grid>
|
</Grid>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
|
|||||||
@@ -101,6 +101,10 @@ public partial class OptionSettingWindow
|
|||||||
{
|
{
|
||||||
cmbRoutingRulesSourceUrl.Items.Add(it);
|
cmbRoutingRulesSourceUrl.Items.Add(it);
|
||||||
});
|
});
|
||||||
|
Global.IPAPIUrls.ForEach(it =>
|
||||||
|
{
|
||||||
|
cmbIPAPIUrl.Items.Add(it);
|
||||||
|
});
|
||||||
foreach (EGirdOrientation it in Enum.GetValues(typeof(EGirdOrientation)))
|
foreach (EGirdOrientation it in Enum.GetValues(typeof(EGirdOrientation)))
|
||||||
{
|
{
|
||||||
cmbMainGirdOrientation.Items.Add(it.ToString());
|
cmbMainGirdOrientation.Items.Add(it.ToString());
|
||||||
@@ -162,6 +166,7 @@ public partial class OptionSettingWindow
|
|||||||
this.Bind(ViewModel, vm => vm.GeoFileSourceUrl, v => v.cmbGetFilesSourceUrl.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.GeoFileSourceUrl, v => v.cmbGetFilesSourceUrl.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.SrsFileSourceUrl, v => v.cmbSrsFilesSourceUrl.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SrsFileSourceUrl, v => v.cmbSrsFilesSourceUrl.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.RoutingRulesSourceUrl, v => v.cmbRoutingRulesSourceUrl.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.RoutingRulesSourceUrl, v => v.cmbRoutingRulesSourceUrl.Text).DisposeWith(disposables);
|
||||||
|
this.Bind(ViewModel, vm => vm.IPAPIUrl, v => v.cmbIPAPIUrl.Text).DisposeWith(disposables);
|
||||||
|
|
||||||
this.Bind(ViewModel, vm => vm.notProxyLocalAddress, v => v.tognotProxyLocalAddress.IsChecked).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.notProxyLocalAddress, v => v.tognotProxyLocalAddress.IsChecked).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.systemProxyAdvancedProtocol, v => v.cmbsystemProxyAdvancedProtocol.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.systemProxyAdvancedProtocol, v => v.cmbsystemProxyAdvancedProtocol.Text).DisposeWith(disposables);
|
||||||
|
|||||||
@@ -18,9 +18,6 @@
|
|||||||
<UserControl.Resources>
|
<UserControl.Resources>
|
||||||
<BooleanToVisibilityConverter x:Key="BoolToVisConverter" />
|
<BooleanToVisibilityConverter x:Key="BoolToVisConverter" />
|
||||||
<conv:DelayColorConverter x:Key="DelayColorConverter" />
|
<conv:DelayColorConverter x:Key="DelayColorConverter" />
|
||||||
<Style x:Key="AccessibleMyChipListBoxItem" TargetType="ListBoxItem" BasedOn="{StaticResource MyChipListBoxItem}">
|
|
||||||
<Setter Property="AutomationProperties.Name" Value="{Binding Remarks}" />
|
|
||||||
</Style>
|
|
||||||
</UserControl.Resources>
|
</UserControl.Resources>
|
||||||
<Grid>
|
<Grid>
|
||||||
<DockPanel>
|
<DockPanel>
|
||||||
@@ -28,10 +25,10 @@
|
|||||||
<ListBox
|
<ListBox
|
||||||
x:Name="lstGroup"
|
x:Name="lstGroup"
|
||||||
MaxHeight="200"
|
MaxHeight="200"
|
||||||
|
AutomationProperties.Name="{x:Static resx:ResUI.menuSubscription}"
|
||||||
FontSize="{DynamicResource StdFontSize}"
|
FontSize="{DynamicResource StdFontSize}"
|
||||||
ItemContainerStyle="{StaticResource AccessibleMyChipListBoxItem}"
|
ItemContainerStyle="{StaticResource MyChipListBoxItem}"
|
||||||
Style="{StaticResource MaterialDesignChoiceChipPrimaryOutlineListBox}"
|
Style="{StaticResource MaterialDesignChoiceChipPrimaryOutlineListBox}">
|
||||||
AutomationProperties.Name="{x:Static resx:ResUI.menuSubscription}">
|
|
||||||
<ListBox.ItemTemplate>
|
<ListBox.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<TextBlock Text="{Binding Remarks}" />
|
<TextBlock Text="{Binding Remarks}" />
|
||||||
|
|||||||
@@ -323,9 +323,16 @@ public partial class ProfilesView
|
|||||||
|
|
||||||
private void AutofitColumnWidth()
|
private void AutofitColumnWidth()
|
||||||
{
|
{
|
||||||
foreach (var it in lstProfiles.Columns)
|
try
|
||||||
{
|
{
|
||||||
it.Width = new DataGridLength(1, DataGridLengthUnitType.Auto);
|
foreach (var it in lstProfiles.Columns)
|
||||||
|
{
|
||||||
|
it.Width = new DataGridLength(1, DataGridLengthUnitType.Auto);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Logging.SaveLog("ProfilesView", ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -92,12 +92,7 @@
|
|||||||
AutomationProperties.Name="{x:Static resx:ResUI.menuRouting}"
|
AutomationProperties.Name="{x:Static resx:ResUI.menuRouting}"
|
||||||
DisplayMemberPath="Remarks"
|
DisplayMemberPath="Remarks"
|
||||||
FontSize="{DynamicResource StdFontSize}"
|
FontSize="{DynamicResource StdFontSize}"
|
||||||
Style="{StaticResource MaterialDesignFloatingHintComboBox}">
|
Style="{StaticResource MaterialDesignFloatingHintComboBox}">
|
||||||
<ComboBox.ItemContainerStyle>
|
|
||||||
<Style TargetType="ComboBoxItem">
|
|
||||||
<Setter Property="AutomationProperties.Name" Value="{Binding Remarks}" />
|
|
||||||
</Style>
|
|
||||||
</ComboBox.ItemContainerStyle>
|
|
||||||
</ComboBox>
|
</ComboBox>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
@@ -190,12 +185,7 @@
|
|||||||
AutomationProperties.Name="{x:Static resx:ResUI.menuRouting}"
|
AutomationProperties.Name="{x:Static resx:ResUI.menuRouting}"
|
||||||
DisplayMemberPath="Remarks"
|
DisplayMemberPath="Remarks"
|
||||||
FontSize="{DynamicResource StdFontSize}"
|
FontSize="{DynamicResource StdFontSize}"
|
||||||
Style="{StaticResource MaterialDesignFilledComboBox}">
|
Style="{StaticResource MaterialDesignFilledComboBox}">
|
||||||
<ComboBox.ItemContainerStyle>
|
|
||||||
<Style TargetType="ComboBoxItem">
|
|
||||||
<Setter Property="AutomationProperties.Name" Value="{Binding Remarks}" />
|
|
||||||
</Style>
|
|
||||||
</ComboBox.ItemContainerStyle>
|
|
||||||
</ComboBox>
|
</ComboBox>
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
</MenuItem.Header>
|
</MenuItem.Header>
|
||||||
@@ -210,12 +200,7 @@
|
|||||||
AutomationProperties.Name="{x:Static resx:ResUI.menuServers}"
|
AutomationProperties.Name="{x:Static resx:ResUI.menuServers}"
|
||||||
DisplayMemberPath="Text"
|
DisplayMemberPath="Text"
|
||||||
FontSize="{DynamicResource StdFontSize}"
|
FontSize="{DynamicResource StdFontSize}"
|
||||||
Style="{StaticResource MaterialDesignFilledComboBox}">
|
Style="{StaticResource MaterialDesignFilledComboBox}">
|
||||||
<ComboBox.ItemContainerStyle>
|
|
||||||
<Style TargetType="ComboBoxItem">
|
|
||||||
<Setter Property="AutomationProperties.Name" Value="{Binding Text}" />
|
|
||||||
</Style>
|
|
||||||
</ComboBox.ItemContainerStyle>
|
|
||||||
</ComboBox>
|
</ComboBox>
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
</MenuItem.Header>
|
</MenuItem.Header>
|
||||||
|
|||||||
Reference in New Issue
Block a user