Beispiel #1
0
 public string GetServerName(string hostOrIp)
 {
     if (Settings.Enabled && IPAddress.TryParse(hostOrIp, out var addr))
     {
         var nodes = GetNodesByIP(addr).ToList();
         if (nodes.Count == 1)
         {
             return(nodes[0].PrettyName);
         }
     }
     return(AppCache.GetHostName(hostOrIp));
 }
Beispiel #2
0
 public string GetServerName(string hostOrIp)
 {
     if (Current.Settings.Dashboard.Enabled && IPAddress.TryParse(hostOrIp, out IPAddress addr))
     {
         var nodes = DashboardModule.GetNodesByIP(addr).ToList();
         if (nodes.Count == 1)
         {
             return(nodes[0].PrettyName);
         }
     }
     //System.Net.Dns.GetHostEntry("10.7.0.46").HostName.Split(StringSplits.Period).First()
     //TODO: Redis instance search
     return(AppCache.GetHostName(hostOrIp));
 }