blob: 843e4f27a970f0363c98c9a65d6946a33b40e9b2 [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">
Joao Pereira4e274ac2015-07-23 11:54:20 -04004<xsl:output method="html" encoding="utf-8" indent="yes" doctype-system="about:legacy-compat"/>
Chengyu Fan45d1a762014-07-08 14:21:32 -06005
6<xsl:template match="/">
7 <html>
8 <head>
9 <title>NFD Status</title>
Alexander Afanasyev8a093762014-07-16 18:43:09 -070010 <link rel="stylesheet" type="text/css" href="style.css" />
Chengyu Fan45d1a762014-07-08 14:21:32 -060011 </head>
12 <body>
Alexander Afanasyev8a093762014-07-16 18:43:09 -070013 <header>
14 <h1>NFD Status</h1>
15 </header>
16 <article>
17 <div id="content">
18 <xsl:apply-templates/>
19 </div>
20 </article>
21 <footer>
22 <xsl:variable name="version">
23 <xsl:apply-templates select="nfd:nfdStatus/nfd:generalStatus/nfd:version"/>
24 </xsl:variable>
Alexander Afanasyev01bbd092017-08-14 23:56:19 +000025 <span class="grey">Powered by </span><a target="_blank" href="https://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 -070026 </footer>
Chengyu Fan45d1a762014-07-08 14:21:32 -060027 </body>
28 </html>
29</xsl:template>
30
Alexander Afanasyev8a093762014-07-16 18:43:09 -070031
32<xsl:template name="formatDate">
33 <xsl:param name="date" />
34 <xsl:value-of select="substring($date, 0, 11)"/>&#160;<xsl:value-of select="substring($date, 12, 8)"/>
35</xsl:template>
36
37<xsl:template name="formatDuration">
38 <xsl:param name="duration" />
39 <xsl:variable name="seconds"><xsl:value-of select="substring($duration, 3, string-length($duration)-3)" /></xsl:variable>
Chengyu Fana55663d2014-08-13 20:31:03 -060040 <xsl:variable name="days"><xsl:value-of select="floor($seconds div 86400)" /></xsl:variable>
41 <xsl:variable name="hours"><xsl:value-of select="floor($seconds div 3600)" /></xsl:variable>
42 <xsl:variable name="minutes"><xsl:value-of select="floor($seconds div 60)" /></xsl:variable>
Alexander Afanasyev8a093762014-07-16 18:43:09 -070043 <xsl:choose>
Chengyu Fana55663d2014-08-13 20:31:03 -060044 <xsl:when test="$days = 1">
45 <xsl:value-of select="$days"/> day
46 </xsl:when>
47 <xsl:when test="$days > 1">
Alexander Afanasyev8a093762014-07-16 18:43:09 -070048 <xsl:value-of select="$days"/> days
49 </xsl:when>
Chengyu Fana55663d2014-08-13 20:31:03 -060050 <xsl:when test="$hours = 1">
51 <xsl:value-of select="$hours"/> hour
52 </xsl:when>
53 <xsl:when test="$hours > 1">
Alexander Afanasyev8a093762014-07-16 18:43:09 -070054 <xsl:value-of select="$hours"/> hours
55 </xsl:when>
Chengyu Fana55663d2014-08-13 20:31:03 -060056 <xsl:when test="$minutes = 1">
57 <xsl:value-of select="$minutes"/> minute
58 </xsl:when>
59 <xsl:when test="$minutes > 1">
Alexander Afanasyev8a093762014-07-16 18:43:09 -070060 <xsl:value-of select="$minutes"/> minutes
61 </xsl:when>
Chengyu Fana55663d2014-08-13 20:31:03 -060062 <xsl:when test="$seconds = 1">
63 <xsl:value-of select="$seconds"/> second
64 </xsl:when>
Alexander Afanasyev8a093762014-07-16 18:43:09 -070065 <xsl:otherwise>
66 <xsl:value-of select="$seconds"/> seconds
67 </xsl:otherwise>
68 </xsl:choose>
Alexander Afanasyev8a093762014-07-16 18:43:09 -070069</xsl:template>
70
Chengyu Fan45d1a762014-07-08 14:21:32 -060071<xsl:template match="nfd:generalStatus">
72 <h2>General NFD status</h2>
Alexander Afanasyev8a093762014-07-16 18:43:09 -070073 <table class="item-list">
74 <thead>
75 <tr>
76 <th>Version</th>
77 <th>Start time</th>
78 <th>Current time</th>
79 <th>Uptime</th>
80 <th>NameTree Entries</th>
81 <th>FIB entries</th>
82 <th>PIT entries</th>
83 <th>Measurements entries</th>
84 <th>CS entries</th>
85 <th>In Interests</th>
86 <th>Out Interests</th>
87 <th>In Data</th>
88 <th>Out Data</th>
Weiwei Liuace83ac2016-04-25 10:16:37 -070089 <th>In Nacks</th>
90 <th>Out Nacks</th>
Alexander Afanasyev8a093762014-07-16 18:43:09 -070091 </tr>
92 </thead>
93 <tbody>
94 <tr class="center">
Hila Ben Abraham2ef99572014-12-02 02:45:51 -060095 <td><xsl:value-of select="nfd:version"/></td>
Alexander Afanasyev8a093762014-07-16 18:43:09 -070096 <td><xsl:call-template name="formatDate"><xsl:with-param name="date" select="nfd:startTime" /></xsl:call-template></td>
97 <td><xsl:call-template name="formatDate"><xsl:with-param name="date" select="nfd:currentTime" /></xsl:call-template></td>
98 <td><xsl:call-template name="formatDuration"><xsl:with-param name="duration" select="nfd:uptime" /></xsl:call-template></td>
99 <td><xsl:value-of select="nfd:nNameTreeEntries"/></td>
100 <td><xsl:value-of select="nfd:nFibEntries"/></td>
101 <td><xsl:value-of select="nfd:nPitEntries"/></td>
102 <td><xsl:value-of select="nfd:nMeasurementsEntries"/></td>
103 <td><xsl:value-of select="nfd:nCsEntries"/></td>
104 <td><xsl:value-of select="nfd:packetCounters/nfd:incomingPackets/nfd:nInterests"/></td>
105 <td><xsl:value-of select="nfd:packetCounters/nfd:outgoingPackets/nfd:nInterests"/></td>
Junxiao Shif03d4792017-04-06 16:41:22 +0000106 <td><xsl:value-of select="nfd:packetCounters/nfd:incomingPackets/nfd:nData"/></td>
107 <td><xsl:value-of select="nfd:packetCounters/nfd:outgoingPackets/nfd:nData"/></td>
Weiwei Liuace83ac2016-04-25 10:16:37 -0700108 <td><xsl:value-of select="nfd:packetCounters/nfd:incomingPackets/nfd:nNacks"/></td>
109 <td><xsl:value-of select="nfd:packetCounters/nfd:outgoingPackets/nfd:nNacks"/></td>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700110 </tr>
111 </tbody>
Chengyu Fan45d1a762014-07-08 14:21:32 -0600112 </table>
113</xsl:template>
114
115<xsl:template match="nfd:channels">
116 <h2>Channels</h2>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700117 <table class="item-list">
118 <thead>
119 <tr>
120 <th>Channel URI</th>
121 </tr>
122 </thead>
123 <tbody>
124 <xsl:for-each select="nfd:channel">
125 <xsl:variable name="style">
126 <xsl:choose>
127 <xsl:when test="position() mod 2 = 1">
128 <xsl:text>odd</xsl:text>
129 </xsl:when>
130 <xsl:otherwise>even</xsl:otherwise>
131 </xsl:choose>
132 </xsl:variable>
133 <tr class="{$style}">
134 <td><xsl:value-of select="nfd:localUri"/></td>
135 </tr>
136 </xsl:for-each>
137 </tbody>
Chengyu Fan45d1a762014-07-08 14:21:32 -0600138 </table>
139</xsl:template>
140
141<xsl:template match="nfd:faces">
142 <h2>Faces</h2>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700143 <table class="item-list">
144 <thead>
145 <tr>
146 <th>Face ID</th>
147 <th>Remote URI</th>
148 <th>Local URI</th>
Chengyu Fan27d570a2014-10-09 11:52:17 -0600149 <th>Scope</th>
150 <th>Persistency</th>
151 <th>LinkType</th>
Eric Newberry6d932e82016-11-24 05:05:43 +0000152 <th>Flags</th>
Chengyu Fan67179642014-08-15 16:00:43 -0600153 <th>Expires in</th>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700154 <th>In Interests</th>
155 <th>In Data</th>
Weiwei Liuace83ac2016-04-25 10:16:37 -0700156 <th>In Nacks</th>
Chengyu Fan3331cfa2014-07-25 17:36:31 -0600157 <th>In Bytes</th>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700158 <th>Out Interests</th>
159 <th>Out Data</th>
Weiwei Liuace83ac2016-04-25 10:16:37 -0700160 <th>Out Nacks</th>
Chengyu Fan3331cfa2014-07-25 17:36:31 -0600161 <th>Out Bytes</th>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700162 </tr>
163 </thead>
164 <tbody>
165 <xsl:for-each select="nfd:face">
166 <xsl:variable name="style">
167 <xsl:choose>
168 <xsl:when test="position() mod 2 = 1">
169 <xsl:text>odd</xsl:text>
170 </xsl:when>
171 <xsl:otherwise>even</xsl:otherwise>
172 </xsl:choose>
173 </xsl:variable>
174 <tr class="{$style}">
175 <td><xsl:value-of select="nfd:faceId"/></td>
176 <td><xsl:value-of select="nfd:remoteUri"/></td>
177 <td><xsl:value-of select="nfd:localUri"/></td>
Chengyu Fan27d570a2014-10-09 11:52:17 -0600178 <td><xsl:value-of select="nfd:faceScope"/></td>
179 <td><xsl:value-of select="nfd:facePersistency"/></td>
180 <td><xsl:value-of select="nfd:linkType"/></td>
Chengyu Fan67179642014-08-15 16:00:43 -0600181 <td>
182 <xsl:choose>
Eric Newberry6d932e82016-11-24 05:05:43 +0000183 <xsl:when test="nfd:flags/nfd:localFieldsEnabled">
184 local-fields
185 </xsl:when>
186 </xsl:choose>
187 </td>
188 <td>
189 <xsl:choose>
Chengyu Fan67179642014-08-15 16:00:43 -0600190 <xsl:when test="nfd:expirationPeriod">
191 <xsl:call-template name="formatDuration"><xsl:with-param name="duration" select="nfd:expirationPeriod" /></xsl:call-template>
192 </xsl:when>
193 <xsl:otherwise>
194 Never
195 </xsl:otherwise>
196 </xsl:choose>
197 </td>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700198 <td><xsl:value-of select="nfd:packetCounters/nfd:incomingPackets/nfd:nInterests"/></td>
Junxiao Shif03d4792017-04-06 16:41:22 +0000199 <td><xsl:value-of select="nfd:packetCounters/nfd:incomingPackets/nfd:nData"/></td>
Weiwei Liuace83ac2016-04-25 10:16:37 -0700200 <td><xsl:value-of select="nfd:packetCounters/nfd:incomingPackets/nfd:nNacks"/></td>
Chengyu Fan3331cfa2014-07-25 17:36:31 -0600201 <td><xsl:value-of select="nfd:byteCounters/nfd:incomingBytes"/></td>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700202 <td><xsl:value-of select="nfd:packetCounters/nfd:outgoingPackets/nfd:nInterests"/></td>
Junxiao Shif03d4792017-04-06 16:41:22 +0000203 <td><xsl:value-of select="nfd:packetCounters/nfd:outgoingPackets/nfd:nData"/></td>
Weiwei Liuace83ac2016-04-25 10:16:37 -0700204 <td><xsl:value-of select="nfd:packetCounters/nfd:outgoingPackets/nfd:nNacks"/></td>
Chengyu Fan3331cfa2014-07-25 17:36:31 -0600205 <td><xsl:value-of select="nfd:byteCounters/nfd:outgoingBytes"/></td>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700206 </tr>
207 </xsl:for-each>
208 </tbody>
Chengyu Fan45d1a762014-07-08 14:21:32 -0600209 </table>
210</xsl:template>
211
212<xsl:template match="nfd:fib">
213 <h2>FIB</h2>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700214 <table class="item-list">
215 <thead>
216 <tr>
Chengyu Fan30aa2072014-07-20 13:52:32 -0600217 <th width="20%">Prefix</th>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700218 <th>NextHops</th>
219 </tr>
220 </thead>
221 <tbody>
222 <xsl:for-each select="nfd:fibEntry">
223 <xsl:variable name="style">
224 <xsl:choose>
225 <xsl:when test="position() mod 2 = 1">
226 <xsl:text>odd</xsl:text>
227 </xsl:when>
228 <xsl:otherwise>even</xsl:otherwise>
229 </xsl:choose>
230 </xsl:variable>
231 <tr class="{$style}">
232 <td style="text-align:left;vertical-align:top;padding:0"><xsl:value-of select="nfd:prefix"/></td>
233 <td>
Chengyu Fan30aa2072014-07-20 13:52:32 -0600234 <table class="item-sublist">
235 <tr>
236 <th>FaceId</th>
237 <xsl:for-each select="nfd:nextHops/nfd:nextHop">
238 <td><xsl:value-of select="nfd:faceId"/></td>
239 </xsl:for-each>
240 </tr>
241 <tr>
242 <th>Cost</th>
243 <xsl:for-each select="nfd:nextHops/nfd:nextHop">
244 <td><xsl:value-of select="nfd:cost"/></td>
245 </xsl:for-each>
246 </tr>
247 </table>
248 </td>
249 </tr>
250 </xsl:for-each>
251 </tbody>
252 </table>
253</xsl:template>
254
255<xsl:template match="nfd:rib">
256 <h2>RIB</h2>
257 <table class="item-list">
258 <thead>
259 <tr>
260 <th width="20%">Prefix</th>
261 <th>Routes</th>
262 </tr>
263 </thead>
264 <tbody>
265 <xsl:for-each select="nfd:ribEntry">
266 <xsl:variable name="style">
267 <xsl:choose>
268 <xsl:when test="position() mod 2 = 1">
269 <xsl:text>odd</xsl:text>
270 </xsl:when>
271 <xsl:otherwise>even</xsl:otherwise>
272 </xsl:choose>
273 </xsl:variable>
274 <tr class="{$style}">
275 <td style="text-align:left;vertical-align:top;padding:0"><xsl:value-of select="nfd:prefix"/></td>
276 <td>
277 <table class="item-sublist">
278 <tr>
279 <th>FaceId</th>
280 <xsl:for-each select="nfd:routes/nfd:route">
281 <td><xsl:value-of select="nfd:faceId"/></td>
282 </xsl:for-each>
283 </tr>
284 <tr>
285 <th>Origin</th>
286 <xsl:for-each select="nfd:routes/nfd:route">
287 <td><xsl:value-of select="nfd:origin"/></td>
288 </xsl:for-each>
289 </tr>
290 <tr>
291 <th>Cost</th>
292 <xsl:for-each select="nfd:routes/nfd:route">
293 <td><xsl:value-of select="nfd:cost"/></td>
294 </xsl:for-each>
295 </tr>
296 <tr>
Chengyu Fan1c630ba2014-08-20 13:27:58 -0500297 <th>ChildInherit</th>
Chengyu Fan30aa2072014-07-20 13:52:32 -0600298 <xsl:for-each select="nfd:routes/nfd:route">
Chengyu Fan1c630ba2014-08-20 13:27:58 -0500299 <td>
300 <xsl:if test="nfd:flags/nfd:childInherit">
301 Y
302 </xsl:if>
303 </td>
304 </xsl:for-each>
305 </tr>
306 <tr>
307 <th>RibCapture</th>
308 <xsl:for-each select="nfd:routes/nfd:route">
309 <td>
310 <xsl:if test="nfd:flags/nfd:ribCapture">
311 Y
312 </xsl:if>
313 </td>
Chengyu Fan30aa2072014-07-20 13:52:32 -0600314 </xsl:for-each>
315 </tr>
316 <tr>
317 <th>Expires in</th>
318 <xsl:for-each select="nfd:routes/nfd:route">
319 <td>
320 <xsl:choose>
321 <xsl:when test="nfd:expirationPeriod">
322 <xsl:call-template name="formatDuration"><xsl:with-param name="duration" select="nfd:expirationPeriod" /></xsl:call-template>
323 </xsl:when>
324 <xsl:otherwise>
325 Never
326 </xsl:otherwise>
327 </xsl:choose>
328 </td>
329 </xsl:for-each>
330 </tr>
331 </table>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700332 </td>
333 </tr>
Chengyu Fan45d1a762014-07-08 14:21:32 -0600334 </xsl:for-each>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700335 </tbody>
Chengyu Fan45d1a762014-07-08 14:21:32 -0600336 </table>
337</xsl:template>
338
339<xsl:template match="nfd:strategyChoices">
340 <h2>Strategy Choices</h2>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700341 <table class="item-list">
342 <thead>
343 <tr>
Chengyu Fan30aa2072014-07-20 13:52:32 -0600344 <th width="20%">Namespace</th>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700345 <th>Strategy Name</th>
346 </tr>
347 </thead>
348 <tbody>
349 <xsl:for-each select="nfd:strategyChoice">
350 <tr>
351 <td><xsl:value-of select="nfd:namespace"/></td>
352 <td><xsl:value-of select="nfd:strategy/nfd:name"/></td>
353 </tr>
354 </xsl:for-each>
355 </tbody>
Chengyu Fan45d1a762014-07-08 14:21:32 -0600356 </table>
357</xsl:template>
358
359</xsl:stylesheet>