mirror of
https://github.com/2dust/v2rayN.git
synced 2026-10-05 05:08:21 +03:00
Full Config Template (#7576)
* Feat. custom config * Fixes TypeInfoResolver Exception * Adjust UI * Fixes * Adjust Avalonia UI * Add Detour Feature * Avoids detour for private networks * Rename * Adds Documents
This commit is contained in:
@@ -39,6 +39,7 @@ public class MainWindowViewModel : MyReactiveObject
|
||||
|
||||
public ReactiveCommand<Unit, Unit> RoutingSettingCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> DNSSettingCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> FullConfigTemplateCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> GlobalHotkeySettingCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> RebootAsAdminCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> ClearServerStatisticsCmd { get; }
|
||||
@@ -169,6 +170,10 @@ public class MainWindowViewModel : MyReactiveObject
|
||||
{
|
||||
await DNSSettingAsync();
|
||||
});
|
||||
FullConfigTemplateCmd = ReactiveCommand.CreateFromTask(async () =>
|
||||
{
|
||||
await FullConfigTemplateAsync();
|
||||
});
|
||||
GlobalHotkeySettingCmd = ReactiveCommand.CreateFromTask(async () =>
|
||||
{
|
||||
if (await _updateView?.Invoke(EViewAction.GlobalHotkeySettingWindow, null) == true)
|
||||
@@ -220,6 +225,7 @@ public class MainWindowViewModel : MyReactiveObject
|
||||
|
||||
await ConfigHandler.InitBuiltinRouting(_config);
|
||||
await ConfigHandler.InitBuiltinDNS(_config);
|
||||
await ConfigHandler.InitBuiltinFullConfigTemplate(_config);
|
||||
await ProfileExHandler.Instance.Init();
|
||||
await CoreHandler.Instance.Init(_config, UpdateHandler);
|
||||
TaskHandler.Instance.RegUpdateTask(_config, UpdateTaskHandler);
|
||||
@@ -508,6 +514,15 @@ public class MainWindowViewModel : MyReactiveObject
|
||||
}
|
||||
}
|
||||
|
||||
private async Task FullConfigTemplateAsync()
|
||||
{
|
||||
var ret = await _updateView?.Invoke(EViewAction.FullConfigTemplateWindow, null);
|
||||
if (ret == true)
|
||||
{
|
||||
await Reload();
|
||||
}
|
||||
}
|
||||
|
||||
public async Task RebootAsAdmin()
|
||||
{
|
||||
ProcUtils.RebootAsAdmin();
|
||||
|
||||
Reference in New Issue
Block a user