21 lines
1.0 KiB
C#
21 lines
1.0 KiB
C#
namespace UCVL.VPNPlus;
|
||
|
||
// Presentation only. A selected name or a ping response never establishes a connection.
|
||
internal static class NodePresentation
|
||
{
|
||
internal const string JinanSlug = "jinan-private-aux";
|
||
internal const string JinanName = "优创未来·济南办(Zero3)";
|
||
|
||
internal static string Name(string slug, string? serverName, bool privateAuxiliary) =>
|
||
!string.IsNullOrWhiteSpace(serverName) ? serverName
|
||
: privateAuxiliary && slug == JinanSlug ? JinanName : slug;
|
||
|
||
// Transport is a property of the established connection, not another node.
|
||
// Keep the undecorated server name separately so fallback never parses UI text.
|
||
internal static string WithTransport(string nodeName, bool usesTailnet) =>
|
||
usesTailnet ? $"{nodeName} + Tailscale" : nodeName;
|
||
|
||
internal static string LearningDetail(bool connected, string? actualNodeName, string message) =>
|
||
connected && !string.IsNullOrWhiteSpace(actualNodeName) ? $"{actualNodeName} · {message}" : message;
|
||
}
|