mirror of
https://github.com/2dust/v2rayN.git
synced 2025-05-02 21:28:51 +00:00
add info filter the preset value
This commit is contained in:
parent
f40f926ce1
commit
3d0428c518
3 changed files with 11 additions and 4 deletions
|
@ -105,6 +105,7 @@
|
||||||
public static readonly List<string> Protocols = new List<string> { "http", "tls", "bittorrent" };
|
public static readonly List<string> Protocols = new List<string> { "http", "tls", "bittorrent" };
|
||||||
public static readonly List<string> TunMtus = new List<string> { "9000", "1500" };
|
public static readonly List<string> TunMtus = new List<string> { "9000", "1500" };
|
||||||
public static readonly List<string> TunStacks = new List<string> { "gvisor", "system" };
|
public static readonly List<string> TunStacks = new List<string> { "gvisor", "system" };
|
||||||
|
public static readonly List<string> PresetMsgFilters = new List<string> { "^(?!.*proxy).*$", "^(?!.*direct).*$" };
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
|
@ -21,12 +21,13 @@
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Foreground="{DynamicResource PrimaryHueLightBrush}"
|
Foreground="{DynamicResource PrimaryHueLightBrush}"
|
||||||
Text="{x:Static resx:ResUI.MsgInformationTitle}" />
|
Text="{x:Static resx:ResUI.MsgInformationTitle}" />
|
||||||
<TextBox
|
<ComboBox
|
||||||
x:Name="txtMsgFilter"
|
x:Name="cmbMsgFilter"
|
||||||
Width="200"
|
Width="200"
|
||||||
Margin="8,0"
|
Margin="8,0"
|
||||||
materialDesign:HintAssist.Hint="{x:Static resx:ResUI.MsgFilterTitle}"
|
materialDesign:HintAssist.Hint="{x:Static resx:ResUI.MsgFilterTitle}"
|
||||||
materialDesign:TextFieldAssist.HasClearButton="True" />
|
materialDesign:TextFieldAssist.HasClearButton="True"
|
||||||
|
IsEditable="True" />
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Margin="8,0"
|
Margin="8,0"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
|
|
|
@ -12,6 +12,11 @@ namespace v2rayN.Views
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
MessageBus.Current.Listen<string>("MsgView").Subscribe(x => DelegateAppendText(x));
|
MessageBus.Current.Listen<string>("MsgView").Subscribe(x => DelegateAppendText(x));
|
||||||
|
Global.PresetMsgFilters.ForEach(it =>
|
||||||
|
{
|
||||||
|
cmbMsgFilter.Items.Add(it);
|
||||||
|
});
|
||||||
|
cmbMsgFilter.Items.Add(string.Empty);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DelegateAppendText(string msg)
|
void DelegateAppendText(string msg)
|
||||||
|
@ -30,7 +35,7 @@ namespace v2rayN.Views
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var MsgFilter = txtMsgFilter.Text.TrimEx();
|
var MsgFilter = cmbMsgFilter.Text.TrimEx();
|
||||||
if (!Utils.IsNullOrEmpty(MsgFilter))
|
if (!Utils.IsNullOrEmpty(MsgFilter))
|
||||||
{
|
{
|
||||||
if (!Regex.IsMatch(msg, MsgFilter))
|
if (!Regex.IsMatch(msg, MsgFilter))
|
||||||
|
|
Loading…
Reference in a new issue