From 4fc0738dad2ba30cfbc123bc7670246a5286d444 Mon Sep 17 00:00:00 2001
From: 2dust <31833384+2dust@users.noreply.github.com>
Date: Thu, 2 Dec 2021 19:39:02 +0800
Subject: [PATCH] Routing rule display
---
v2rayN/v2rayN/Forms/MainForm.Designer.cs | 61 +++++---------
v2rayN/v2rayN/Forms/MainForm.cs | 6 +-
v2rayN/v2rayN/Forms/MainForm.resx | 102 ++++++++---------------
3 files changed, 63 insertions(+), 106 deletions(-)
diff --git a/v2rayN/v2rayN/Forms/MainForm.Designer.cs b/v2rayN/v2rayN/Forms/MainForm.Designer.cs
index 6876d61e..e0d61ca8 100644
--- a/v2rayN/v2rayN/Forms/MainForm.Designer.cs
+++ b/v2rayN/v2rayN/Forms/MainForm.Designer.cs
@@ -77,12 +77,8 @@
this.menuMsgBoxAddRoutingRule = new System.Windows.Forms.ToolStripMenuItem();
this.menuMsgBoxFilter = new System.Windows.Forms.ToolStripMenuItem();
this.ssMain = new System.Windows.Forms.StatusStrip();
- this.toolSslSocksPortLab = new System.Windows.Forms.ToolStripStatusLabel();
- this.toolSslSocksPort = new System.Windows.Forms.ToolStripStatusLabel();
+ this.toolSslInboundInfo = new System.Windows.Forms.ToolStripStatusLabel();
this.toolSslBlank1 = new System.Windows.Forms.ToolStripStatusLabel();
- this.toolSslHttpPortLab = new System.Windows.Forms.ToolStripStatusLabel();
- this.toolSslHttpPort = new System.Windows.Forms.ToolStripStatusLabel();
- this.toolSslBlank2 = new System.Windows.Forms.ToolStripStatusLabel();
this.toolSslServerSpeed = new System.Windows.Forms.ToolStripStatusLabel();
this.toolSslBlank4 = new System.Windows.Forms.ToolStripStatusLabel();
this.notifyMain = new System.Windows.Forms.NotifyIcon(this.components);
@@ -133,6 +129,8 @@
this.tsbPromotion = new System.Windows.Forms.ToolStripButton();
this.toolStripSeparator11 = new System.Windows.Forms.ToolStripSeparator();
this.tsbClose = new System.Windows.Forms.ToolStripButton();
+ this.toolSslRoutingRule = new System.Windows.Forms.ToolStripStatusLabel();
+ this.toolSslBlank2 = new System.Windows.Forms.ToolStripStatusLabel();
((System.ComponentModel.ISupportInitialize)(this.scMain)).BeginInit();
this.scMain.Panel1.SuspendLayout();
this.scMain.Panel2.SuspendLayout();
@@ -221,6 +219,7 @@
this.menuExport2ShareUrl,
this.menuExport2SubContent});
this.cmsLv.Name = "cmsLv";
+ this.cmsLv.OwnerItem = this.tsbServer;
resources.ApplyResources(this.cmsLv, "cmsLv");
//
// menuAddVmessServer
@@ -501,11 +500,9 @@
//
this.ssMain.ImageScalingSize = new System.Drawing.Size(20, 20);
this.ssMain.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.toolSslSocksPortLab,
- this.toolSslSocksPort,
+ this.toolSslInboundInfo,
this.toolSslBlank1,
- this.toolSslHttpPortLab,
- this.toolSslHttpPort,
+ this.toolSslRoutingRule,
this.toolSslBlank2,
this.toolSslServerSpeed,
this.toolSslBlank4});
@@ -513,15 +510,10 @@
this.ssMain.Name = "ssMain";
this.ssMain.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.ssMain_ItemClicked);
//
- // toolSslSocksPortLab
+ // toolSslInboundInfo
//
- resources.ApplyResources(this.toolSslSocksPortLab, "toolSslSocksPortLab");
- this.toolSslSocksPortLab.Name = "toolSslSocksPortLab";
- //
- // toolSslSocksPort
- //
- this.toolSslSocksPort.Name = "toolSslSocksPort";
- resources.ApplyResources(this.toolSslSocksPort, "toolSslSocksPort");
+ this.toolSslInboundInfo.Name = "toolSslInboundInfo";
+ resources.ApplyResources(this.toolSslInboundInfo, "toolSslInboundInfo");
//
// toolSslBlank1
//
@@ -529,22 +521,6 @@
this.toolSslBlank1.Name = "toolSslBlank1";
this.toolSslBlank1.Spring = true;
//
- // toolSslHttpPortLab
- //
- resources.ApplyResources(this.toolSslHttpPortLab, "toolSslHttpPortLab");
- this.toolSslHttpPortLab.Name = "toolSslHttpPortLab";
- //
- // toolSslHttpPort
- //
- this.toolSslHttpPort.Name = "toolSslHttpPort";
- resources.ApplyResources(this.toolSslHttpPort, "toolSslHttpPort");
- //
- // toolSslBlank2
- //
- resources.ApplyResources(this.toolSslBlank2, "toolSslBlank2");
- this.toolSslBlank2.Name = "toolSslBlank2";
- this.toolSslBlank2.Spring = true;
- //
// toolSslServerSpeed
//
resources.ApplyResources(this.toolSslServerSpeed, "toolSslServerSpeed");
@@ -889,6 +865,17 @@
this.tsbClose.Name = "tsbClose";
this.tsbClose.Click += new System.EventHandler(this.tsbClose_Click);
//
+ // toolSslRoutingRule
+ //
+ this.toolSslRoutingRule.Name = "toolSslRoutingRule";
+ resources.ApplyResources(this.toolSslRoutingRule, "toolSslRoutingRule");
+ //
+ // toolSslBlank2
+ //
+ this.toolSslBlank2.Name = "toolSslBlank2";
+ resources.ApplyResources(this.toolSslBlank2, "toolSslBlank2");
+ this.toolSslBlank2.Spring = true;
+ //
// MainForm
//
resources.ApplyResources(this, "$this");
@@ -994,12 +981,7 @@
private System.Windows.Forms.ToolStripButton tsbPromotion;
private System.Windows.Forms.ToolStripMenuItem menuAddSocksServer;
private System.Windows.Forms.StatusStrip ssMain;
- private System.Windows.Forms.ToolStripStatusLabel toolSslSocksPort;
- private System.Windows.Forms.ToolStripStatusLabel toolSslHttpPort;
- private System.Windows.Forms.ToolStripStatusLabel toolSslBlank2;
private System.Windows.Forms.ToolStripStatusLabel toolSslBlank1;
- private System.Windows.Forms.ToolStripStatusLabel toolSslSocksPortLab;
- private System.Windows.Forms.ToolStripStatusLabel toolSslHttpPortLab;
private System.Windows.Forms.ToolStripStatusLabel toolSslServerSpeed;
private System.Windows.Forms.ToolStripStatusLabel toolSslBlank4;
private System.Windows.Forms.ToolStripMenuItem menuRemoveDuplicateServer;
@@ -1032,6 +1014,9 @@
private System.Windows.Forms.ToolStripMenuItem tsbCheckUpdateGeoIP;
private System.Windows.Forms.SplitContainer splitContainer1;
private System.Windows.Forms.ToolStripMenuItem menuMsgBoxFilter;
+ private System.Windows.Forms.ToolStripStatusLabel toolSslInboundInfo;
+ private System.Windows.Forms.ToolStripStatusLabel toolSslRoutingRule;
+ private System.Windows.Forms.ToolStripStatusLabel toolSslBlank2;
}
}
diff --git a/v2rayN/v2rayN/Forms/MainForm.cs b/v2rayN/v2rayN/Forms/MainForm.cs
index 320fd707..525620d5 100644
--- a/v2rayN/v2rayN/Forms/MainForm.cs
+++ b/v2rayN/v2rayN/Forms/MainForm.cs
@@ -352,8 +352,8 @@ namespace v2rayN.Forms
private void DisplayToolStatus()
{
- toolSslSocksPort.Text = $"{Global.Loopback}:{config.inbound[0].localPort}";
- toolSslHttpPort.Text = $"{Global.Loopback}:{Global.httpPort}";
+ toolSslInboundInfo.Text = $"{Global.InboundSocks} {Global.Loopback}:{config.inbound[0].localPort} | "
+ + $"{ Global.InboundHttp} { Global.Loopback}:{Global.httpPort}";
notifyMain.Icon = MainFormHandler.Instance.GetNotifyIcon(config, this.Icon);
}
@@ -1389,6 +1389,7 @@ namespace v2rayN.Forms
menuRoutings.Visible = config.enableRoutingAdvanced;
if (!config.enableRoutingAdvanced)
{
+ toolSslRoutingRule.Text = string.Empty;
return;
}
@@ -1411,6 +1412,7 @@ namespace v2rayN.Forms
if (config.routingIndex.Equals(k))
{
ts.Checked = true;
+ toolSslRoutingRule.Text = item.remarks;
}
ts.Click += new EventHandler(ts_Routing_Click);
lst.Add(ts);
diff --git a/v2rayN/v2rayN/Forms/MainForm.resx b/v2rayN/v2rayN/Forms/MainForm.resx
index a0f751f7..0387e8be 100644
--- a/v2rayN/v2rayN/Forms/MainForm.resx
+++ b/v2rayN/v2rayN/Forms/MainForm.resx
@@ -302,6 +302,18 @@
Export subscription (base64) share to clipboard
+
+ Magenta
+
+
+ 64, 53
+
+
+ Servers
+
+
+ ImageAboveText
+
356, 622
@@ -428,18 +440,6 @@
0
-
- Magenta
-
-
- 64, 53
-
-
- Servers
-
-
- ImageAboveText
-
Fill
@@ -566,41 +566,23 @@
228, 18
-
- 微软雅黑, 8pt
+
+ 80, 21
-
- 52, 21
-
-
- SOCKS5:
-
-
- 0, 21
+
+ InboundInfo
微软雅黑, 8pt
- 279, 21
+ 285, 21
-
- 微软雅黑, 8pt
-
-
- 39, 21
-
-
- HTTP:
-
-
+
0, 21
-
- 微软雅黑, 8pt
-
- 279, 21
+ 285, 21
False
@@ -831,13 +813,13 @@
6, 56
- 180, 22
+ 125, 22
Settings
- 180, 22
+ 125, 22
Updates
@@ -1319,16 +1301,10 @@
System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
- toolSslSocksPortLab
+
+ toolSslInboundInfo
-
- System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- toolSslSocksPort
-
-
+
System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
@@ -1337,24 +1313,6 @@
System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
- toolSslHttpPortLab
-
-
- System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- toolSslHttpPort
-
-
- System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- toolSslBlank2
-
-
- System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
toolSslServerSpeed
@@ -1637,6 +1595,18 @@
System.Windows.Forms.ToolStripButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ toolSslRoutingRule
+
+
+ System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ toolSslBlank2
+
+
+ System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
MainForm