mirror of
https://github.com/2dust/v2rayN.git
synced 2025-05-15 12:48:07 +00:00
Improved UI for routing rules
This commit is contained in:
parent
5fbeb4b0fb
commit
3971318ffb
14 changed files with 204 additions and 102 deletions
|
@ -5,22 +5,15 @@
|
||||||
{
|
{
|
||||||
public string id { get; set; }
|
public string id { get; set; }
|
||||||
public string? type { get; set; }
|
public string? type { get; set; }
|
||||||
|
|
||||||
public string? port { get; set; }
|
public string? port { get; set; }
|
||||||
public string? network { get; set; }
|
public string? network { get; set; }
|
||||||
|
|
||||||
public List<string>? inboundTag { get; set; }
|
public List<string>? inboundTag { get; set; }
|
||||||
|
|
||||||
public string? outboundTag { get; set; }
|
public string? outboundTag { get; set; }
|
||||||
|
|
||||||
public List<string>? ip { get; set; }
|
public List<string>? ip { get; set; }
|
||||||
|
|
||||||
public List<string>? domain { get; set; }
|
public List<string>? domain { get; set; }
|
||||||
|
|
||||||
public List<string>? protocol { get; set; }
|
public List<string>? protocol { get; set; }
|
||||||
|
|
||||||
public List<string>? process { get; set; }
|
public List<string>? process { get; set; }
|
||||||
|
|
||||||
public bool enabled { get; set; } = true;
|
public bool enabled { get; set; } = true;
|
||||||
|
public string? remarks { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -4,11 +4,8 @@
|
||||||
public class RulesItemModel : RulesItem
|
public class RulesItemModel : RulesItem
|
||||||
{
|
{
|
||||||
public string inboundTags { get; set; }
|
public string inboundTags { get; set; }
|
||||||
|
|
||||||
public string ips { get; set; }
|
public string ips { get; set; }
|
||||||
|
|
||||||
public string domains { get; set; }
|
public string domains { get; set; }
|
||||||
|
|
||||||
public string protocols { get; set; }
|
public string protocols { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,30 +1,56 @@
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
|
"remarks": "绕过bittorrent",
|
||||||
"outboundTag": "direct",
|
"outboundTag": "direct",
|
||||||
"protocol": [
|
"protocol": [
|
||||||
"bittorrent"
|
"bittorrent"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"remarks": "Google cn",
|
||||||
|
"outboundTag": "proxy",
|
||||||
|
"domain": [
|
||||||
|
"domain:googleapis.cn",
|
||||||
|
"domain:gstatic.com"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"remarks": "阻断udp443",
|
||||||
"outboundTag": "block",
|
"outboundTag": "block",
|
||||||
"port": "443",
|
"port": "443",
|
||||||
"network": "udp"
|
"network": "udp"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"remarks": "阻断广告",
|
||||||
"outboundTag": "block",
|
"outboundTag": "block",
|
||||||
"domain": [
|
"domain": [
|
||||||
"geosite:category-ads-all"
|
"geosite:category-ads-all"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"remarks": "绕过局域网IP",
|
||||||
|
"outboundTag": "direct",
|
||||||
|
"ip": [
|
||||||
|
"geoip:private"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"remarks": "绕过局域网域名",
|
||||||
|
"outboundTag": "direct",
|
||||||
|
"domain": [
|
||||||
|
"geosite:private"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"remarks": "代理GFW",
|
||||||
"outboundTag": "proxy",
|
"outboundTag": "proxy",
|
||||||
|
|
||||||
"domain": [
|
"domain": [
|
||||||
"geosite:gfw",
|
"geosite:gfw",
|
||||||
"geosite:greatfire"
|
"geosite:greatfire"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"remarks": "代理Google等",
|
||||||
"outboundTag": "proxy",
|
"outboundTag": "proxy",
|
||||||
"ip": [
|
"ip": [
|
||||||
"1.0.0.1",
|
"1.0.0.1",
|
||||||
|
@ -40,6 +66,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"remarks": "最终直连",
|
||||||
"port": "0-65535",
|
"port": "0-65535",
|
||||||
"outboundTag": "direct"
|
"outboundTag": "direct"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,33 @@
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
|
"remarks": "阻断udp443",
|
||||||
"outboundTag": "block",
|
"outboundTag": "block",
|
||||||
"port": "443",
|
"port": "443",
|
||||||
"network": "udp"
|
"network": "udp"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"remarks": "阻断广告",
|
||||||
|
"outboundTag": "block",
|
||||||
|
"domain": [
|
||||||
|
"geosite:category-ads-all"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"remarks": "绕过局域网IP",
|
||||||
|
"outboundTag": "direct",
|
||||||
|
"ip": [
|
||||||
|
"geoip:private"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"remarks": "绕过局域网域名",
|
||||||
|
"outboundTag": "direct",
|
||||||
|
"domain": [
|
||||||
|
"geosite:private"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"remarks": "最终代理",
|
||||||
"port": "0-65535",
|
"port": "0-65535",
|
||||||
"outboundTag": "proxy"
|
"outboundTag": "proxy"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,23 +1,41 @@
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"outboundTag": "direct",
|
"remarks": "Google cn",
|
||||||
|
"outboundTag": "proxy",
|
||||||
"domain": [
|
"domain": [
|
||||||
"domain:example-example.com",
|
"domain:googleapis.cn",
|
||||||
"domain:example-example2.com"
|
"domain:gstatic.com"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"remarks": "阻断udp443",
|
||||||
"outboundTag": "block",
|
"outboundTag": "block",
|
||||||
"port": "443",
|
"port": "443",
|
||||||
"network": "udp"
|
"network": "udp"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"remarks": "阻断广告",
|
||||||
"outboundTag": "block",
|
"outboundTag": "block",
|
||||||
"domain": [
|
"domain": [
|
||||||
"geosite:category-ads-all"
|
"geosite:category-ads-all"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"remarks": "绕过局域网IP",
|
||||||
|
"outboundTag": "direct",
|
||||||
|
"ip": [
|
||||||
|
"geoip:private"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"remarks": "绕过局域网域名",
|
||||||
|
"outboundTag": "direct",
|
||||||
|
"domain": [
|
||||||
|
"geosite:private"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"remarks": "绕过中国域名",
|
||||||
"outboundTag": "direct",
|
"outboundTag": "direct",
|
||||||
"domain": [
|
"domain": [
|
||||||
"domain:dns.alidns.com",
|
"domain:dns.alidns.com",
|
||||||
|
@ -30,6 +48,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"remarks": "绕过中国IP",
|
||||||
"outboundTag": "direct",
|
"outboundTag": "direct",
|
||||||
"ip": [
|
"ip": [
|
||||||
"223.5.5.5/32",
|
"223.5.5.5/32",
|
||||||
|
@ -51,11 +70,11 @@
|
||||||
"218.30.118.6/32",
|
"218.30.118.6/32",
|
||||||
"123.125.81.6/32",
|
"123.125.81.6/32",
|
||||||
"140.207.198.6/32",
|
"140.207.198.6/32",
|
||||||
"geoip:private",
|
|
||||||
"geoip:cn"
|
"geoip:cn"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"remarks": "最终代理",
|
||||||
"port": "0-65535",
|
"port": "0-65535",
|
||||||
"outboundTag": "proxy"
|
"outboundTag": "proxy"
|
||||||
}
|
}
|
||||||
|
|
|
@ -124,6 +124,7 @@ namespace ServiceLib.ViewModels
|
||||||
domains = Utils.List2String(item.domain),
|
domains = Utils.List2String(item.domain),
|
||||||
ips = Utils.List2String(item.ip),
|
ips = Utils.List2String(item.ip),
|
||||||
enabled = item.enabled,
|
enabled = item.enabled,
|
||||||
|
remarks = item.remarks,
|
||||||
};
|
};
|
||||||
_rulesItems.Add(it);
|
_rulesItems.Add(it);
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,36 +33,56 @@
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Classes="Margin8"
|
Classes="Margin8"
|
||||||
Text="outboundTag" />
|
Text="{x:Static resx:ResUI.LvRemarks}" />
|
||||||
<ComboBox
|
<TextBox
|
||||||
x:Name="cmbOutboundTag"
|
x:Name="txtRemarks"
|
||||||
Grid.Row="0"
|
Grid.Row="0"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Width="200"
|
Width="200"
|
||||||
Classes="Margin8"
|
HorizontalAlignment="Left"
|
||||||
MaxDropDownHeight="1000" />
|
Classes="Margin8" />
|
||||||
<TextBlock
|
<ToggleSwitch
|
||||||
|
x:Name="togEnabled"
|
||||||
Grid.Row="0"
|
Grid.Row="0"
|
||||||
Grid.Column="2"
|
Grid.Column="2"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Classes="Margin8"
|
Classes="Margin8" />
|
||||||
Text="{x:Static resx:ResUI.TbRuleMatchingTips}" />
|
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Classes="Margin8"
|
Classes="Margin8"
|
||||||
|
Text="outboundTag" />
|
||||||
|
<ComboBox
|
||||||
|
x:Name="cmbOutboundTag"
|
||||||
|
Grid.Row="1"
|
||||||
|
Grid.Column="1"
|
||||||
|
Width="200"
|
||||||
|
Classes="Margin8"
|
||||||
|
MaxDropDownHeight="1000" />
|
||||||
|
<TextBlock
|
||||||
|
Grid.Row="1"
|
||||||
|
Grid.Column="2"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
Classes="Margin8"
|
||||||
|
Text="{x:Static resx:ResUI.TbRuleMatchingTips}" />
|
||||||
|
|
||||||
|
<TextBlock
|
||||||
|
Grid.Row="2"
|
||||||
|
Grid.Column="0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Classes="Margin8"
|
||||||
Text="port" />
|
Text="port" />
|
||||||
<TextBox
|
<TextBox
|
||||||
x:Name="txtPort"
|
x:Name="txtPort"
|
||||||
Grid.Row="1"
|
Grid.Row="2"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Width="200"
|
Width="200"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Classes="Margin8" />
|
Classes="Margin8" />
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="1"
|
Grid.Row="2"
|
||||||
Grid.Column="2"
|
Grid.Column="2"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Classes="Margin8">
|
Classes="Margin8">
|
||||||
|
@ -72,14 +92,14 @@
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="2"
|
Grid.Row="3"
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Classes="Margin8"
|
Classes="Margin8"
|
||||||
Text="protocol" />
|
Text="protocol" />
|
||||||
<ListBox
|
<ListBox
|
||||||
x:Name="clbProtocol"
|
x:Name="clbProtocol"
|
||||||
Grid.Row="2"
|
Grid.Row="3"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Classes="Margin8"
|
Classes="Margin8"
|
||||||
|
@ -87,46 +107,32 @@
|
||||||
Theme="{DynamicResource PureCardRadioGroupListBox}" />
|
Theme="{DynamicResource PureCardRadioGroupListBox}" />
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="3"
|
Grid.Row="4"
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Classes="Margin8"
|
Classes="Margin8"
|
||||||
Text="inboundTag" />
|
Text="inboundTag" />
|
||||||
<ListBox
|
<ListBox
|
||||||
x:Name="clbInboundTag"
|
x:Name="clbInboundTag"
|
||||||
Grid.Row="3"
|
Grid.Row="4"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Classes="Margin8"
|
Classes="Margin8"
|
||||||
SelectionMode="Multiple"
|
SelectionMode="Multiple"
|
||||||
Theme="{DynamicResource PureCardRadioGroupListBox}" />
|
Theme="{DynamicResource PureCardRadioGroupListBox}" />
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="4"
|
Grid.Row="5"
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Classes="Margin8"
|
Classes="Margin8"
|
||||||
Text="network" />
|
Text="network" />
|
||||||
<ComboBox
|
<ComboBox
|
||||||
x:Name="cmbNetwork"
|
x:Name="cmbNetwork"
|
||||||
Grid.Row="4"
|
Grid.Row="5"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Width="200"
|
Width="200"
|
||||||
Classes="Margin8"
|
Classes="Margin8"
|
||||||
MaxDropDownHeight="1000" />
|
MaxDropDownHeight="1000" />
|
||||||
|
|
||||||
<TextBlock
|
|
||||||
Grid.Row="5"
|
|
||||||
Grid.Column="0"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Classes="Margin8"
|
|
||||||
Text="enabled" />
|
|
||||||
<ToggleSwitch
|
|
||||||
x:Name="togEnabled"
|
|
||||||
Grid.Row="5"
|
|
||||||
Grid.Column="1"
|
|
||||||
HorizontalAlignment="Left"
|
|
||||||
Classes="Margin8" />
|
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="5"
|
Grid.Row="5"
|
||||||
Grid.Column="2"
|
Grid.Column="2"
|
||||||
|
@ -169,25 +175,40 @@
|
||||||
<ColumnDefinition Width="10" />
|
<ColumnDefinition Width="10" />
|
||||||
<ColumnDefinition Width="1*" />
|
<ColumnDefinition Width="1*" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<HeaderedContentControl Grid.Column="0" Header="{x:Static resx:ResUI.TbRoutingRuleDomain}">
|
<HeaderedContentControl
|
||||||
|
Grid.Column="0"
|
||||||
|
BorderBrush="Gray"
|
||||||
|
BorderThickness="1"
|
||||||
|
Header="{x:Static resx:ResUI.TbRoutingRuleDomain}">
|
||||||
<TextBox
|
<TextBox
|
||||||
Name="txtDomain"
|
Name="txtDomain"
|
||||||
|
VerticalAlignment="Stretch"
|
||||||
Classes="TextArea"
|
Classes="TextArea"
|
||||||
MinLines="10"
|
MinLines="10"
|
||||||
TextWrapping="Wrap" />
|
TextWrapping="Wrap" />
|
||||||
</HeaderedContentControl>
|
</HeaderedContentControl>
|
||||||
<GridSplitter Grid.Column="1" HorizontalAlignment="Stretch" />
|
<GridSplitter Grid.Column="1" HorizontalAlignment="Stretch" />
|
||||||
<HeaderedContentControl Grid.Column="2" Header="{x:Static resx:ResUI.TbRoutingRuleIP}">
|
<HeaderedContentControl
|
||||||
|
Grid.Column="2"
|
||||||
|
BorderBrush="Gray"
|
||||||
|
BorderThickness="1"
|
||||||
|
Header="{x:Static resx:ResUI.TbRoutingRuleIP}">
|
||||||
<TextBox
|
<TextBox
|
||||||
Name="txtIP"
|
Name="txtIP"
|
||||||
|
VerticalAlignment="Stretch"
|
||||||
Classes="TextArea"
|
Classes="TextArea"
|
||||||
MinLines="10"
|
MinLines="10"
|
||||||
TextWrapping="Wrap" />
|
TextWrapping="Wrap" />
|
||||||
</HeaderedContentControl>
|
</HeaderedContentControl>
|
||||||
<GridSplitter Grid.Column="3" HorizontalAlignment="Stretch" />
|
<GridSplitter Grid.Column="3" HorizontalAlignment="Stretch" />
|
||||||
<HeaderedContentControl Grid.Column="4" Header="{x:Static resx:ResUI.TbRoutingRuleProcess}">
|
<HeaderedContentControl
|
||||||
|
Grid.Column="4"
|
||||||
|
BorderBrush="Gray"
|
||||||
|
BorderThickness="1"
|
||||||
|
Header="{x:Static resx:ResUI.TbRoutingRuleProcess}">
|
||||||
<TextBox
|
<TextBox
|
||||||
Name="txtProcess"
|
Name="txtProcess"
|
||||||
|
VerticalAlignment="Stretch"
|
||||||
Classes="TextArea"
|
Classes="TextArea"
|
||||||
MinLines="10"
|
MinLines="10"
|
||||||
TextWrapping="Wrap" />
|
TextWrapping="Wrap" />
|
||||||
|
|
|
@ -53,6 +53,7 @@ namespace v2rayN.Desktop.Views
|
||||||
|
|
||||||
this.WhenActivated(disposables =>
|
this.WhenActivated(disposables =>
|
||||||
{
|
{
|
||||||
|
this.Bind(ViewModel, vm => vm.SelectedSource.remarks, v => v.txtRemarks.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.SelectedSource.outboundTag, v => v.cmbOutboundTag.SelectedValue).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SelectedSource.outboundTag, v => v.cmbOutboundTag.SelectedValue).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.SelectedSource.port, v => v.txtPort.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SelectedSource.port, v => v.txtPort.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.SelectedSource.network, v => v.cmbNetwork.SelectedValue).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SelectedSource.network, v => v.cmbNetwork.SelectedValue).DisposeWith(disposables);
|
||||||
|
|
|
@ -206,20 +206,28 @@
|
||||||
</ContextMenu>
|
</ContextMenu>
|
||||||
</DataGrid.ContextMenu>
|
</DataGrid.ContextMenu>
|
||||||
<DataGrid.Columns>
|
<DataGrid.Columns>
|
||||||
|
<DataGridCheckBoxColumn
|
||||||
|
Width="60"
|
||||||
|
Binding="{Binding enabled}"
|
||||||
|
Header="" />
|
||||||
<DataGridTextColumn
|
<DataGridTextColumn
|
||||||
Width="110"
|
Width="150"
|
||||||
|
Binding="{Binding remarks}"
|
||||||
|
Header="{x:Static resx:ResUI.LvRemarks}" />
|
||||||
|
<DataGridTextColumn
|
||||||
|
Width="120"
|
||||||
Binding="{Binding outboundTag}"
|
Binding="{Binding outboundTag}"
|
||||||
Header="outboundTag" />
|
Header="outboundTag" />
|
||||||
<DataGridTextColumn
|
<DataGridTextColumn
|
||||||
Width="80"
|
Width="100"
|
||||||
Binding="{Binding port}"
|
Binding="{Binding port}"
|
||||||
Header="port" />
|
Header="port" />
|
||||||
<DataGridTextColumn
|
<DataGridTextColumn
|
||||||
Width="80"
|
Width="100"
|
||||||
Binding="{Binding protocols}"
|
Binding="{Binding protocols}"
|
||||||
Header="protocol" />
|
Header="protocol" />
|
||||||
<DataGridTextColumn
|
<DataGridTextColumn
|
||||||
Width="110"
|
Width="120"
|
||||||
Binding="{Binding inboundTags}"
|
Binding="{Binding inboundTags}"
|
||||||
Header="inboundTag" />
|
Header="inboundTag" />
|
||||||
<DataGridTextColumn
|
<DataGridTextColumn
|
||||||
|
@ -227,17 +235,13 @@
|
||||||
Binding="{Binding network}"
|
Binding="{Binding network}"
|
||||||
Header="network" />
|
Header="network" />
|
||||||
<DataGridTextColumn
|
<DataGridTextColumn
|
||||||
Width="190"
|
Width="200"
|
||||||
Binding="{Binding domains}"
|
Binding="{Binding domains}"
|
||||||
Header="domain" />
|
Header="domain" />
|
||||||
<DataGridTextColumn
|
<DataGridTextColumn
|
||||||
Width="190"
|
Width="200"
|
||||||
Binding="{Binding ips}"
|
Binding="{Binding ips}"
|
||||||
Header="ip" />
|
Header="ip" />
|
||||||
<DataGridTextColumn
|
|
||||||
Width="80"
|
|
||||||
Binding="{Binding enabled}"
|
|
||||||
Header="enabled" />
|
|
||||||
</DataGrid.Columns>
|
</DataGrid.Columns>
|
||||||
</DataGrid>
|
</DataGrid>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
Width="150"
|
Width="150"
|
||||||
Binding="{Binding url}"
|
Binding="{Binding url}"
|
||||||
Header="{x:Static resx:ResUI.LvUrl}" />
|
Header="{x:Static resx:ResUI.LvUrl}" />
|
||||||
<DataGridTextColumn
|
<DataGridCheckBoxColumn
|
||||||
Width="100"
|
Width="100"
|
||||||
Binding="{Binding enabled}"
|
Binding="{Binding enabled}"
|
||||||
Header="{x:Static resx:ResUI.LvEnabled}" />
|
Header="{x:Static resx:ResUI.LvEnabled}" />
|
||||||
|
|
|
@ -37,28 +37,28 @@
|
||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="0"
|
Grid.Row="0"
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
Margin="4"
|
Margin="4"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Style="{StaticResource ToolbarTextBlock}"
|
Style="{StaticResource ToolbarTextBlock}"
|
||||||
Text="outboundTag" />
|
Text="{x:Static resx:ResUI.LvRemarks}" />
|
||||||
<ComboBox
|
<TextBox
|
||||||
x:Name="cmbOutboundTag"
|
x:Name="txtRemarks"
|
||||||
Grid.Row="0"
|
Grid.Row="0"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Width="200"
|
Width="200"
|
||||||
Margin="4"
|
Margin="4"
|
||||||
MaxDropDownHeight="1000"
|
HorizontalAlignment="Left"
|
||||||
Style="{StaticResource DefComboBox}" />
|
Style="{StaticResource DefTextBox}" />
|
||||||
<TextBlock
|
<ToggleButton
|
||||||
|
x:Name="togEnabled"
|
||||||
Grid.Row="0"
|
Grid.Row="0"
|
||||||
Grid.Column="2"
|
Grid.Column="2"
|
||||||
Margin="4"
|
Margin="4"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left" />
|
||||||
Style="{StaticResource ToolbarTextBlock}"
|
|
||||||
Text="{x:Static resx:ResUI.TbRuleMatchingTips}" />
|
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
|
@ -66,17 +66,40 @@
|
||||||
Margin="4"
|
Margin="4"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Style="{StaticResource ToolbarTextBlock}"
|
Style="{StaticResource ToolbarTextBlock}"
|
||||||
|
Text="outboundTag" />
|
||||||
|
<ComboBox
|
||||||
|
x:Name="cmbOutboundTag"
|
||||||
|
Grid.Row="1"
|
||||||
|
Grid.Column="1"
|
||||||
|
Width="200"
|
||||||
|
Margin="4"
|
||||||
|
MaxDropDownHeight="1000"
|
||||||
|
Style="{StaticResource DefComboBox}" />
|
||||||
|
<TextBlock
|
||||||
|
Grid.Row="1"
|
||||||
|
Grid.Column="2"
|
||||||
|
Margin="4"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
Style="{StaticResource ToolbarTextBlock}"
|
||||||
|
Text="{x:Static resx:ResUI.TbRuleMatchingTips}" />
|
||||||
|
|
||||||
|
<TextBlock
|
||||||
|
Grid.Row="2"
|
||||||
|
Grid.Column="0"
|
||||||
|
Margin="4"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Style="{StaticResource ToolbarTextBlock}"
|
||||||
Text="port" />
|
Text="port" />
|
||||||
<TextBox
|
<TextBox
|
||||||
x:Name="txtPort"
|
x:Name="txtPort"
|
||||||
Grid.Row="1"
|
Grid.Row="2"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Width="200"
|
Width="200"
|
||||||
Margin="4"
|
Margin="4"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Style="{StaticResource DefTextBox}" />
|
Style="{StaticResource DefTextBox}" />
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="1"
|
Grid.Row="2"
|
||||||
Grid.Column="2"
|
Grid.Column="2"
|
||||||
Margin="4"
|
Margin="4"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
|
@ -88,7 +111,7 @@
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="2"
|
Grid.Row="3"
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
Margin="4"
|
Margin="4"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
|
@ -96,7 +119,7 @@
|
||||||
Text="protocol" />
|
Text="protocol" />
|
||||||
<ListBox
|
<ListBox
|
||||||
x:Name="clbProtocol"
|
x:Name="clbProtocol"
|
||||||
Grid.Row="2"
|
Grid.Row="3"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Margin="4"
|
Margin="4"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
|
@ -104,7 +127,7 @@
|
||||||
Style="{StaticResource MaterialDesignFilterChipPrimaryListBox}" />
|
Style="{StaticResource MaterialDesignFilterChipPrimaryListBox}" />
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="3"
|
Grid.Row="4"
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
Margin="4"
|
Margin="4"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
|
@ -112,14 +135,14 @@
|
||||||
Text="inboundTag" />
|
Text="inboundTag" />
|
||||||
<ListBox
|
<ListBox
|
||||||
x:Name="clbInboundTag"
|
x:Name="clbInboundTag"
|
||||||
Grid.Row="3"
|
Grid.Row="4"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Margin="4"
|
Margin="4"
|
||||||
FontSize="{DynamicResource StdFontSize}"
|
FontSize="{DynamicResource StdFontSize}"
|
||||||
Style="{StaticResource MaterialDesignFilterChipPrimaryListBox}" />
|
Style="{StaticResource MaterialDesignFilterChipPrimaryListBox}" />
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="4"
|
Grid.Row="5"
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
Margin="4"
|
Margin="4"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
|
@ -127,27 +150,13 @@
|
||||||
Text="network" />
|
Text="network" />
|
||||||
<ComboBox
|
<ComboBox
|
||||||
x:Name="cmbNetwork"
|
x:Name="cmbNetwork"
|
||||||
Grid.Row="4"
|
Grid.Row="5"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Width="200"
|
Width="200"
|
||||||
Margin="4"
|
Margin="4"
|
||||||
MaxDropDownHeight="1000"
|
MaxDropDownHeight="1000"
|
||||||
Style="{StaticResource DefComboBox}" />
|
Style="{StaticResource DefComboBox}" />
|
||||||
|
|
||||||
<TextBlock
|
|
||||||
Grid.Row="5"
|
|
||||||
Grid.Column="0"
|
|
||||||
Margin="4"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Style="{StaticResource ToolbarTextBlock}"
|
|
||||||
Text="enabled" />
|
|
||||||
<ToggleButton
|
|
||||||
x:Name="togEnabled"
|
|
||||||
Grid.Row="5"
|
|
||||||
Grid.Column="1"
|
|
||||||
Margin="4"
|
|
||||||
HorizontalAlignment="Left" />
|
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="5"
|
Grid.Row="5"
|
||||||
Grid.Column="2"
|
Grid.Column="2"
|
||||||
|
@ -155,6 +164,8 @@
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Style="{StaticResource ToolbarTextBlock}"
|
Style="{StaticResource ToolbarTextBlock}"
|
||||||
Text="{x:Static resx:ResUI.TbRoutingTips}" />
|
Text="{x:Static resx:ResUI.TbRoutingTips}" />
|
||||||
|
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<StackPanel
|
<StackPanel
|
||||||
|
|
|
@ -46,6 +46,7 @@ namespace v2rayN.Views
|
||||||
|
|
||||||
this.WhenActivated(disposables =>
|
this.WhenActivated(disposables =>
|
||||||
{
|
{
|
||||||
|
this.Bind(ViewModel, vm => vm.SelectedSource.remarks, v => v.txtRemarks.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.SelectedSource.outboundTag, v => v.cmbOutboundTag.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SelectedSource.outboundTag, v => v.cmbOutboundTag.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.SelectedSource.port, v => v.txtPort.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SelectedSource.port, v => v.txtPort.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.SelectedSource.network, v => v.cmbNetwork.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SelectedSource.network, v => v.cmbNetwork.Text).DisposeWith(disposables);
|
||||||
|
|
|
@ -297,20 +297,28 @@
|
||||||
</ContextMenu>
|
</ContextMenu>
|
||||||
</DataGrid.ContextMenu>
|
</DataGrid.ContextMenu>
|
||||||
<DataGrid.Columns>
|
<DataGrid.Columns>
|
||||||
|
<DataGridCheckBoxColumn
|
||||||
|
Width="60"
|
||||||
|
Binding="{Binding enabled}"
|
||||||
|
Header="" />
|
||||||
<DataGridTextColumn
|
<DataGridTextColumn
|
||||||
Width="110"
|
Width="150"
|
||||||
|
Binding="{Binding remarks}"
|
||||||
|
Header="{x:Static resx:ResUI.LvRemarks}" />
|
||||||
|
<DataGridTextColumn
|
||||||
|
Width="120"
|
||||||
Binding="{Binding outboundTag}"
|
Binding="{Binding outboundTag}"
|
||||||
Header="outboundTag" />
|
Header="outboundTag" />
|
||||||
<DataGridTextColumn
|
<DataGridTextColumn
|
||||||
Width="80"
|
Width="100"
|
||||||
Binding="{Binding port}"
|
Binding="{Binding port}"
|
||||||
Header="port" />
|
Header="port" />
|
||||||
<DataGridTextColumn
|
<DataGridTextColumn
|
||||||
Width="80"
|
Width="100"
|
||||||
Binding="{Binding protocols}"
|
Binding="{Binding protocols}"
|
||||||
Header="protocol" />
|
Header="protocol" />
|
||||||
<DataGridTextColumn
|
<DataGridTextColumn
|
||||||
Width="110"
|
Width="120"
|
||||||
Binding="{Binding inboundTags}"
|
Binding="{Binding inboundTags}"
|
||||||
Header="inboundTag" />
|
Header="inboundTag" />
|
||||||
<DataGridTextColumn
|
<DataGridTextColumn
|
||||||
|
@ -318,17 +326,13 @@
|
||||||
Binding="{Binding network}"
|
Binding="{Binding network}"
|
||||||
Header="network" />
|
Header="network" />
|
||||||
<DataGridTextColumn
|
<DataGridTextColumn
|
||||||
Width="190"
|
Width="200"
|
||||||
Binding="{Binding domains}"
|
Binding="{Binding domains}"
|
||||||
Header="domain" />
|
Header="domain" />
|
||||||
<DataGridTextColumn
|
<DataGridTextColumn
|
||||||
Width="190"
|
Width="200"
|
||||||
Binding="{Binding ips}"
|
Binding="{Binding ips}"
|
||||||
Header="ip" />
|
Header="ip" />
|
||||||
<DataGridTextColumn
|
|
||||||
Width="80"
|
|
||||||
Binding="{Binding enabled}"
|
|
||||||
Header="enabled" />
|
|
||||||
</DataGrid.Columns>
|
</DataGrid.Columns>
|
||||||
</DataGrid>
|
</DataGrid>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
|
|
|
@ -105,7 +105,7 @@
|
||||||
Width="150"
|
Width="150"
|
||||||
Binding="{Binding url}"
|
Binding="{Binding url}"
|
||||||
Header="{x:Static resx:ResUI.LvUrl}" />
|
Header="{x:Static resx:ResUI.LvUrl}" />
|
||||||
<DataGridTextColumn
|
<DataGridCheckBoxColumn
|
||||||
Width="100"
|
Width="100"
|
||||||
Binding="{Binding enabled}"
|
Binding="{Binding enabled}"
|
||||||
Header="{x:Static resx:ResUI.LvEnabled}" />
|
Header="{x:Static resx:ResUI.LvEnabled}" />
|
||||||
|
|
Loading…
Reference in a new issue