Skip to content

Commit

Permalink
优化启用BBR显示进度
Browse files Browse the repository at this point in the history
  • Loading branch information
proxysu committed Oct 27, 2020
1 parent 2cac6c6 commit cf529a2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion ProxySU/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:ProxySU"
mc:Ignorable="d"
Title="ProxySU - v2.4.14" Height="675" Width="650">
Title="ProxySU - v2.4.15" Height="675" Width="650">
<!--以下样式参考自:https://yq.aliyun.com/articles/331878
https://docs.microsoft.com/en-us/dotnet/desktop-wpf/fundamentals/styles-templates-overview-->
<Window.Resources>
Expand Down
10 changes: 6 additions & 4 deletions ProxySU/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@ public class LanguageInfo
static string ipv4 = String.Empty; //保存获取的ipv4地址
static string ipv6 = String.Empty; //保存获取的ipv6地址
static bool onlyIpv6 = false; //主机是否基于纯ipv6地址
//static string scriptGithubUrl = "raw.githubusercontent.com";//安装脚本下载地址
//static string apiGithubCom = "api.github.com"; //github api接口
//static string githubCom = "github.com"; //github 主站网址
static bool functionResult = true; //标示功能函数是否执行状态(true无错误发生/false有错误发生)
static string sshShellCommand = String.Empty; //定义保存执行的命令
static string currentStatus = String.Empty; //定议保存要显示的状态
Expand Down Expand Up @@ -5323,6 +5320,7 @@ private void StartTestAndEnableBBR(ConnectionInfo connectionInfo)
functionResult = RootAuthorityDetect(client);
if (functionResult == false) { FunctionResultErr(); client.Disconnect(); return; }

SetUpProgressBarProcessing(30);
//****** "BBR测试......" ******
currentStatus = Application.Current.FindResource("DisplayInstallInfo_TestBBR").ToString();
MainWindowsShowInfo(currentStatus);
Expand All @@ -5340,6 +5338,7 @@ private void StartTestAndEnableBBR(ConnectionInfo connectionInfo)
//如果内核满足大于等于4.9,且还未启用BBR,则启用BBR
if (detectResultBBR == true && resultCmdTestBBR.Contains("bbr") == false)
{
SetUpProgressBarProcessing(60);
//****** "正在启用BBR......" ******
currentStatus = Application.Current.FindResource("DisplayInstallInfo_EnableBBR").ToString();
MainWindowsShowInfo(currentStatus);
Expand All @@ -5355,18 +5354,21 @@ private void StartTestAndEnableBBR(ConnectionInfo connectionInfo)
}
else if (resultCmdTestBBR.Contains("bbr") == true)
{
SetUpProgressBarProcessing(100);
//****** "BBR已经启用了!" ******
currentStatus = Application.Current.FindResource("DisplayInstallInfo_BBRisEnabled").ToString();
MainWindowsShowInfo(currentStatus);

}
else
{
//****** "系统不满足启用BBR的条件,启用失败!" ******
currentStatus = Application.Current.FindResource("DisplayInstallInfo_BBRFailed").ToString();
MainWindowsShowInfo(currentStatus);
}
client.Disconnect();//断开服务器ssh连接

client.Disconnect();//断开服务器ssh连接

return;
}
}
Expand Down
4 changes: 2 additions & 2 deletions ProxySU/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
// 方法是按如下所示使用“*”: :
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.4.14.0")]
[assembly: AssemblyFileVersion("2.4.14.0")]
[assembly: AssemblyVersion("2.4.15.0")]
[assembly: AssemblyFileVersion("2.4.15.0")]
Binary file modified ProxySU/bin/Beta/Beta.zip
Binary file not shown.

0 comments on commit cf529a2

Please sign in to comment.