NTP Analyzer  0.8.2
Analyze the operation of time servers
Ntp.Analyzer.Page.BootstrapPeerPageBuilder Class Reference
Inheritance diagram for Ntp.Analyzer.Page.BootstrapPeerPageBuilder:
Collaboration diagram for Ntp.Analyzer.Page.BootstrapPeerPageBuilder:

Public Member Functions

 BootstrapPeerPageBuilder (Host host, Peer peer, MenuConfiguration menu, PeerPageConfiguration page)
 
override Stream Generate ()
 

Public Attributes

override IEnumerable< StreamDestinationDestinations => page.Destinations.Destinations
 

Private Attributes

readonly Host host
 
readonly MenuConfiguration menu
 
readonly PeerPageConfiguration page
 
readonly Peer peer
 

Additional Inherited Members

- Protected Member Functions inherited from Ntp.Analyzer.Page.PageBuilderBase
Stream ToStream (string text)
 
- Properties inherited from Ntp.Analyzer.Page.PageBuilderBase
abstract IEnumerable< StreamDestinationDestinations [get]
 
- Properties inherited from Ntp.Analyzer.Export.IStreamGenerator
IEnumerable< StreamDestinationDestinations [get]
 

Detailed Description

Definition at line 35 of file BootstrapPeerPageBuilder.cs.

Constructor & Destructor Documentation

Ntp.Analyzer.Page.BootstrapPeerPageBuilder.BootstrapPeerPageBuilder ( Host  host,
Peer  peer,
MenuConfiguration  menu,
PeerPageConfiguration  page 
)
inline

Definition at line 37 of file BootstrapPeerPageBuilder.cs.

42  {
43  this.host = host;
44  this.peer = peer;
45  this.menu = menu;
46  this.page = page;
47  }

Member Function Documentation

override Stream Ntp.Analyzer.Page.BootstrapPeerPageBuilder.Generate ( )
inlinevirtual

Implements Ntp.Analyzer.Page.PageBuilderBase.

Definition at line 56 of file BootstrapPeerPageBuilder.cs.

57  {
58  DateTime now = DateTime.Now;
59  var schedule = new JobScheduleDescription(false, false, page.Frequency);
60  DateTime next = schedule.CalculateNextRun(now);
61  int wait = Convert.ToInt32(next.Subtract(now).TotalSeconds) + 1;
62 
63  // Create page
64  var peerPage = new BootstrapPeerPageRender(page.WebPath, peer.Name, wait);
65 
66  if (menu != null)
67  {
68  peerPage.Add(new BootstrapMenuRender(page.WebPath, menu, page));
69  }
70 
71  peerPage.Add(new BootstrapPeerInfoRender(page.WebPath, peer.Server, now, next, peer.Name, peer.Ip));
73 
74  // Generate HTML
75  var htmlRender = new HtmlRenderer(peerPage);
76  string html = htmlRender.Render();
77 
78  return ToStream(html);
79  }
A description of job schedule rules.
Uri WebPath
Gets the web path in the HostSubConfiguration.
Renders IHtmlObjects into plain text for display in browsers.
Definition: HtmlRenderer.cs:31
IEnumerable< GraphSetConfiguration > Graphs
Gets the graphs to be displayed on this page.
TimeServer Server
Definition: Peer.cs:42

Member Data Documentation

override IEnumerable<StreamDestination> Ntp.Analyzer.Page.BootstrapPeerPageBuilder.Destinations => page.Destinations.Destinations

Definition at line 54 of file BootstrapPeerPageBuilder.cs.

readonly Host Ntp.Analyzer.Page.BootstrapPeerPageBuilder.host
private

Definition at line 49 of file BootstrapPeerPageBuilder.cs.

readonly MenuConfiguration Ntp.Analyzer.Page.BootstrapPeerPageBuilder.menu
private

Definition at line 50 of file BootstrapPeerPageBuilder.cs.

readonly PeerPageConfiguration Ntp.Analyzer.Page.BootstrapPeerPageBuilder.page
private

Definition at line 51 of file BootstrapPeerPageBuilder.cs.

readonly Peer Ntp.Analyzer.Page.BootstrapPeerPageBuilder.peer
private

Definition at line 52 of file BootstrapPeerPageBuilder.cs.


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