mirror of
https://github.com/netchx/netch.git
synced 2026-03-18 18:13:21 +08:00
Refactroing Server.ToString, Remove country name in ServerComboBox Text
This commit is contained in:
@@ -21,6 +21,8 @@ namespace Netch.Models
|
||||
/// </summary>
|
||||
string FullName { get; }
|
||||
|
||||
string ShortName { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Support URI
|
||||
/// </summary>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user