mirror of
https://github.com/openziti/desktop-edge-win.git
synced 2026-10-13 16:21:25 +00:00
55 lines
1.1 KiB
C#
55 lines
1.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace ZitiDesktopEdge.Models {
|
|
public class ZitiService {
|
|
public string Name { get; set; }
|
|
public string AssignedIP { get; set; }
|
|
public string Host { get; set; }
|
|
public string Port { get; set; }
|
|
public bool OwnsIntercept { get; set; }
|
|
public string Url
|
|
{
|
|
get
|
|
{
|
|
if (this.OwnsIntercept)
|
|
{
|
|
return Host + ":" + Port;
|
|
} else
|
|
{
|
|
return AssignedIP + ":" + Port;
|
|
}
|
|
}
|
|
}
|
|
public string Warning
|
|
{
|
|
get
|
|
{
|
|
if (this.OwnsIntercept)
|
|
{
|
|
return "";
|
|
}
|
|
else
|
|
{
|
|
return $"Another identity already mapped the specified hostname: {Host}.\nThis service is only available via IP";
|
|
}
|
|
}
|
|
}
|
|
|
|
public ZitiService() {
|
|
}
|
|
|
|
public ZitiService(ZitiDesktopEdge.DataStructures.Service svc)
|
|
{
|
|
this.Name = svc.Name;
|
|
this.AssignedIP = svc.AssignedIP;
|
|
this.Host = svc.InterceptHost;
|
|
this.Port = svc.InterceptPort.ToString();
|
|
this.OwnsIntercept = svc.OwnsIntercept;
|
|
}
|
|
}
|
|
}
|