Add the ip and domain separator convert it to a comma

pull/3786/head
2dust 2023-04-28 10:22:55 +08:00
parent c97fa3a767
commit 7b3bed015a
4 changed files with 23 additions and 14 deletions

View File

@ -466,6 +466,15 @@ namespace v2rayN
return Convert.TryFromBase64String(plainText, buffer, out int _);
}
public static string Convert2Comma(string text)
{
if (string.IsNullOrWhiteSpace(text))
{
return text;
}
return text.Replace("", ",").Replace(Environment.NewLine, ",");
}
#endregion 转换函数
#region 数据检查

View File

@ -345,11 +345,11 @@ namespace v2rayN.ViewModels
_config.tunModeItem.mtu = TunMtu;
_config.tunModeItem.customTemplate = TunCustomTemplate;
_config.tunModeItem.bypassMode = TunBypassMode;
_config.tunModeItem.directIP = Utils.String2List(TunDirectIP);
_config.tunModeItem.directProcess = Utils.String2List(TunDirectProcess);
_config.tunModeItem.directIP = Utils.String2List(Utils.Convert2Comma(TunDirectIP));
_config.tunModeItem.directProcess = Utils.String2List(Utils.Convert2Comma(TunDirectProcess));
_config.tunModeItem.directDNS = Utils.ToJson(Utils.ParseJson(TunDirectDNS));
_config.tunModeItem.proxyIP = Utils.String2List(TunProxyIP);
_config.tunModeItem.proxyProcess = Utils.String2List(TunProxyProcess);
_config.tunModeItem.proxyIP = Utils.String2List(Utils.Convert2Comma(TunProxyIP));
_config.tunModeItem.proxyProcess = Utils.String2List(Utils.Convert2Comma(TunProxyProcess));
_config.tunModeItem.proxyDNS = Utils.ToJson(Utils.ParseJson(TunProxyDNS));
//coreType

View File

@ -64,9 +64,9 @@ namespace v2rayN.ViewModels
private void SaveRules()
{
Domain = Domain.Replace(Environment.NewLine, ",");
IP = IP.Replace(Environment.NewLine, ",");
Domain = Utils.Convert2Comma(Domain);
IP = Utils.Convert2Comma(IP);
if (AutoSort)
{
SelectedSource.domain = Utils.String2ListSorted(Domain);

View File

@ -153,14 +153,14 @@ namespace v2rayN.ViewModels
{
if (_lockedItem != null)
{
_lockedRules[0].domain = Utils.String2List(ProxyDomain.TrimEx());
_lockedRules[0].ip = Utils.String2List(ProxyIP.TrimEx());
_lockedRules[0].domain = Utils.String2List(Utils.Convert2Comma(ProxyDomain.TrimEx()));
_lockedRules[0].ip = Utils.String2List(Utils.Convert2Comma(ProxyIP.TrimEx()));
_lockedRules[1].domain = Utils.String2List(DirectDomain.TrimEx());
_lockedRules[1].ip = Utils.String2List(DirectIP.TrimEx());
_lockedRules[1].domain = Utils.String2List(Utils.Convert2Comma(DirectDomain.TrimEx()));
_lockedRules[1].ip = Utils.String2List(Utils.Convert2Comma(DirectIP.TrimEx()));
_lockedRules[2].domain = Utils.String2List(BlockDomain.TrimEx());
_lockedRules[2].ip = Utils.String2List(BlockIP.TrimEx());
_lockedRules[2].domain = Utils.String2List(Utils.Convert2Comma(BlockDomain.TrimEx()));
_lockedRules[2].ip = Utils.String2List(Utils.Convert2Comma(BlockIP.TrimEx()));
_lockedItem.ruleSet = Utils.ToJson(_lockedRules, false);
@ -256,7 +256,7 @@ namespace v2rayN.ViewModels
}
}
private void RoutingAdvancedRemove()
public void RoutingAdvancedRemove()
{
if (SelectedSource is null || SelectedSource.remarks.IsNullOrEmpty())
{