mirror of
https://github.com/netchx/netch.git
synced 2026-05-07 22:44:03 +08:00
更新NTT类型为数字显示
1.FullCone 2.RestrictedCone 3.PortRestrictedCone 4.Symmetric
This commit is contained in:
@@ -124,11 +124,13 @@ namespace Netch.Forms
|
||||
{
|
||||
NatTypeStatusLabel.Text = String.Format("NAT{0}{1}", i18N.Translate(": "), text);
|
||||
}
|
||||
|
||||
if (Enum.TryParse(text, false, out STUN_Client.NatType natType))
|
||||
if (int.TryParse(text, out int natType))
|
||||
{
|
||||
NatTypeStatusLightLabel.Visible = true;
|
||||
UpdateNatTypeLight(natType);
|
||||
if (natType > 0 && natType < 5)
|
||||
{
|
||||
NatTypeStatusLightLabel.Visible = true;
|
||||
UpdateNatTypeLight(natType);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -169,6 +171,35 @@ namespace Netch.Forms
|
||||
NatTypeStatusLightLabel.ForeColor = c;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新 NAT指示灯颜色
|
||||
/// </summary>
|
||||
/// <param name="natType"></param>
|
||||
private void UpdateNatTypeLight(int natType)
|
||||
{
|
||||
Color c;
|
||||
switch (natType)
|
||||
{
|
||||
case 1:
|
||||
c = Color.LimeGreen;
|
||||
break;
|
||||
case 2:
|
||||
c = Color.Yellow;
|
||||
break;
|
||||
case 3:
|
||||
c = Color.Red;
|
||||
break;
|
||||
case 4:
|
||||
c = Color.Black;
|
||||
break;
|
||||
default:
|
||||
c = Color.Black;
|
||||
break;
|
||||
}
|
||||
|
||||
NatTypeStatusLightLabel.ForeColor = c;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新状态栏文本
|
||||
/// </summary>
|
||||
|
||||
@@ -166,7 +166,7 @@ namespace Netch.Models
|
||||
/// <summary>
|
||||
/// STUN测试服务器
|
||||
/// </summary>
|
||||
public string STUN_Server = "stun.stunprotocol.org";
|
||||
public string STUN_Server = "stun.syncthing.net";
|
||||
|
||||
/// <summary>
|
||||
/// STUN测试服务器
|
||||
|
||||
2
binaries
2
binaries
Submodule binaries updated: 5973ce45ed...8ba243799b
Reference in New Issue
Block a user