mirror of
https://github.com/2dust/v2rayN.git
synced 2025-05-02 13:18:50 +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> TunMtus = new List<string> { "9000", "1500" };
|
||||
public static readonly List<string> TunStacks = new List<string> { "gvisor", "system" };
|
||||
public static readonly List<string> PresetMsgFilters = new List<string> { "^(?!.*proxy).*$", "^(?!.*direct).*$" };
|
||||
|
||||
#endregion
|
||||
|
||||
|
|
|
@ -21,12 +21,13 @@
|
|||
VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource PrimaryHueLightBrush}"
|
||||
Text="{x:Static resx:ResUI.MsgInformationTitle}" />
|
||||
<TextBox
|
||||
x:Name="txtMsgFilter"
|
||||
<ComboBox
|
||||
x:Name="cmbMsgFilter"
|
||||
Width="200"
|
||||
Margin="8,0"
|
||||
materialDesign:HintAssist.Hint="{x:Static resx:ResUI.MsgFilterTitle}"
|
||||
materialDesign:TextFieldAssist.HasClearButton="True" />
|
||||
materialDesign:TextFieldAssist.HasClearButton="True"
|
||||
IsEditable="True" />
|
||||
<TextBlock
|
||||
Margin="8,0"
|
||||
VerticalAlignment="Center"
|
||||
|
|
|
@ -12,6 +12,11 @@ namespace v2rayN.Views
|
|||
{
|
||||
InitializeComponent();
|
||||
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)
|
||||
|
@ -30,7 +35,7 @@ namespace v2rayN.Views
|
|||
{
|
||||
return;
|
||||
}
|
||||
var MsgFilter = txtMsgFilter.Text.TrimEx();
|
||||
var MsgFilter = cmbMsgFilter.Text.TrimEx();
|
||||
if (!Utils.IsNullOrEmpty(MsgFilter))
|
||||
{
|
||||
if (!Regex.IsMatch(msg, MsgFilter))
|
||||
|
|
Loading…
Reference in a new issue