mirror of
https://github.com/2dust/v2rayN.git
synced 2025-08-23 03:16:53 +00:00
Add Manager folder
This commit is contained in:
parent
c9c1cd8cbb
commit
2060ac18fd
51 changed files with 57 additions and 28 deletions
|
@ -3,6 +3,7 @@ global using ServiceLib.Common;
|
|||
global using ServiceLib.Enums;
|
||||
global using ServiceLib.Handler;
|
||||
global using ServiceLib.Helper;
|
||||
global using ServiceLib.Manager;
|
||||
global using ServiceLib.Handler.Fmt;
|
||||
global using ServiceLib.Services;
|
||||
global using ServiceLib.Services.Statistics;
|
||||
|
|
|
@ -3,7 +3,7 @@ using System.Text.RegularExpressions;
|
|||
|
||||
namespace ServiceLib.Handler;
|
||||
|
||||
public class ConfigHandler
|
||||
public static class ConfigHandler
|
||||
{
|
||||
private static readonly string _configRes = Global.ConfigFileName;
|
||||
private static readonly string _tag = "ConfigHandler";
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
namespace ServiceLib.Handler;
|
||||
|
||||
public class ConnectionHandler
|
||||
public static class ConnectionHandler
|
||||
{
|
||||
private static readonly Lazy<ConnectionHandler> _instance = new(() => new());
|
||||
public static ConnectionHandler Instance => _instance.Value;
|
||||
|
||||
public async Task<string> RunAvailabilityCheck()
|
||||
public static async Task<string> RunAvailabilityCheck()
|
||||
{
|
||||
var downloadHandle = new DownloadService();
|
||||
var time = await downloadHandle.RunAvailabilityCheck(null);
|
||||
|
@ -14,7 +11,7 @@ public class ConnectionHandler
|
|||
return string.Format(ResUI.TestMeOutput, time, ip);
|
||||
}
|
||||
|
||||
private async Task<string?> GetIPInfo(DownloadService downloadHandle)
|
||||
private static async Task<string?> GetIPInfo(DownloadService downloadHandle)
|
||||
{
|
||||
var url = AppHandler.Instance.Config.SpeedTestItem.IPAPIUrl;
|
||||
if (url.IsNullOrEmpty())
|
||||
|
|
|
@ -3,7 +3,7 @@ namespace ServiceLib.Handler;
|
|||
/// <summary>
|
||||
/// Core configuration file processing class
|
||||
/// </summary>
|
||||
public class CoreConfigHandler
|
||||
public static class CoreConfigHandler
|
||||
{
|
||||
private static readonly string _tag = "CoreConfigHandler";
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
namespace ServiceLib.Handler;
|
||||
|
||||
public class SubscriptionHandler
|
||||
public static class SubscriptionHandler
|
||||
{
|
||||
public static async Task UpdateProcess(Config config, string subId, bool blProxy, Action<bool, string> updateFunc)
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
namespace ServiceLib.Handler.SysProxy;
|
||||
|
||||
public class ProxySettingLinux
|
||||
public static class ProxySettingLinux
|
||||
{
|
||||
private static readonly string _proxySetFileName = $"{Global.ProxySetLinuxShellFileName.Replace(Global.NamespaceSample, "")}.sh";
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
namespace ServiceLib.Handler.SysProxy;
|
||||
|
||||
public class ProxySettingOSX
|
||||
public static class ProxySettingOSX
|
||||
{
|
||||
private static readonly string _proxySetFileName = $"{Global.ProxySetOSXShellFileName.Replace(Global.NamespaceSample, "")}.sh";
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ using static ServiceLib.Handler.SysProxy.ProxySettingWindows.InternetConnectionO
|
|||
|
||||
namespace ServiceLib.Handler.SysProxy;
|
||||
|
||||
public class ProxySettingWindows
|
||||
public static class ProxySettingWindows
|
||||
{
|
||||
private const string _regPath = @"Software\Microsoft\Windows\CurrentVersion\Internet Settings";
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
namespace ServiceLib.Handler;
|
||||
namespace ServiceLib.Manager;
|
||||
|
||||
public sealed class AppHandler
|
||||
{
|
||||
|
@ -97,7 +97,7 @@ public sealed class AppHandler
|
|||
return localPort + (int)protocol;
|
||||
}
|
||||
|
||||
public void AddProcess(IntPtr processHandle)
|
||||
public void AddProcess(nint processHandle)
|
||||
{
|
||||
if (Utils.IsWindows())
|
||||
{
|
|
@ -1,6 +1,6 @@
|
|||
using static ServiceLib.Models.ClashProxies;
|
||||
|
||||
namespace ServiceLib.Handler;
|
||||
namespace ServiceLib.Manager;
|
||||
|
||||
public sealed class ClashApiHandler
|
||||
{
|
|
@ -3,7 +3,7 @@ using System.Text;
|
|||
using CliWrap;
|
||||
using CliWrap.Buffered;
|
||||
|
||||
namespace ServiceLib.Handler;
|
||||
namespace ServiceLib.Manager;
|
||||
|
||||
public class CoreAdminHandler
|
||||
{
|
|
@ -1,7 +1,7 @@
|
|||
using System.Diagnostics;
|
||||
using System.Text;
|
||||
|
||||
namespace ServiceLib.Handler;
|
||||
namespace ServiceLib.Manager;
|
||||
|
||||
/// <summary>
|
||||
/// Core process processing class
|
|
@ -1,4 +1,4 @@
|
|||
namespace ServiceLib.Handler;
|
||||
namespace ServiceLib.Manager;
|
||||
|
||||
public sealed class CoreInfoHandler
|
||||
{
|
|
@ -1,6 +1,6 @@
|
|||
using ReactiveUI;
|
||||
|
||||
namespace ServiceLib.Handler;
|
||||
namespace ServiceLib.Manager;
|
||||
|
||||
public class NoticeHandler
|
||||
{
|
|
@ -1,7 +1,7 @@
|
|||
using System.Net.Sockets;
|
||||
using System.Text;
|
||||
|
||||
namespace ServiceLib.Handler;
|
||||
namespace ServiceLib.Manager;
|
||||
|
||||
public class PacHandler
|
||||
{
|
|
@ -1,4 +1,4 @@
|
|||
namespace ServiceLib.Handler;
|
||||
namespace ServiceLib.Manager;
|
||||
|
||||
public class StatisticsHandler
|
||||
{
|
||||
|
@ -91,7 +91,7 @@ public class StatisticsHandler
|
|||
{
|
||||
await SQLiteHelper.Instance.ExecuteAsync($"delete from ServerStatItem where indexId not in ( select indexId from ProfileItem )");
|
||||
|
||||
long ticks = DateTime.Now.Date.Ticks;
|
||||
var ticks = DateTime.Now.Date.Ticks;
|
||||
await SQLiteHelper.Instance.ExecuteAsync($"update ServerStatItem set todayUp = 0,todayDown=0,dateNow={ticks} where dateNow<>{ticks}");
|
||||
|
||||
_lstServerStat = await SQLiteHelper.Instance.TableAsync<ServerStatItem>().ToListAsync();
|
||||
|
@ -128,7 +128,7 @@ public class StatisticsHandler
|
|||
|
||||
private async Task GetServerStatItem(string indexId)
|
||||
{
|
||||
long ticks = DateTime.Now.Date.Ticks;
|
||||
var ticks = DateTime.Now.Date.Ticks;
|
||||
if (_serverStatItem != null && _serverStatItem.IndexId != indexId)
|
||||
{
|
||||
_serverStatItem = null;
|
|
@ -1,4 +1,4 @@
|
|||
namespace ServiceLib.Handler;
|
||||
namespace ServiceLib.Manager;
|
||||
|
||||
public class TaskHandler
|
||||
{
|
||||
|
@ -66,7 +66,7 @@ public class TaskHandler
|
|||
|
||||
foreach (var item in lstSubs)
|
||||
{
|
||||
await SubscriptionHandler.UpdateProcess(config, item.Id, true, (bool success, string msg) =>
|
||||
await SubscriptionHandler.UpdateProcess(config, item.Id, true, (success, msg) =>
|
||||
{
|
||||
updateFunc?.Invoke(success, msg);
|
||||
if (success)
|
||||
|
@ -87,7 +87,7 @@ public class TaskHandler
|
|||
Logging.SaveLog("Execute update geo files");
|
||||
|
||||
var updateHandle = new UpdateService();
|
||||
await updateHandle.UpdateGeoFileAll(config, (bool success, string msg) =>
|
||||
await updateHandle.UpdateGeoFileAll(config, (success, msg) =>
|
||||
{
|
||||
updateFunc?.Invoke(false, msg);
|
||||
});
|
|
@ -1,7 +1,7 @@
|
|||
using System.Net;
|
||||
using WebDav;
|
||||
|
||||
namespace ServiceLib.Handler;
|
||||
namespace ServiceLib.Manager;
|
||||
|
||||
public sealed class WebDavHandler
|
||||
{
|
|
@ -334,7 +334,7 @@ public class StatusBarViewModel : MyReactiveObject
|
|||
|
||||
_updateView?.Invoke(EViewAction.DispatcherServerAvailability, ResUI.Speedtesting);
|
||||
|
||||
var msg = await Task.Run(ConnectionHandler.Instance.RunAvailabilityCheck);
|
||||
var msg = await Task.Run(ConnectionHandler.RunAvailabilityCheck);
|
||||
|
||||
NoticeHandler.Instance.SendMessageEx(msg);
|
||||
_updateView?.Invoke(EViewAction.DispatcherServerAvailability, msg);
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
using Avalonia;
|
||||
using Avalonia.Controls.ApplicationLifetimes;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using ServiceLib.Manager;
|
||||
using Splat;
|
||||
using v2rayN.Desktop.Common;
|
||||
using v2rayN.Desktop.Views;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
using Avalonia;
|
||||
using Avalonia.Interactivity;
|
||||
using Avalonia.ReactiveUI;
|
||||
using ServiceLib.Manager;
|
||||
|
||||
namespace v2rayN.Desktop.Base;
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
using Avalonia;
|
||||
using Avalonia.ReactiveUI;
|
||||
using ServiceLib.Manager;
|
||||
using v2rayN.Desktop.Common;
|
||||
|
||||
namespace v2rayN.Desktop;
|
||||
|
|
|
@ -8,6 +8,7 @@ using Avalonia.Styling;
|
|||
using ReactiveUI;
|
||||
using ReactiveUI.Fody.Helpers;
|
||||
using Semi.Avalonia;
|
||||
using ServiceLib.Manager;
|
||||
|
||||
namespace v2rayN.Desktop.ViewModels;
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@ using System.Reactive.Disposables;
|
|||
using Avalonia.Controls;
|
||||
using Avalonia.Interactivity;
|
||||
using ReactiveUI;
|
||||
using ServiceLib.Manager;
|
||||
using v2rayN.Desktop.Base;
|
||||
|
||||
namespace v2rayN.Desktop.Views;
|
||||
|
|
|
@ -2,6 +2,7 @@ using System.Reactive.Disposables;
|
|||
using Avalonia.Controls;
|
||||
using Avalonia.Interactivity;
|
||||
using ReactiveUI;
|
||||
using ServiceLib.Manager;
|
||||
using v2rayN.Desktop.Base;
|
||||
|
||||
namespace v2rayN.Desktop.Views;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
using System.Reactive.Disposables;
|
||||
using Avalonia.Interactivity;
|
||||
using ReactiveUI;
|
||||
using ServiceLib.Manager;
|
||||
using v2rayN.Desktop.Base;
|
||||
|
||||
namespace v2rayN.Desktop.Views;
|
||||
|
|
|
@ -9,6 +9,7 @@ using Avalonia.Threading;
|
|||
using DialogHostAvalonia;
|
||||
using MsBox.Avalonia.Enums;
|
||||
using ReactiveUI;
|
||||
using ServiceLib.Manager;
|
||||
using Splat;
|
||||
using v2rayN.Desktop.Base;
|
||||
using v2rayN.Desktop.Common;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
using System.Reactive.Disposables;
|
||||
using Avalonia.Controls;
|
||||
using ReactiveUI;
|
||||
using ServiceLib.Manager;
|
||||
using v2rayN.Desktop.Base;
|
||||
|
||||
namespace v2rayN.Desktop.Views;
|
||||
|
|
|
@ -7,6 +7,7 @@ using Avalonia.Threading;
|
|||
using DialogHostAvalonia;
|
||||
using MsBox.Avalonia.Enums;
|
||||
using ReactiveUI;
|
||||
using ServiceLib.Manager;
|
||||
using Splat;
|
||||
using v2rayN.Desktop.Common;
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ using Avalonia.ReactiveUI;
|
|||
using Avalonia.Threading;
|
||||
using DialogHostAvalonia;
|
||||
using ReactiveUI;
|
||||
using ServiceLib.Manager;
|
||||
using Splat;
|
||||
using v2rayN.Desktop.Common;
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@ using Avalonia.Controls;
|
|||
using Avalonia.Threading;
|
||||
using CliWrap.Buffered;
|
||||
using DialogHostAvalonia;
|
||||
using ServiceLib.Manager;
|
||||
|
||||
namespace v2rayN.Desktop.Views;
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
using System.Diagnostics;
|
||||
using System.Windows;
|
||||
using System.Windows.Threading;
|
||||
using ServiceLib.Manager;
|
||||
|
||||
namespace v2rayN;
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
using System.Windows;
|
||||
using ReactiveUI;
|
||||
using ServiceLib.Manager;
|
||||
|
||||
namespace v2rayN.Base;
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using System.Windows.Media;
|
||||
using ServiceLib.Manager;
|
||||
|
||||
namespace v2rayN.Converters;
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ using System.Text;
|
|||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Interop;
|
||||
using ServiceLib.Manager;
|
||||
|
||||
namespace v2rayN.Handler;
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ using MaterialDesignColors.ColorManipulation;
|
|||
using MaterialDesignThemes.Wpf;
|
||||
using ReactiveUI;
|
||||
using ReactiveUI.Fody.Helpers;
|
||||
using ServiceLib.Manager;
|
||||
|
||||
namespace v2rayN.ViewModels;
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
using System.Reactive.Disposables;
|
||||
using System.Windows;
|
||||
using ReactiveUI;
|
||||
using ServiceLib.Manager;
|
||||
|
||||
namespace v2rayN.Views;
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@ using System.Reactive.Disposables;
|
|||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using ReactiveUI;
|
||||
using ServiceLib.Manager;
|
||||
|
||||
namespace v2rayN.Views;
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
using System.Reactive.Disposables;
|
||||
using System.Windows;
|
||||
using ReactiveUI;
|
||||
using ServiceLib.Manager;
|
||||
|
||||
namespace v2rayN.Views;
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
using System.Reactive.Disposables;
|
||||
using System.Windows;
|
||||
using ReactiveUI;
|
||||
using ServiceLib.Manager;
|
||||
|
||||
namespace v2rayN.Views;
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ using System.Windows;
|
|||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using ReactiveUI;
|
||||
using ServiceLib.Manager;
|
||||
using v2rayN.Handler;
|
||||
|
||||
namespace v2rayN.Views;
|
||||
|
|
|
@ -8,6 +8,7 @@ using System.Windows.Media;
|
|||
using System.Windows.Threading;
|
||||
using MaterialDesignThemes.Wpf;
|
||||
using ReactiveUI;
|
||||
using ServiceLib.Manager;
|
||||
using Splat;
|
||||
using v2rayN.Handler;
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ using System.Reactive.Disposables;
|
|||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
using ReactiveUI;
|
||||
using ServiceLib.Manager;
|
||||
|
||||
namespace v2rayN.Views;
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ using System.Windows.Media;
|
|||
using System.Windows.Threading;
|
||||
using MaterialDesignThemes.Wpf;
|
||||
using ReactiveUI;
|
||||
using ServiceLib.Manager;
|
||||
using Splat;
|
||||
using v2rayN.Base;
|
||||
using Point = System.Windows.Point;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
using System.Reactive.Disposables;
|
||||
using System.Windows;
|
||||
using ReactiveUI;
|
||||
using ServiceLib.Manager;
|
||||
|
||||
namespace v2rayN.Views;
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@ using System.Reactive.Disposables;
|
|||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using ReactiveUI;
|
||||
using ServiceLib.Manager;
|
||||
|
||||
namespace v2rayN.Views;
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@ using System.Reactive.Disposables;
|
|||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using ReactiveUI;
|
||||
using ServiceLib.Manager;
|
||||
|
||||
namespace v2rayN.Views;
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ using System.Windows;
|
|||
using System.Windows.Input;
|
||||
using System.Windows.Threading;
|
||||
using ReactiveUI;
|
||||
using ServiceLib.Manager;
|
||||
using Splat;
|
||||
using v2rayN.Handler;
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
using System.Reactive.Disposables;
|
||||
using System.Windows;
|
||||
using ReactiveUI;
|
||||
using ServiceLib.Manager;
|
||||
|
||||
namespace v2rayN.Views;
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ using System.Windows;
|
|||
using System.Windows.Input;
|
||||
using MaterialDesignThemes.Wpf;
|
||||
using ReactiveUI;
|
||||
using ServiceLib.Manager;
|
||||
|
||||
namespace v2rayN.Views;
|
||||
|
||||
|
|
Loading…
Reference in a new issue