23 using System.Collections.Generic;
31 namespace Ntp.Analyzer.Render.Peer
40 IEnumerable<GraphSetConfiguration> graphs)
46 this.graphs =
new List<GraphSetConfiguration>(graphs);
49 private readonly List<GraphSetConfiguration>
graphs;
50 private readonly Objects.Host
host;
52 private readonly Objects.Peer
peer;
56 var builder =
new StringBuilder();
60 Single(p => Equals(p.Host, host) && Equals(p.Peer, peer) && p.IsActive);
62 foreach (var graphSet
in graphs)
64 string open = count == 1 ?
" in" :
string.Empty;
66 builder.AppendLine(
@" <div class=""panel panel-default"">");
67 builder.AppendLine(
@" <div class=""panel-heading"">");
68 builder.AppendLine(
@" <h4 class=""panel-title"">");
71 builder.Append(
@" <a class=""accordion-toggle"" data-toggle=""collapse"" ");
72 builder.Append(
@"data-parent=""#accordion"" href=""#collapse");
73 builder.Append(count);
74 builder.AppendLine(
@""">");
76 builder.AppendLine($
@" {graphSet.Title}");
77 builder.AppendLine(
@" </a>");
78 builder.AppendLine(
@" </h4>");
79 builder.AppendLine(
@" </div>");
82 builder.Append(
@" <div id=""collapse");
83 builder.Append(count);
84 builder.Append($
@""" class=""panel-collapse collapse{open}"">");
86 builder.AppendLine(
@" <div class=""panel-body"">");
88 foreach (var graph
in graphSet.Graphs)
90 builder.Append(
@" <div class=""container theme-graph2"">");
92 if (page?.GraphPages != null && page.GraphPages.Count() != 0)
94 builder.Append(
@"<a href=""");
96 page.GraphPages.First().GetLink(host, activity.Name, graphSet, graph).ToHtmlString());
97 builder.Append(
@""">");
100 builder.Append(
@"<img class=""img-responsive"" src=""");
101 builder.Append(graph.GetLink(graphSet, activity.Name).ToHtmlString());
102 builder.Append(
@""" alt=""");
103 builder.Append(graph.GetAltName(graphSet, activity.Name));
104 builder.Append(
@""">");
106 if (page?.GraphPages != null && page.GraphPages.Count() != 0)
108 builder.Append(
@"</a>");
111 builder.AppendLine(
@"</div>");
114 builder.AppendLine(
@" </div>");
115 builder.AppendLine(
@" </div>");
116 builder.AppendLine(
@" </div>");
121 return builder.ToString();
126 var builder =
new StringBuilder();
128 builder.AppendLine(
@" </div>");
129 builder.AppendLine(
@" </div>");
131 return builder.ToString();
136 var builder =
new StringBuilder();
138 builder.AppendLine(
@" <div class=""container theme-graph"">");
139 builder.AppendLine(
@" <div class=""panel-group"" id=""accordion"">");
141 return builder.ToString();
BootstrapPeerGraphRender(Uri webPath, Objects.Peer peer, Objects.Host host, PeerPageConfiguration page, IEnumerable< GraphSetConfiguration > graphs)
readonly List< GraphSetConfiguration > graphs
readonly Objects.Peer peer
readonly PeerPageConfiguration page
Singleton facade class used to access memory persistent data.
PeerActivityDatabaseMapper PeerActivities
Gets the peer activity mapper.
override string RenderHead()
readonly Objects.Host host
static DataFace Instance
Gets the Singleton instance.
override string RenderFooter()