Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
2dust committed Sep 24, 2019
1 parent cfb93a9 commit 02a3b25
Show file tree
Hide file tree
Showing 10 changed files with 1,093 additions and 1,091 deletions.
146 changes: 74 additions & 72 deletions v2rayN/v2rayN/Forms/MainForm.Designer.cs

Large diffs are not rendered by default.

39 changes: 23 additions & 16 deletions v2rayN/v2rayN/Forms/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,25 +59,25 @@ private void UpdateStatisticsHandler(ulong totalUp, ulong totalDown, ulong up, u
Utils.HumanFy(down)
);

List<string[]> datas = new List<string[]>();
for (int i = 0; i < config.vmess.Count; i++)
{
string totalUp_ = string.Empty,
totalDown_ = string.Empty,
todayUp_ = string.Empty,
todayDown_ = string.Empty;
var index = statistics.FindIndex(item_ => Utils.IsIdenticalServer(item_, new ServerStatistics(config.vmess[i].remarks, config.vmess[i].address, config.vmess[i].port, config.vmess[i].path, config.vmess[i].requestHost, 0, 0, 0, 0)));
if (index != -1)
{
totalUp_ = Utils.HumanFy(statistics[index].totalUp);
totalDown_ = Utils.HumanFy(statistics[index].totalDown);
todayUp_ = Utils.HumanFy(statistics[index].todayUp);
todayDown_ = Utils.HumanFy(statistics[index].todayDown);
List<string[]> datas = new List<string[]>();
for (int i = 0; i < config.vmess.Count; i++)
{
string totalUp_ = string.Empty,
totalDown_ = string.Empty,
todayUp_ = string.Empty,
todayDown_ = string.Empty;
var index = statistics.FindIndex(item_ => Utils.IsIdenticalServer(item_, new ServerStatistics(config.vmess[i].remarks, config.vmess[i].address, config.vmess[i].port, config.vmess[i].path, config.vmess[i].requestHost, 0, 0, 0, 0)));
if (index != -1)
{
totalUp_ = Utils.HumanFy(statistics[index].totalUp);
totalDown_ = Utils.HumanFy(statistics[index].totalDown);
todayUp_ = Utils.HumanFy(statistics[index].todayUp);
todayDown_ = Utils.HumanFy(statistics[index].todayDown);
}

datas.Add(new string[] { totalUp_, totalDown_, todayUp_, todayDown_ });
}

lvServers.Invoke((MethodInvoker)delegate
{
lvServers.SuspendLayout();
Expand Down Expand Up @@ -382,7 +382,14 @@ private void DisplayToolStatus()
toolSslHttpPort.Text = $"{localIP}:{Global.sysAgentPort}";
if (config.listenerType == 2 || config.listenerType == 4)
{
toolSslPacPort.Text = $"{HttpProxyHandle.GetPacUrl()}";
if (PACServerHandle.IsRunning)
{
toolSslPacPort.Text = $"{HttpProxyHandle.GetPacUrl()}";
}
else
{
toolSslPacPort.Text = UIRes.I18N("StartPacFailed");
}
}
}
}
Expand Down
1,702 changes: 851 additions & 851 deletions v2rayN/v2rayN/Forms/MainForm.resx

Large diffs are not rendered by default.

83 changes: 37 additions & 46 deletions v2rayN/v2rayN/Forms/MainForm.zh-Hans.resx
Original file line number Diff line number Diff line change
Expand Up @@ -282,21 +282,12 @@
ZW0uRHJhd2luZy5HcmFwaGljc1VuaXQBAAAAB3ZhbHVlX18ACAMAAAADAAAACw==
</value>
</data>
<data name="cmsMain.Size" type="System.Drawing.Size, System.Drawing">
<value>196, 164</value>
</data>
<data name="menuSysAgentEnabled.Size" type="System.Drawing.Size, System.Drawing">
<value>195, 22</value>
</data>
<data name="menuSysAgentEnabled.Text" xml:space="preserve">
<value>启用Http代理</value>
</data>
<data name="menuSysAgentMode.Size" type="System.Drawing.Size, System.Drawing">
<value>195, 22</value>
</data>
<data name="menuSysAgentMode.Text" xml:space="preserve">
<value>Http代理模式</value>
</data>
<data name="menuGlobal.Size" type="System.Drawing.Size, System.Drawing">
<value>340, 22</value>
</data>
Expand All @@ -321,6 +312,12 @@
<data name="menuKeepPAC.Text" xml:space="preserve">
<value>仅开启PAC,不自动配置PAC</value>
</data>
<data name="menuSysAgentMode.Size" type="System.Drawing.Size, System.Drawing">
<value>195, 22</value>
</data>
<data name="menuSysAgentMode.Text" xml:space="preserve">
<value>Http代理模式</value>
</data>
<data name="menuServers.Size" type="System.Drawing.Size, System.Drawing">
<value>195, 22</value>
</data>
Expand Down Expand Up @@ -354,27 +351,18 @@
<data name="menuExit.Text" xml:space="preserve">
<value>退出</value>
</data>
<data name="cmsMain.Size" type="System.Drawing.Size, System.Drawing">
<value>196, 164</value>
</data>
<data name="groupBox1.Text" xml:space="preserve">
<value>服务器列表</value>
</data>
<data name="toolSslServerSpeed.Text" xml:space="preserve">
<value>网速显示未启用</value>
</data>
<data name="groupBox2.Text" xml:space="preserve">
<value>信息</value>
</data>
<data name="toolSslBlank1.Size" type="System.Drawing.Size, System.Drawing">
<value>176, 17</value>
</data>
<data name="toolSslBlank2.Size" type="System.Drawing.Size, System.Drawing">
<value>176, 17</value>
</data>
<data name="toolSslBlank3.Size" type="System.Drawing.Size, System.Drawing">
<value>176, 17</value>
</data>
<data name="tsbSub.Size" type="System.Drawing.Size, System.Drawing">
<value>61, 53</value>
</data>
<data name="tsbSub.Text" xml:space="preserve">
<value> 订阅 </value>
</data>
<data name="tsbSubSetting.Size" type="System.Drawing.Size, System.Drawing">
<value>124, 22</value>
</data>
Expand All @@ -387,6 +375,12 @@
<data name="tsbSubUpdate.Text" xml:space="preserve">
<value>更新订阅</value>
</data>
<data name="tsbSub.Size" type="System.Drawing.Size, System.Drawing">
<value>61, 53</value>
</data>
<data name="tsbSub.Text" xml:space="preserve">
<value> 订阅 </value>
</data>
<data name="tsbOptionSetting.Size" type="System.Drawing.Size, System.Drawing">
<value>76, 53</value>
</data>
Expand All @@ -395,13 +389,13 @@
</data>
<data name="tsbReload.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
wwAADsMBx2+oZAAAATdJREFUWEftloENAiEMRW8ER3AEN9ANdARHcAPdwBF0A91AN9INtC+5JvUCJwWM
mvCTFw3QUiiU65qa/lUTYT6Ato9rJZyERwT6GFNdU+EihCYNwVhsqmgm3AR1fheOAitd9PCfNvp0HDbY
FolV2MmZZCzX9J0FG0TRTlwFdbahIVE7Qe1IR5bYVnXCyr2yO5F1MNUBec25YtjomcCXSxhr9DmrV2Gr
flyL4GSrYcm9tmnEZ7JsAC7DgWr5ydbXA8hOAcVjG8FTD6ocQgvXKrW8MqFWUfc1DAXgmRwVFaJQAHsh
VbYUU87diqWA934sl/TZ7wV2Lesx0gBwsO5/1Sl5PQhLQb+G+E+bfTm9KXsRAVgHrMK+jO9gbNEzzMSh
6DlM9nANoa+kdCeLXLNLFtc9b2r6EXXdE4e4mdByNuG1AAAAAElFTkSuQmCC
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAE3SURBVFhH7ZaBDQIhDEVvBEdwBDfQDXQER3AD3cARdAPd
QDfSDbQvuSb1AicFjJrwkxcN0FIolOuamv5VE2E+gLaPayWchEcE+hhTXVPhIoQmDcFYbKpoJtwEdX4X
jgIrXfTwnzb6dBw22BaJVdjJmWQs1/SdBRtE0U5cBXW2oSFRO0HtSEeW2FZ1wsq9sjuRdTDVAXnNuWLY
6JnAl0sYa/Q5q1dhq35ci+Bkq2HJvbZpxGeybAAuw4Fq+cnW1wPITgHFYxvBUw+qHEIL1yq1vDKhVlH3
NQwF4JkcFRWiUAB7IVW2FFPO3YqlgPd+LJf02e8Fdi3rMdIAcLDuf9UpeT0IS0G/hvhPm305vSl7EQFY
B6zCvozvYGzRM8zEoeg5TPZwDaGvpHQni1yzSxbXPW9q+hF13ROHuJnQcjbhtQAAAABJRU5ErkJggg==
</value>
</data>
<data name="tsbReload.Size" type="System.Drawing.Size, System.Drawing">
Expand All @@ -410,12 +404,6 @@
<data name="tsbReload.Text" xml:space="preserve">
<value> 重启服务 </value>
</data>
<data name="tsbCheckUpdate.Size" type="System.Drawing.Size, System.Drawing">
<value>85, 53</value>
</data>
<data name="tsbCheckUpdate.Text" xml:space="preserve">
<value> 检查更新 </value>
</data>
<data name="tsbCheckUpdateN.Size" type="System.Drawing.Size, System.Drawing">
<value>232, 22</value>
</data>
Expand All @@ -440,15 +428,21 @@
<data name="tsbCheckClearPACList.Text" xml:space="preserve">
<value>简化PAC (请设置Core路由)</value>
</data>
<data name="tsbCheckUpdate.Size" type="System.Drawing.Size, System.Drawing">
<value>85, 53</value>
</data>
<data name="tsbCheckUpdate.Text" xml:space="preserve">
<value> 检查更新 </value>
</data>
<data name="tsbAbout.Text" xml:space="preserve">
<value>关于</value>
</data>
<data name="tsbHelp.Size" type="System.Drawing.Size, System.Drawing">
<value>69, 53</value>
</data>
<data name="tsbHelp.Text" xml:space="preserve">
<value> 帮助 </value>
</data>
<data name="tsbAbout.Text" xml:space="preserve">
<value>关于</value>
</data>
<data name="tsbPromotion.Size" type="System.Drawing.Size, System.Drawing">
<value>68, 53</value>
</data>
Expand All @@ -457,15 +451,12 @@
</data>
<data name="tsbClose.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
wwAADsMBx2+oZAAAADJJREFUWEftzrENACAIRUFGdVMdTZkAG4zFXfI68kMAAD8ap9lUbpfyaDV19QAA
8FDEBl3RImu5VcdbAAAAAElFTkSuQmCC
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAySURBVFhH7c6xDQAgCEVBRnVTHU2ZABuMxV3yOvJDAAA/
GqfZVG6X8mg1dfUAAPBQxAZd0SJruVXHWwAAAABJRU5ErkJggg==
</value>
</data>
<data name="tsbClose.Text" xml:space="preserve">
<value> 关闭 </value>
</data>
<data name="toolSslServerSpeed.Text" xml:space="preserve">
<value>网速显示未启用</value>
</data>
</root>
3 changes: 2 additions & 1 deletion v2rayN/v2rayN/Handler/StatisticsHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ public void LoadFromFile()

try
{
Utils.SaveLog(logPath_ + Global.StatisticLogOverall);
var overallPath = Path.Combine(logPath_, Global.StatisticLogOverall);
if (File.Exists(overallPath))
{
Expand Down Expand Up @@ -346,7 +347,7 @@ public void LoadFromFile()

try
{
// 当天流量记录文件
Utils.SaveLog(logPath_ + $"{DateTime.Now.ToString("yyyy-MM-dd")}.txt");
var dailyPath = Path.Combine(logPath_, $"{DateTime.Now.ToString("yyyy-MM-dd")}.txt");
if (File.Exists(dailyPath))
{
Expand Down
5 changes: 3 additions & 2 deletions v2rayN/v2rayN/HttpProxyHandler/PACServerHandle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ class PACServerHandle
{
private static int pacPort = 0;
private static HttpWebServer server;
public bool IsRunning

public static bool IsRunning
{
get
{
Expand All @@ -42,7 +43,7 @@ public static void Init(Config config)
}
}

public static bool InitServer(string address)
private static bool InitServer(string address)
{
try
{
Expand Down
2 changes: 1 addition & 1 deletion v2rayN/v2rayN/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@
// 方法是按如下所示使用“*”:
//[assembly: AssemblyVersion("1.0.*")]
//[assembly: AssemblyVersion("1.0.0")]
[assembly: AssemblyFileVersion("2.40")]
[assembly: AssemblyFileVersion("2.41")]
Loading

0 comments on commit 02a3b25

Please sign in to comment.