Refactroing Server.ToString, Remove country name in ServerComboBox Text

This commit is contained in:
ChsBuffer
2020-10-03 21:14:12 +08:00
parent 40db9adc0d
commit 4617de3fda
7 changed files with 9 additions and 25 deletions

View File

@@ -21,6 +21,8 @@ namespace Netch.Models
/// </summary>
string FullName { get; }
string ShortName { get; }
/// <summary>
/// Support URI
/// </summary>

View File

@@ -59,28 +59,9 @@ namespace Netch.Models
Remark = $"{Hostname}:{Port}";
}
if (Country == null)
{
Country = Utils.Utils.GetCityCode(Hostname);
}
Group = Group.Equals("None") || Group.Equals("") ? "NONE" : Group;
switch (Type)
{
case "Socks5":
return $"[S5][{Country}][{Group}] {Remark}";
case "SS":
return $"[SS][{Country}][{Group}] {Remark}";
case "SSR":
return $"[SR][{Country}][{Group}] {Remark}";
case "VMess":
return $"[V2][{Country}][{Group}] {Remark}";
case "Trojan":
return $"[TR][{Country}][{Group}] {Remark}";
default:
return "WTF";
}
return $"[{ServerHelper.GetUtilByTypeName(Type)?.ShortName ?? "WTF"}][{Group}] {Remark}";
}
/// <summary>

View File

@@ -18,8 +18,8 @@ namespace Netch.Servers.Shadowsocks
public ushort Priority { get; } = 1;
public string TypeName { get; } = "SS";
public string FullName { get; } = "Shadowsocks";
public string[] UriScheme { get; } = {"ss","ssd"};
public string ShortName { get; } = "SS";
public string[] UriScheme { get; } = {"ss", "ssd"};
public Server ParseJObject(JObject j)
{

View File

@@ -14,7 +14,7 @@ namespace Netch.Servers.ShadowsocksR
public ushort Priority { get; } = 1;
public string TypeName { get; } = "SSR";
public string FullName { get; } = "ShadowsocksR";
public string ShortName { get; } = "SR";
public string[] UriScheme { get; } = {"ssr"};
public Server ParseJObject(JObject j)

View File

@@ -12,7 +12,7 @@ namespace Netch.Servers.Socks5
public ushort Priority { get; } = 0;
public string TypeName { get; } = "Socks5";
public string FullName { get; } = "Socks5";
public string ShortName { get; } = "S5";
public string[] UriScheme { get; } = { };
public Server ParseJObject(JObject j)

View File

@@ -14,7 +14,7 @@ namespace Netch.Servers.Trojan
public ushort Priority { get; } = 2;
public string TypeName { get; } = "Trojan";
public string FullName { get; } = "Trojan";
public string ShortName { get; } = "TR";
public string[] UriScheme { get; } = {"trojan"};
public Server ParseJObject(JObject j)

View File

@@ -14,6 +14,7 @@ namespace Netch.Servers.VMess
public ushort Priority { get; } = 2;
public string TypeName { get; } = "VMess";
public string FullName { get; } = "VMess";
public string ShortName { get; } = "V2";
public string[] UriScheme { get; } = {"vmess"};
public Server ParseJObject(JObject j)