mirror of
https://github.com/netchx/netch.git
synced 2026-03-18 18:13:21 +08:00
Update Edit Process Mode Form
This commit is contained in:
@@ -35,8 +35,9 @@ namespace Netch.Controllers
|
||||
aio_dial((int) NameList.TYPE_FILTERTCP, (Global.Settings.ProcessProxyProtocol != PortType.UDP).ToString().ToLower());
|
||||
SetServer(Global.Settings.ProcessProxyProtocol);
|
||||
|
||||
if (!CheckRule(mode.FullRule, out var list))
|
||||
throw new MessageException($"\"{string.Join("", list.Select(s => s + "\n"))}\" does not conform to C++ regular expression syntax");
|
||||
var result = CheckRuleMessageResult(mode.FullRule);
|
||||
if (result != null)
|
||||
throw new MessageException(result);
|
||||
|
||||
SetName(mode);
|
||||
|
||||
@@ -71,6 +72,14 @@ namespace Netch.Controllers
|
||||
return !incompatibleRule.Any();
|
||||
}
|
||||
|
||||
public static string? CheckRuleMessageResult(IEnumerable<string> rules)
|
||||
{
|
||||
if (CheckRule(rules, out var list))
|
||||
return null;
|
||||
|
||||
return ($"{string.Join("\n", list)}\nAbove rules does not conform to C++ regular expression syntax");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
/// <param name="r"></param>
|
||||
|
||||
Reference in New Issue
Block a user