From 7a8680711e38b9b1b947c401b9063c2a8abd560e Mon Sep 17 00:00:00 2001
From: 2dust <31833384+2dust@users.noreply.github.com>
Date: Sun, 12 Jan 2025 14:30:49 +0800
Subject: [PATCH] Improvements and Adjustments
---
v2rayN/ServiceLib/Global.cs | 1 +
v2rayN/ServiceLib/Models/ConfigItems.cs | 2 +-
.../ViewModels/StatusBarViewModel.cs | 12 +-
.../v2rayN.Desktop/Views/StatusBarView.axaml | 120 +++++++++---------
v2rayN/v2rayN/Views/StatusBarView.xaml | 21 ++-
5 files changed, 82 insertions(+), 74 deletions(-)
diff --git a/v2rayN/ServiceLib/Global.cs b/v2rayN/ServiceLib/Global.cs
index da4be1a4..4fabe857 100644
--- a/v2rayN/ServiceLib/Global.cs
+++ b/v2rayN/ServiceLib/Global.cs
@@ -63,6 +63,7 @@
public const string HttpProtocol = "http://";
public const string HttpsProtocol = "https://";
public const string SocksProtocol = "socks://";
+ public const string Socks5Protocol = "socks5://";
public const string UserEMail = "t@t.tt";
public const string AutoRunRegPath = @"Software\Microsoft\Windows\CurrentVersion\Run";
diff --git a/v2rayN/ServiceLib/Models/ConfigItems.cs b/v2rayN/ServiceLib/Models/ConfigItems.cs
index 66b0ffc9..dda1f770 100644
--- a/v2rayN/ServiceLib/Models/ConfigItems.cs
+++ b/v2rayN/ServiceLib/Models/ConfigItems.cs
@@ -118,7 +118,7 @@
[Serializable]
public class ConstItem
{
- public string SubConvertUrl { get; set; } = string.Empty;
+ public string? SubConvertUrl { get; set; }
public string? GeoSourceUrl { get; set; }
public string? SrsSourceUrl { get; set; }
public string? RouteRulesTemplateSourceUrl { get; set; }
diff --git a/v2rayN/ServiceLib/ViewModels/StatusBarViewModel.cs b/v2rayN/ServiceLib/ViewModels/StatusBarViewModel.cs
index 268ea7e7..4326808a 100644
--- a/v2rayN/ServiceLib/ViewModels/StatusBarViewModel.cs
+++ b/v2rayN/ServiceLib/ViewModels/StatusBarViewModel.cs
@@ -210,13 +210,13 @@ namespace ServiceLib.ViewModels
var address = $"{Global.Loopback}:{AppHandler.Instance.GetLocalPort(EInboundProtocol.socks)}";
var sb = new StringBuilder();
- sb.AppendLine($"{cmd} http_proxy=http://{address}");
- sb.AppendLine($"{cmd} https_proxy=http://{address}");
- sb.AppendLine($"{cmd} all_proxy=socks5://{address}");
+ sb.AppendLine($"{cmd} http_proxy={Global.HttpProtocol}{address}");
+ sb.AppendLine($"{cmd} https_proxy={Global.HttpProtocol}{address}");
+ sb.AppendLine($"{cmd} all_proxy={Global.Socks5Protocol}{address}");
sb.AppendLine("");
- sb.AppendLine($"{cmd} HTTP_PROXY=http://{address}");
- sb.AppendLine($"{cmd} HTTPS_PROXY=http://{address}");
- sb.AppendLine($"{cmd} ALL_PROXY=socks5://{address}");
+ sb.AppendLine($"{cmd} HTTP_PROXY={Global.HttpProtocol}{address}");
+ sb.AppendLine($"{cmd} HTTPS_PROXY={Global.HttpProtocol}{address}");
+ sb.AppendLine($"{cmd} ALL_PROXY={Global.Socks5Protocol}{address}");
await _updateView?.Invoke(EViewAction.SetClipboardData, sb.ToString());
}
diff --git a/v2rayN/v2rayN.Desktop/Views/StatusBarView.axaml b/v2rayN/v2rayN.Desktop/Views/StatusBarView.axaml
index 7898b670..0eff80a3 100644
--- a/v2rayN/v2rayN.Desktop/Views/StatusBarView.axaml
+++ b/v2rayN/v2rayN.Desktop/Views/StatusBarView.axaml
@@ -11,73 +11,71 @@
x:DataType="vms:StatusBarViewModel"
mc:Ignorable="d">
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+ Text="{x:Static resx:ResUI.TbEnableTunAs}" />
+
+
-
+
-
-
-
-
+ ToolTip.Tip="{x:Static resx:ResUI.menuSystemproxy}">
+
+
+
+
-
-
-
-
+ DisplayMemberBinding="{Binding Remarks}"
+ ItemsSource="{Binding RoutingItems}"
+ ToolTip.Tip="{x:Static resx:ResUI.menuRouting}" />
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
\ No newline at end of file
diff --git a/v2rayN/v2rayN/Views/StatusBarView.xaml b/v2rayN/v2rayN/Views/StatusBarView.xaml
index 7df3ee19..a84ab55f 100644
--- a/v2rayN/v2rayN/Views/StatusBarView.xaml
+++ b/v2rayN/v2rayN/Views/StatusBarView.xaml
@@ -15,15 +15,24 @@
Style="{StaticResource ViewGlobal}"
mc:Ignorable="d">
-
+
-
-
-
+
+
+
-
+
@@ -85,7 +94,7 @@
-
+