NTP Analyzer  0.8.2
Analyze the operation of time servers
Ntp.Analyzer.Render.Peer.BootstrapPeerInfoRender Class Reference
Inheritance diagram for Ntp.Analyzer.Render.Peer.BootstrapPeerInfoRender:
Collaboration diagram for Ntp.Analyzer.Render.Peer.BootstrapPeerInfoRender:

Public Member Functions

 BootstrapPeerInfoRender (Uri webPath, TimeServer server, DateTime now, DateTime next, string name, string ip)
 
override string Render ()
 
override string RenderFooter ()
 
override string RenderHead ()
 
- Public Member Functions inherited from Ntp.Analyzer.Render.HtmlObjectRender
void Add (IHtmlObject child)
 

Public Attributes

string Location => string.IsNullOrEmpty(server?.Location) ? PageText.HtmlBlank : server.Location
 
string Time
 
- Public Attributes inherited from Ntp.Analyzer.Render.HtmlObjectRender
IEnumerable< IHtmlObjectChildren => children.ToArray()
 

Properties

string IpV4Address [get]
 
string PoolMemberLink [get]
 
string PoolMemberStatus [get]
 
string ProviderLink [get]
 
string ServerAccess [get]
 
string ServiceArea [get]
 
string StratumText [get]
 
- Properties inherited from Ntp.Analyzer.Render.HtmlObjectRender
Uri WebPath [get]
 
- Properties inherited from Ntp.Analyzer.Render.IHtmlObject
IEnumerable< IHtmlObjectChildren [get]
 
Uri WebPath [get]
 

Private Attributes

readonly string ip
 
string IpV6Address => string.IsNullOrEmpty(server?.V6Address) ? PageText.HtmlBlank : server.V6Address
 
readonly string name
 
string Name => string.IsNullOrEmpty(server?.Name) ? name : server.Name
 
readonly DateTime next
 
readonly DateTime now
 
readonly TimeServer server
 
string ServerSync => string.IsNullOrEmpty(server?.Server) ? PageText.HtmlBlank : server.Server
 

Additional Inherited Members

- Protected Member Functions inherited from Ntp.Analyzer.Render.HtmlObjectRender
 HtmlObjectRender (Uri webPath)
 

Detailed Description

Definition at line 31 of file BootstrapPeerInfoRender.cs.

Constructor & Destructor Documentation

Ntp.Analyzer.Render.Peer.BootstrapPeerInfoRender.BootstrapPeerInfoRender ( Uri  webPath,
TimeServer  server,
DateTime  now,
DateTime  next,
string  name,
string  ip 
)
inline

Definition at line 33 of file BootstrapPeerInfoRender.cs.

Member Function Documentation

override string Ntp.Analyzer.Render.Peer.BootstrapPeerInfoRender.Render ( )
inline

Implements Ntp.Analyzer.Render.IHtmlObject.

Definition at line 196 of file BootstrapPeerInfoRender.cs.

References Ntp.Common.Web.PageText.HtmlBlank.

197  {
198  var builder = new StringBuilder();
199 
200  builder.AppendLine(@" <div class=""row"">");
201  builder.AppendLine(@" <div class=""col-md-2""><b>Server location</b></div>");
202  builder.Append(@" <div class=""col-md-10"">");
203  builder.Append(Location);
204  builder.AppendLine("</div>");
205  builder.AppendLine(@" </div>");
206 
207  builder.AppendLine(@" <div class=""row"">");
208  builder.AppendLine(@" <div class=""col-md-2""><b>Synchronization</b></div>");
209  builder.Append(@" <div class=""col-md-10"">");
210  builder.Append(ServerSync);
211  builder.AppendLine("</div>");
212  builder.AppendLine(@" </div>");
213 
214  builder.AppendLine(@" <div class=""row"">");
215  builder.AppendLine(@" <div class=""col-md-2""><b>IP address</b></div>");
216  builder.Append(@" <div class=""col-md-4"">");
217  builder.Append(IpV4Address);
218  builder.AppendLine("</div>");
219 
220  builder.AppendLine(@" <div class=""col-md-2""><b>Access policy</b></div>");
221  builder.Append(@" <div class=""col-md-4"">");
222  builder.Append(ServerAccess);
223  builder.AppendLine("</div>");
224  builder.AppendLine(@" </div>");
225 
226  builder.AppendLine(@" <div class=""row"">");
227  builder.AppendLine(@" <div class=""col-md-2""><b>IPv6 address</b></div>");
228  builder.Append(@" <div class=""col-md-4"">");
229  builder.Append(IpV6Address);
230  builder.AppendLine(@"</div>");
231 
232  builder.AppendLine(@" <div class=""col-md-2""><b>Service area</b></div>");
233  builder.Append(@" <div class=""col-md-4"">");
234  builder.Append(ServiceArea);
235  builder.AppendLine(@"</div>");
236  builder.AppendLine(@" </div>");
237 
238  builder.AppendLine(@" <div class=""row"">");
239  builder.AppendLine(@" <div class=""col-md-2""><b>Pool member</b></div>");
240  builder.Append(@" <div class=""col-md-4"">");
241  builder.Append(PoolMemberStatus);
242  builder.AppendLine(@"</div>");
243 
244  builder.AppendLine(@" <div class=""col-md-2""><b>Description</b></div>");
245  builder.Append(@" <div class=""col-md-4"">");
246  builder.Append(server?.Updated.ToLongDateString() ?? PageText.HtmlBlank);
247  builder.AppendLine(@"</div>");
248  builder.AppendLine(@" </div>");
249 
250  builder.AppendLine(@" <p class=""pool"">");
251 
252  if (PoolMemberLink != null)
253  {
254  builder.Append(@" ");
255  builder.Append(PoolMemberLink);
256  builder.AppendLine(@"&nbsp;&nbsp;&nbsp;");
257  }
258 
259  if (ProviderLink != null)
260  {
261  builder.Append(@" ");
262  builder.Append(ProviderLink);
263  builder.AppendLine(@"&nbsp;&nbsp;&nbsp;");
264  }
265 
266  if (server != null && server.Id <= 10000)
267  {
268  builder.Append(@" ");
269  builder.Append(
270  @"<a class=""btn btn-lg btn-primary"" href=""http://support.ntp.org/bin/view/Servers/PublicTimeServer");
271  builder.Append(server.Id.ToString(CultureInfo.InvariantCulture).PadLeft(6, '0'));
272  builder.AppendLine(@""">View info on support.ntp.org &raquo;</a>");
273  }
274 
275  builder.AppendLine(@" </p>");
276 
277  return builder.ToString();
278  }
const string HtmlBlank
Definition: PageText.cs:26
override string Ntp.Analyzer.Render.Peer.BootstrapPeerInfoRender.RenderFooter ( )
inlinevirtual

Implements Ntp.Analyzer.Render.HtmlObjectRender.

Definition at line 280 of file BootstrapPeerInfoRender.cs.

281  {
282  var builder = new StringBuilder();
283 
284  builder.AppendLine(" </div>");
285  builder.AppendLine(" </div>");
286 
287  return builder.ToString();
288  }
override string Ntp.Analyzer.Render.Peer.BootstrapPeerInfoRender.RenderHead ( )
inlinevirtual

Implements Ntp.Analyzer.Render.HtmlObjectRender.

Definition at line 290 of file BootstrapPeerInfoRender.cs.

291  {
292  var builder = new StringBuilder();
293 
294  builder.AppendLine(@" <div class=""container"">");
295  builder.AppendLine(@" <div class=""jumbotron"">");
296 
297  builder.Append(" <h1>");
298  builder.Append(Name);
299  builder.Append("</h1>");
300 
301  if (StratumText != null)
302  {
303  builder.Append("&nbsp;&nbsp;&nbsp;&nbsp;<h3>Stratum ");
304  builder.Append(StratumText);
305  builder.AppendLine(" server</h3>");
306  }
307 
308  builder.Append(" <p>");
309  builder.Append(Time);
310  builder.Append(". ");
311  builder.Append("Next refresh scheduled at ");
312  builder.Append(next.ToShortTimeString());
313  builder.AppendLine(".</p>");
314 
315  return builder.ToString();
316  }

Member Data Documentation

readonly string Ntp.Analyzer.Render.Peer.BootstrapPeerInfoRender.ip
private

Definition at line 49 of file BootstrapPeerInfoRender.cs.

string Ntp.Analyzer.Render.Peer.BootstrapPeerInfoRender.IpV6Address => string.IsNullOrEmpty(server?.V6Address) ? PageText.HtmlBlank : server.V6Address
private

Definition at line 128 of file BootstrapPeerInfoRender.cs.

string Ntp.Analyzer.Render.Peer.BootstrapPeerInfoRender.Location => string.IsNullOrEmpty(server?.Location) ? PageText.HtmlBlank : server.Location

Definition at line 96 of file BootstrapPeerInfoRender.cs.

readonly string Ntp.Analyzer.Render.Peer.BootstrapPeerInfoRender.name
private

Definition at line 50 of file BootstrapPeerInfoRender.cs.

string Ntp.Analyzer.Render.Peer.BootstrapPeerInfoRender.Name => string.IsNullOrEmpty(server?.Name) ? name : server.Name
private

Definition at line 55 of file BootstrapPeerInfoRender.cs.

readonly DateTime Ntp.Analyzer.Render.Peer.BootstrapPeerInfoRender.next
private

Definition at line 51 of file BootstrapPeerInfoRender.cs.

readonly DateTime Ntp.Analyzer.Render.Peer.BootstrapPeerInfoRender.now
private

Definition at line 52 of file BootstrapPeerInfoRender.cs.

readonly TimeServer Ntp.Analyzer.Render.Peer.BootstrapPeerInfoRender.server
private

Definition at line 53 of file BootstrapPeerInfoRender.cs.

string Ntp.Analyzer.Render.Peer.BootstrapPeerInfoRender.ServerSync => string.IsNullOrEmpty(server?.Server) ? PageText.HtmlBlank : server.Server
private

Definition at line 98 of file BootstrapPeerInfoRender.cs.

string Ntp.Analyzer.Render.Peer.BootstrapPeerInfoRender.Time
Initial value:
=> string.Concat(
now.ToLongDateString(),
" ",
TimeZoneInfo.Local.IsDaylightSavingTime(now)
? TimeZoneInfo.Local.DaylightName
: TimeZoneInfo.Local.StandardName,
" ",
now.ToLongTimeString()
)

Definition at line 86 of file BootstrapPeerInfoRender.cs.

Property Documentation

string Ntp.Analyzer.Render.Peer.BootstrapPeerInfoRender.IpV4Address
getprivate

Definition at line 101 of file BootstrapPeerInfoRender.cs.

string Ntp.Analyzer.Render.Peer.BootstrapPeerInfoRender.PoolMemberLink
getprivate

Definition at line 159 of file BootstrapPeerInfoRender.cs.

string Ntp.Analyzer.Render.Peer.BootstrapPeerInfoRender.PoolMemberStatus
getprivate

Definition at line 146 of file BootstrapPeerInfoRender.cs.

string Ntp.Analyzer.Render.Peer.BootstrapPeerInfoRender.ProviderLink
getprivate

Definition at line 180 of file BootstrapPeerInfoRender.cs.

string Ntp.Analyzer.Render.Peer.BootstrapPeerInfoRender.ServerAccess
getprivate

Definition at line 112 of file BootstrapPeerInfoRender.cs.

string Ntp.Analyzer.Render.Peer.BootstrapPeerInfoRender.ServiceArea
getprivate

Definition at line 131 of file BootstrapPeerInfoRender.cs.

string Ntp.Analyzer.Render.Peer.BootstrapPeerInfoRender.StratumText
getprivate

Definition at line 58 of file BootstrapPeerInfoRender.cs.


The documentation for this class was generated from the following file: