mirror of
https://github.com/2dust/v2rayN.git
synced 2026-11-14 16:35:00 +03:00
Split configuration management by storage type
Move file-backed settings to ConfigTextManager and database operations to ConfigDbManager. Update desktop, Web API, and test references, and add Web API development launch settings.
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
|
||||
|
||||
namespace ServiceLib.ViewModels;
|
||||
|
||||
public partial class FullConfigTemplateViewModel : MyReactiveObject, ICloseable
|
||||
@@ -42,7 +44,7 @@ public partial class FullConfigTemplateViewModel : MyReactiveObject, ICloseable
|
||||
|
||||
public FullConfigTemplateViewModel()
|
||||
{
|
||||
_config = AppManager.Instance.Config;
|
||||
_config = ConfigTextManager.Instance.Config;
|
||||
SaveCmd = ReactiveCommand.CreateFromTask(async () =>
|
||||
{
|
||||
await SaveSettingAsync();
|
||||
@@ -102,7 +104,7 @@ public partial class FullConfigTemplateViewModel : MyReactiveObject, ICloseable
|
||||
item.AddProxyOnly = AddProxyOnly4Ray;
|
||||
item.ProxyDetour = ProxyDetour4Ray;
|
||||
|
||||
await ConfigHandler.SaveFullConfigTemplate(_config, item);
|
||||
await ConfigDbManager.SaveFullConfigTemplate(_config, item);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -120,7 +122,7 @@ public partial class FullConfigTemplateViewModel : MyReactiveObject, ICloseable
|
||||
item.AddProxyOnly = AddProxyOnly4Singbox;
|
||||
item.ProxyDetour = ProxyDetour4Singbox;
|
||||
|
||||
await ConfigHandler.SaveFullConfigTemplate(_config, item);
|
||||
await ConfigDbManager.SaveFullConfigTemplate(_config, item);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user