Files
ucvl-zonghengjia-open-source/windows/NodePresentation.cs
2026-10-11 23:23:20 +00:00

21 lines
1.0 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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;
}