27 namespace Ntp.Analyzer.Render.
Host 32 : base(peerPages?.WebPath)
34 this.statusLine = statusLine;
35 this.peerPages = peerPages;
45 private string PeerName
49 string name = statusLine.PeerActivity.Peer.Name;
50 return name.Substring(0, name.Length > 18 ? 18 : name.Length);
54 private string Country => Server != null ? Server.
Country :
string.Empty;
56 private string Location =>
string.IsNullOrEmpty(Server?.DisplayLocation)
60 private int PageId => statusLine.PeerActivity.Id;
64 var builder =
new StringBuilder();
66 builder.Append($
"<td>{Peer.TallyChar}</td>");
67 builder.Append($
"<td>{PeerName}</td>");
68 builder.Append($
@"<td class=""aright"">{Peer.Stratus}</td>");
69 builder.Append($
@"<td class=""aright"">{Peer.LastPoll}</td>");
70 builder.Append($
@"<td class=""aright2"">{Peer.Poll}</td>");
71 builder.Append($
@"<td class=""aright"">{Peer.Reach}</td>");
72 builder.Append($
@"<td class=""aright"">{Peer.Delay.ToString("0.000
")}</td>");
73 builder.Append($
@"<td class=""aright"">{Peer.Offset.ToString("0.000
")}</td>");
74 builder.Append($
@"<td class=""aright"">{Peer.Jitter.ToString("0.000
")}</td>");
75 builder.Append($
@"<td class=""aright"">{Country}</td>");
77 if (peerPages != null)
79 builder.Append(
@"<td><a href=""");
80 builder.Append(peerPages.GetLink(PageId).ToHtmlString());
81 builder.Append(
@""">");
82 builder.Append(Location);
83 builder.AppendLine(
"</a></td>");
87 builder.Append(
@"<td>");
88 builder.Append(Location);
89 builder.AppendLine(
"</td>");
92 return builder.ToString();
HostLineRender(StatusLine statusLine, PeerPageConfiguration peerPages)
readonly StatusLine statusLine
A status line for an NTP Server containing information about configuration, peer and server details...
override string RenderFooter()
readonly PeerPageConfiguration peerPages
abstract string DisplayLocation
override string RenderHead()
Peer(int id, string name, string ip, TimeServer server)