blob: d4fa89cef2d2e62a6e5316bff612e11639f3d463 [file] [log] [blame]
Chengyu Fan45d1a762014-07-08 14:21:32 -06001<xsl:stylesheet version="1.0"
Chengyu Fan45d1a762014-07-08 14:21:32 -06002xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3xmlns:nfd="ndn:/localhost/nfd/status/1">
Alexander Afanasyev8a093762014-07-16 18:43:09 -07004<xsl:output method="html" encoding="utf-8" indent="yes" />
Chengyu Fan45d1a762014-07-08 14:21:32 -06005
6<xsl:template match="/">
Alexander Afanasyev8a093762014-07-16 18:43:09 -07007 <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text>
Chengyu Fan45d1a762014-07-08 14:21:32 -06008 <html>
9 <head>
10 <title>NFD Status</title>
Alexander Afanasyev8a093762014-07-16 18:43:09 -070011 <link rel="stylesheet" type="text/css" href="style.css" />
Chengyu Fan45d1a762014-07-08 14:21:32 -060012 </head>
13 <body>
Alexander Afanasyev8a093762014-07-16 18:43:09 -070014 <header>
15 <h1>NFD Status</h1>
16 </header>
17 <article>
18 <div id="content">
19 <xsl:apply-templates/>
20 </div>
21 </article>
22 <footer>
23 <xsl:variable name="version">
24 <xsl:apply-templates select="nfd:nfdStatus/nfd:generalStatus/nfd:version"/>
25 </xsl:variable>
Alexander Afanasyevd7bb88b2015-01-26 18:59:29 -080026 <span class="grey">Powered by </span><a target="_blank" href="http://named-data.net/doc/NFD/"><span class="green">NFD version <xsl:value-of select="$version"/></span></a><span class="grey">.</span>
Alexander Afanasyev8a093762014-07-16 18:43:09 -070027 </footer>
Chengyu Fan45d1a762014-07-08 14:21:32 -060028 </body>
29 </html>
30</xsl:template>
31
Alexander Afanasyev8a093762014-07-16 18:43:09 -070032
33<xsl:template name="formatDate">
34 <xsl:param name="date" />
35 <xsl:value-of select="substring($date, 0, 11)"/>&#160;<xsl:value-of select="substring($date, 12, 8)"/>
36</xsl:template>
37
38<xsl:template name="formatDuration">
39 <xsl:param name="duration" />
40 <xsl:variable name="seconds"><xsl:value-of select="substring($duration, 3, string-length($duration)-3)" /></xsl:variable>
Chengyu Fana55663d2014-08-13 20:31:03 -060041 <xsl:variable name="days"><xsl:value-of select="floor($seconds div 86400)" /></xsl:variable>
42 <xsl:variable name="hours"><xsl:value-of select="floor($seconds div 3600)" /></xsl:variable>
43 <xsl:variable name="minutes"><xsl:value-of select="floor($seconds div 60)" /></xsl:variable>
Alexander Afanasyev8a093762014-07-16 18:43:09 -070044 <xsl:choose>
Chengyu Fana55663d2014-08-13 20:31:03 -060045 <xsl:when test="$days = 1">
46 <xsl:value-of select="$days"/> day
47 </xsl:when>
48 <xsl:when test="$days > 1">
Alexander Afanasyev8a093762014-07-16 18:43:09 -070049 <xsl:value-of select="$days"/> days
50 </xsl:when>
Chengyu Fana55663d2014-08-13 20:31:03 -060051 <xsl:when test="$hours = 1">
52 <xsl:value-of select="$hours"/> hour
53 </xsl:when>
54 <xsl:when test="$hours > 1">
Alexander Afanasyev8a093762014-07-16 18:43:09 -070055 <xsl:value-of select="$hours"/> hours
56 </xsl:when>
Chengyu Fana55663d2014-08-13 20:31:03 -060057 <xsl:when test="$minutes = 1">
58 <xsl:value-of select="$minutes"/> minute
59 </xsl:when>
60 <xsl:when test="$minutes > 1">
Alexander Afanasyev8a093762014-07-16 18:43:09 -070061 <xsl:value-of select="$minutes"/> minutes
62 </xsl:when>
Chengyu Fana55663d2014-08-13 20:31:03 -060063 <xsl:when test="$seconds = 1">
64 <xsl:value-of select="$seconds"/> second
65 </xsl:when>
Alexander Afanasyev8a093762014-07-16 18:43:09 -070066 <xsl:otherwise>
67 <xsl:value-of select="$seconds"/> seconds
68 </xsl:otherwise>
69 </xsl:choose>
Alexander Afanasyev8a093762014-07-16 18:43:09 -070070</xsl:template>
71
Chengyu Fan45d1a762014-07-08 14:21:32 -060072<xsl:template match="nfd:generalStatus">
73 <h2>General NFD status</h2>
Alexander Afanasyev8a093762014-07-16 18:43:09 -070074 <table class="item-list">
75 <thead>
76 <tr>
Chengyu Fan8a53caf2014-08-01 14:08:37 -060077 <th>NFD ID</th>
Alexander Afanasyev8a093762014-07-16 18:43:09 -070078 <th>Version</th>
79 <th>Start time</th>
80 <th>Current time</th>
81 <th>Uptime</th>
82 <th>NameTree Entries</th>
83 <th>FIB entries</th>
84 <th>PIT entries</th>
85 <th>Measurements entries</th>
86 <th>CS entries</th>
87 <th>In Interests</th>
88 <th>Out Interests</th>
89 <th>In Data</th>
90 <th>Out Data</th>
91 </tr>
92 </thead>
93 <tbody>
94 <tr class="center">
Chengyu Fan8a53caf2014-08-01 14:08:37 -060095 <td><xsl:apply-templates select="nfd:nfdId"/></td>
Hila Ben Abraham2ef99572014-12-02 02:45:51 -060096 <td><xsl:value-of select="nfd:version"/></td>
Alexander Afanasyev8a093762014-07-16 18:43:09 -070097 <td><xsl:call-template name="formatDate"><xsl:with-param name="date" select="nfd:startTime" /></xsl:call-template></td>
98 <td><xsl:call-template name="formatDate"><xsl:with-param name="date" select="nfd:currentTime" /></xsl:call-template></td>
99 <td><xsl:call-template name="formatDuration"><xsl:with-param name="duration" select="nfd:uptime" /></xsl:call-template></td>
100 <td><xsl:value-of select="nfd:nNameTreeEntries"/></td>
101 <td><xsl:value-of select="nfd:nFibEntries"/></td>
102 <td><xsl:value-of select="nfd:nPitEntries"/></td>
103 <td><xsl:value-of select="nfd:nMeasurementsEntries"/></td>
104 <td><xsl:value-of select="nfd:nCsEntries"/></td>
105 <td><xsl:value-of select="nfd:packetCounters/nfd:incomingPackets/nfd:nInterests"/></td>
106 <td><xsl:value-of select="nfd:packetCounters/nfd:outgoingPackets/nfd:nInterests"/></td>
107 <td><xsl:value-of select="nfd:packetCounters/nfd:incomingPackets/nfd:nDatas"/></td>
108 <td><xsl:value-of select="nfd:packetCounters/nfd:outgoingPackets/nfd:nDatas"/></td>
109 </tr>
110 </tbody>
Chengyu Fan45d1a762014-07-08 14:21:32 -0600111 </table>
112</xsl:template>
113
114<xsl:template match="nfd:channels">
115 <h2>Channels</h2>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700116 <table class="item-list">
117 <thead>
118 <tr>
119 <th>Channel URI</th>
120 </tr>
121 </thead>
122 <tbody>
123 <xsl:for-each select="nfd:channel">
124 <xsl:variable name="style">
125 <xsl:choose>
126 <xsl:when test="position() mod 2 = 1">
127 <xsl:text>odd</xsl:text>
128 </xsl:when>
129 <xsl:otherwise>even</xsl:otherwise>
130 </xsl:choose>
131 </xsl:variable>
132 <tr class="{$style}">
133 <td><xsl:value-of select="nfd:localUri"/></td>
134 </tr>
135 </xsl:for-each>
136 </tbody>
Chengyu Fan45d1a762014-07-08 14:21:32 -0600137 </table>
138</xsl:template>
139
140<xsl:template match="nfd:faces">
141 <h2>Faces</h2>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700142 <table class="item-list">
143 <thead>
144 <tr>
145 <th>Face ID</th>
146 <th>Remote URI</th>
147 <th>Local URI</th>
Chengyu Fan27d570a2014-10-09 11:52:17 -0600148 <th>Scope</th>
149 <th>Persistency</th>
150 <th>LinkType</th>
Chengyu Fan67179642014-08-15 16:00:43 -0600151 <th>Expires in</th>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700152 <th>In Interests</th>
153 <th>In Data</th>
Chengyu Fan3331cfa2014-07-25 17:36:31 -0600154 <th>In Bytes</th>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700155 <th>Out Interests</th>
156 <th>Out Data</th>
Chengyu Fan3331cfa2014-07-25 17:36:31 -0600157 <th>Out Bytes</th>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700158 </tr>
159 </thead>
160 <tbody>
161 <xsl:for-each select="nfd:face">
162 <xsl:variable name="style">
163 <xsl:choose>
164 <xsl:when test="position() mod 2 = 1">
165 <xsl:text>odd</xsl:text>
166 </xsl:when>
167 <xsl:otherwise>even</xsl:otherwise>
168 </xsl:choose>
169 </xsl:variable>
170 <tr class="{$style}">
171 <td><xsl:value-of select="nfd:faceId"/></td>
172 <td><xsl:value-of select="nfd:remoteUri"/></td>
173 <td><xsl:value-of select="nfd:localUri"/></td>
Chengyu Fan27d570a2014-10-09 11:52:17 -0600174 <td><xsl:value-of select="nfd:faceScope"/></td>
175 <td><xsl:value-of select="nfd:facePersistency"/></td>
176 <td><xsl:value-of select="nfd:linkType"/></td>
Chengyu Fan67179642014-08-15 16:00:43 -0600177 <td>
178 <xsl:choose>
179 <xsl:when test="nfd:expirationPeriod">
180 <xsl:call-template name="formatDuration"><xsl:with-param name="duration" select="nfd:expirationPeriod" /></xsl:call-template>
181 </xsl:when>
182 <xsl:otherwise>
183 Never
184 </xsl:otherwise>
185 </xsl:choose>
186 </td>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700187 <td><xsl:value-of select="nfd:packetCounters/nfd:incomingPackets/nfd:nInterests"/></td>
188 <td><xsl:value-of select="nfd:packetCounters/nfd:incomingPackets/nfd:nDatas"/></td>
Chengyu Fan3331cfa2014-07-25 17:36:31 -0600189 <td><xsl:value-of select="nfd:byteCounters/nfd:incomingBytes"/></td>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700190 <td><xsl:value-of select="nfd:packetCounters/nfd:outgoingPackets/nfd:nInterests"/></td>
191 <td><xsl:value-of select="nfd:packetCounters/nfd:outgoingPackets/nfd:nDatas"/></td>
Chengyu Fan3331cfa2014-07-25 17:36:31 -0600192 <td><xsl:value-of select="nfd:byteCounters/nfd:outgoingBytes"/></td>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700193 </tr>
194 </xsl:for-each>
195 </tbody>
Chengyu Fan45d1a762014-07-08 14:21:32 -0600196 </table>
197</xsl:template>
198
199<xsl:template match="nfd:fib">
200 <h2>FIB</h2>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700201 <table class="item-list">
202 <thead>
203 <tr>
Chengyu Fan30aa2072014-07-20 13:52:32 -0600204 <th width="20%">Prefix</th>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700205 <th>NextHops</th>
206 </tr>
207 </thead>
208 <tbody>
209 <xsl:for-each select="nfd:fibEntry">
210 <xsl:variable name="style">
211 <xsl:choose>
212 <xsl:when test="position() mod 2 = 1">
213 <xsl:text>odd</xsl:text>
214 </xsl:when>
215 <xsl:otherwise>even</xsl:otherwise>
216 </xsl:choose>
217 </xsl:variable>
218 <tr class="{$style}">
219 <td style="text-align:left;vertical-align:top;padding:0"><xsl:value-of select="nfd:prefix"/></td>
220 <td>
Chengyu Fan30aa2072014-07-20 13:52:32 -0600221 <table class="item-sublist">
222 <tr>
223 <th>FaceId</th>
224 <xsl:for-each select="nfd:nextHops/nfd:nextHop">
225 <td><xsl:value-of select="nfd:faceId"/></td>
226 </xsl:for-each>
227 </tr>
228 <tr>
229 <th>Cost</th>
230 <xsl:for-each select="nfd:nextHops/nfd:nextHop">
231 <td><xsl:value-of select="nfd:cost"/></td>
232 </xsl:for-each>
233 </tr>
234 </table>
235 </td>
236 </tr>
237 </xsl:for-each>
238 </tbody>
239 </table>
240</xsl:template>
241
242<xsl:template match="nfd:rib">
243 <h2>RIB</h2>
244 <table class="item-list">
245 <thead>
246 <tr>
247 <th width="20%">Prefix</th>
248 <th>Routes</th>
249 </tr>
250 </thead>
251 <tbody>
252 <xsl:for-each select="nfd:ribEntry">
253 <xsl:variable name="style">
254 <xsl:choose>
255 <xsl:when test="position() mod 2 = 1">
256 <xsl:text>odd</xsl:text>
257 </xsl:when>
258 <xsl:otherwise>even</xsl:otherwise>
259 </xsl:choose>
260 </xsl:variable>
261 <tr class="{$style}">
262 <td style="text-align:left;vertical-align:top;padding:0"><xsl:value-of select="nfd:prefix"/></td>
263 <td>
264 <table class="item-sublist">
265 <tr>
266 <th>FaceId</th>
267 <xsl:for-each select="nfd:routes/nfd:route">
268 <td><xsl:value-of select="nfd:faceId"/></td>
269 </xsl:for-each>
270 </tr>
271 <tr>
272 <th>Origin</th>
273 <xsl:for-each select="nfd:routes/nfd:route">
274 <td><xsl:value-of select="nfd:origin"/></td>
275 </xsl:for-each>
276 </tr>
277 <tr>
278 <th>Cost</th>
279 <xsl:for-each select="nfd:routes/nfd:route">
280 <td><xsl:value-of select="nfd:cost"/></td>
281 </xsl:for-each>
282 </tr>
283 <tr>
Chengyu Fan1c630ba2014-08-20 13:27:58 -0500284 <th>ChildInherit</th>
Chengyu Fan30aa2072014-07-20 13:52:32 -0600285 <xsl:for-each select="nfd:routes/nfd:route">
Chengyu Fan1c630ba2014-08-20 13:27:58 -0500286 <td>
287 <xsl:if test="nfd:flags/nfd:childInherit">
288 Y
289 </xsl:if>
290 </td>
291 </xsl:for-each>
292 </tr>
293 <tr>
294 <th>RibCapture</th>
295 <xsl:for-each select="nfd:routes/nfd:route">
296 <td>
297 <xsl:if test="nfd:flags/nfd:ribCapture">
298 Y
299 </xsl:if>
300 </td>
Chengyu Fan30aa2072014-07-20 13:52:32 -0600301 </xsl:for-each>
302 </tr>
303 <tr>
304 <th>Expires in</th>
305 <xsl:for-each select="nfd:routes/nfd:route">
306 <td>
307 <xsl:choose>
308 <xsl:when test="nfd:expirationPeriod">
309 <xsl:call-template name="formatDuration"><xsl:with-param name="duration" select="nfd:expirationPeriod" /></xsl:call-template>
310 </xsl:when>
311 <xsl:otherwise>
312 Never
313 </xsl:otherwise>
314 </xsl:choose>
315 </td>
316 </xsl:for-each>
317 </tr>
318 </table>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700319 </td>
320 </tr>
Chengyu Fan45d1a762014-07-08 14:21:32 -0600321 </xsl:for-each>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700322 </tbody>
Chengyu Fan45d1a762014-07-08 14:21:32 -0600323 </table>
324</xsl:template>
325
326<xsl:template match="nfd:strategyChoices">
327 <h2>Strategy Choices</h2>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700328 <table class="item-list">
329 <thead>
330 <tr>
Chengyu Fan30aa2072014-07-20 13:52:32 -0600331 <th width="20%">Namespace</th>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700332 <th>Strategy Name</th>
333 </tr>
334 </thead>
335 <tbody>
336 <xsl:for-each select="nfd:strategyChoice">
337 <tr>
338 <td><xsl:value-of select="nfd:namespace"/></td>
339 <td><xsl:value-of select="nfd:strategy/nfd:name"/></td>
340 </tr>
341 </xsl:for-each>
342 </tbody>
Chengyu Fan45d1a762014-07-08 14:21:32 -0600343 </table>
344</xsl:template>
345
346</xsl:stylesheet>