mirror of https://github.com/2dust/v2rayN
Add domainStrategy4Singbox in rule set settings
parent
ca4e8960d2
commit
419f5458b4
|
@ -135,6 +135,15 @@ namespace v2rayN.Handler
|
||||||
inbound.sniff_override_destination = _config.inbound[0].routeOnly ? false : _config.inbound[0].sniffingEnabled;
|
inbound.sniff_override_destination = _config.inbound[0].routeOnly ? false : _config.inbound[0].sniffingEnabled;
|
||||||
inbound.domain_strategy = Utils.IsNullOrEmpty(_config.routingBasicItem.domainStrategy4Singbox) ? null : _config.routingBasicItem.domainStrategy4Singbox;
|
inbound.domain_strategy = Utils.IsNullOrEmpty(_config.routingBasicItem.domainStrategy4Singbox) ? null : _config.routingBasicItem.domainStrategy4Singbox;
|
||||||
|
|
||||||
|
if (_config.routingBasicItem.enableRoutingAdvanced)
|
||||||
|
{
|
||||||
|
var routing = ConfigHandler.GetDefaultRouting(ref _config);
|
||||||
|
if (!Utils.IsNullOrEmpty(routing.domainStrategy4Singbox))
|
||||||
|
{
|
||||||
|
inbound.domain_strategy = routing.domainStrategy4Singbox;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//http
|
//http
|
||||||
var inbound2 = GetInbound(inbound, Global.InboundHttp, 1, false);
|
var inbound2 = GetInbound(inbound, Global.InboundHttp, 1, false);
|
||||||
singboxConfig.inbounds.Add(inbound2);
|
singboxConfig.inbounds.Add(inbound2);
|
||||||
|
|
|
@ -16,6 +16,7 @@ namespace v2rayN.Mode
|
||||||
public bool locked { get; set; }
|
public bool locked { get; set; }
|
||||||
public string customIcon { get; set; }
|
public string customIcon { get; set; }
|
||||||
public string domainStrategy { get; set; }
|
public string domainStrategy { get; set; }
|
||||||
|
public string domainStrategy4Singbox { get; set; }
|
||||||
public int sort { get; set; }
|
public int sort { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -138,13 +138,26 @@
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Style="{StaticResource ToolbarTextBlock}"
|
Style="{StaticResource ToolbarTextBlock}"
|
||||||
Text="{x:Static resx:ResUI.TbdomainStrategy}" />
|
Text="{x:Static resx:ResUI.TbdomainStrategy}" />
|
||||||
<ComboBox
|
<StackPanel
|
||||||
x:Name="cmbdomainStrategy"
|
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Width="200"
|
Orientation="Horizontal">
|
||||||
Margin="4"
|
<ComboBox
|
||||||
Style="{StaticResource DefComboBox}" />
|
x:Name="cmbdomainStrategy"
|
||||||
|
Width="200"
|
||||||
|
Margin="4"
|
||||||
|
Style="{StaticResource DefComboBox}" />
|
||||||
|
<TextBlock
|
||||||
|
Margin="4"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Style="{StaticResource ToolbarTextBlock}"
|
||||||
|
Text="{x:Static resx:ResUI.TbdomainStrategy4Singbox}" />
|
||||||
|
<ComboBox
|
||||||
|
x:Name="cmbdomainStrategy4Singbox"
|
||||||
|
Width="200"
|
||||||
|
Margin="4"
|
||||||
|
Style="{StaticResource DefComboBox}" />
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="2"
|
Grid.Row="2"
|
||||||
|
|
|
@ -25,6 +25,10 @@ namespace v2rayN.Views
|
||||||
cmbdomainStrategy.Items.Add(it);
|
cmbdomainStrategy.Items.Add(it);
|
||||||
});
|
});
|
||||||
cmbdomainStrategy.Items.Add(string.Empty);
|
cmbdomainStrategy.Items.Add(string.Empty);
|
||||||
|
Global.domainStrategys4Singbox.ForEach(it =>
|
||||||
|
{
|
||||||
|
cmbdomainStrategy4Singbox.Items.Add(it);
|
||||||
|
});
|
||||||
|
|
||||||
this.WhenActivated(disposables =>
|
this.WhenActivated(disposables =>
|
||||||
{
|
{
|
||||||
|
@ -33,6 +37,8 @@ namespace v2rayN.Views
|
||||||
|
|
||||||
this.Bind(ViewModel, vm => vm.SelectedRouting.remarks, v => v.txtRemarks.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SelectedRouting.remarks, v => v.txtRemarks.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.SelectedRouting.domainStrategy, v => v.cmbdomainStrategy.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SelectedRouting.domainStrategy, v => v.cmbdomainStrategy.Text).DisposeWith(disposables);
|
||||||
|
this.Bind(ViewModel, vm => vm.SelectedRouting.domainStrategy4Singbox, v => v.cmbdomainStrategy4Singbox.Text).DisposeWith(disposables);
|
||||||
|
|
||||||
this.Bind(ViewModel, vm => vm.SelectedRouting.url, v => v.txtUrl.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SelectedRouting.url, v => v.txtUrl.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.SelectedRouting.customIcon, v => v.txtCustomIcon.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SelectedRouting.customIcon, v => v.txtCustomIcon.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.SelectedRouting.sort, v => v.txtSort.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SelectedRouting.sort, v => v.txtSort.Text).DisposeWith(disposables);
|
||||||
|
|
Loading…
Reference in New Issue