blob: f8ba4c825e2f899b149c3b5aff0884a408b60a9f [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 Afanasyevd7bb88b2015-01-26 18:59:29 -080025 <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 -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>
Chengyu Fan8a53caf2014-08-01 14:08:37 -060076 <th>NFD ID</th>
Alexander Afanasyev8a093762014-07-16 18:43:09 -070077 <th>Version</th>
78 <th>Start time</th>
79 <th>Current time</th>
80 <th>Uptime</th>
81 <th>NameTree Entries</th>
82 <th>FIB entries</th>
83 <th>PIT entries</th>
84 <th>Measurements entries</th>
85 <th>CS entries</th>
86 <th>In Interests</th>
87 <th>Out Interests</th>
88 <th>In Data</th>
89 <th>Out Data</th>
Weiwei Liuace83ac2016-04-25 10:16:37 -070090 <th>In Nacks</th>
91 <th>Out Nacks</th>
Alexander Afanasyev8a093762014-07-16 18:43:09 -070092 </tr>
93 </thead>
94 <tbody>
95 <tr class="center">
Chengyu Fan8a53caf2014-08-01 14:08:37 -060096 <td><xsl:apply-templates select="nfd:nfdId"/></td>
Hila Ben Abraham2ef99572014-12-02 02:45:51 -060097 <td><xsl:value-of select="nfd:version"/></td>
Alexander Afanasyev8a093762014-07-16 18:43:09 -070098 <td><xsl:call-template name="formatDate"><xsl:with-param name="date" select="nfd:startTime" /></xsl:call-template></td>
99 <td><xsl:call-template name="formatDate"><xsl:with-param name="date" select="nfd:currentTime" /></xsl:call-template></td>
100 <td><xsl:call-template name="formatDuration"><xsl:with-param name="duration" select="nfd:uptime" /></xsl:call-template></td>
101 <td><xsl:value-of select="nfd:nNameTreeEntries"/></td>
102 <td><xsl:value-of select="nfd:nFibEntries"/></td>
103 <td><xsl:value-of select="nfd:nPitEntries"/></td>
104 <td><xsl:value-of select="nfd:nMeasurementsEntries"/></td>
105 <td><xsl:value-of select="nfd:nCsEntries"/></td>
106 <td><xsl:value-of select="nfd:packetCounters/nfd:incomingPackets/nfd:nInterests"/></td>
107 <td><xsl:value-of select="nfd:packetCounters/nfd:outgoingPackets/nfd:nInterests"/></td>
108 <td><xsl:value-of select="nfd:packetCounters/nfd:incomingPackets/nfd:nDatas"/></td>
109 <td><xsl:value-of select="nfd:packetCounters/nfd:outgoingPackets/nfd:nDatas"/></td>
Weiwei Liuace83ac2016-04-25 10:16:37 -0700110 <td><xsl:value-of select="nfd:packetCounters/nfd:incomingPackets/nfd:nNacks"/></td>
111 <td><xsl:value-of select="nfd:packetCounters/nfd:outgoingPackets/nfd:nNacks"/></td>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700112 </tr>
113 </tbody>
Chengyu Fan45d1a762014-07-08 14:21:32 -0600114 </table>
115</xsl:template>
116
117<xsl:template match="nfd:channels">
118 <h2>Channels</h2>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700119 <table class="item-list">
120 <thead>
121 <tr>
122 <th>Channel URI</th>
123 </tr>
124 </thead>
125 <tbody>
126 <xsl:for-each select="nfd:channel">
127 <xsl:variable name="style">
128 <xsl:choose>
129 <xsl:when test="position() mod 2 = 1">
130 <xsl:text>odd</xsl:text>
131 </xsl:when>
132 <xsl:otherwise>even</xsl:otherwise>
133 </xsl:choose>
134 </xsl:variable>
135 <tr class="{$style}">
136 <td><xsl:value-of select="nfd:localUri"/></td>
137 </tr>
138 </xsl:for-each>
139 </tbody>
Chengyu Fan45d1a762014-07-08 14:21:32 -0600140 </table>
141</xsl:template>
142
143<xsl:template match="nfd:faces">
144 <h2>Faces</h2>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700145 <table class="item-list">
146 <thead>
147 <tr>
148 <th>Face ID</th>
149 <th>Remote URI</th>
150 <th>Local URI</th>
Chengyu Fan27d570a2014-10-09 11:52:17 -0600151 <th>Scope</th>
152 <th>Persistency</th>
153 <th>LinkType</th>
Chengyu Fan67179642014-08-15 16:00:43 -0600154 <th>Expires in</th>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700155 <th>In Interests</th>
156 <th>In Data</th>
Weiwei Liuace83ac2016-04-25 10:16:37 -0700157 <th>In Nacks</th>
Chengyu Fan3331cfa2014-07-25 17:36:31 -0600158 <th>In Bytes</th>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700159 <th>Out Interests</th>
160 <th>Out Data</th>
Weiwei Liuace83ac2016-04-25 10:16:37 -0700161 <th>Out Nacks</th>
Chengyu Fan3331cfa2014-07-25 17:36:31 -0600162 <th>Out Bytes</th>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700163 </tr>
164 </thead>
165 <tbody>
166 <xsl:for-each select="nfd:face">
167 <xsl:variable name="style">
168 <xsl:choose>
169 <xsl:when test="position() mod 2 = 1">
170 <xsl:text>odd</xsl:text>
171 </xsl:when>
172 <xsl:otherwise>even</xsl:otherwise>
173 </xsl:choose>
174 </xsl:variable>
175 <tr class="{$style}">
176 <td><xsl:value-of select="nfd:faceId"/></td>
177 <td><xsl:value-of select="nfd:remoteUri"/></td>
178 <td><xsl:value-of select="nfd:localUri"/></td>
Chengyu Fan27d570a2014-10-09 11:52:17 -0600179 <td><xsl:value-of select="nfd:faceScope"/></td>
180 <td><xsl:value-of select="nfd:facePersistency"/></td>
181 <td><xsl:value-of select="nfd:linkType"/></td>
Chengyu Fan67179642014-08-15 16:00:43 -0600182 <td>
183 <xsl:choose>
184 <xsl:when test="nfd:expirationPeriod">
185 <xsl:call-template name="formatDuration"><xsl:with-param name="duration" select="nfd:expirationPeriod" /></xsl:call-template>
186 </xsl:when>
187 <xsl:otherwise>
188 Never
189 </xsl:otherwise>
190 </xsl:choose>
191 </td>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700192 <td><xsl:value-of select="nfd:packetCounters/nfd:incomingPackets/nfd:nInterests"/></td>
193 <td><xsl:value-of select="nfd:packetCounters/nfd:incomingPackets/nfd:nDatas"/></td>
Weiwei Liuace83ac2016-04-25 10:16:37 -0700194 <td><xsl:value-of select="nfd:packetCounters/nfd:incomingPackets/nfd:nNacks"/></td>
Chengyu Fan3331cfa2014-07-25 17:36:31 -0600195 <td><xsl:value-of select="nfd:byteCounters/nfd:incomingBytes"/></td>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700196 <td><xsl:value-of select="nfd:packetCounters/nfd:outgoingPackets/nfd:nInterests"/></td>
197 <td><xsl:value-of select="nfd:packetCounters/nfd:outgoingPackets/nfd:nDatas"/></td>
Weiwei Liuace83ac2016-04-25 10:16:37 -0700198 <td><xsl:value-of select="nfd:packetCounters/nfd:outgoingPackets/nfd:nNacks"/></td>
Chengyu Fan3331cfa2014-07-25 17:36:31 -0600199 <td><xsl:value-of select="nfd:byteCounters/nfd:outgoingBytes"/></td>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700200 </tr>
201 </xsl:for-each>
202 </tbody>
Chengyu Fan45d1a762014-07-08 14:21:32 -0600203 </table>
204</xsl:template>
205
206<xsl:template match="nfd:fib">
207 <h2>FIB</h2>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700208 <table class="item-list">
209 <thead>
210 <tr>
Chengyu Fan30aa2072014-07-20 13:52:32 -0600211 <th width="20%">Prefix</th>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700212 <th>NextHops</th>
213 </tr>
214 </thead>
215 <tbody>
216 <xsl:for-each select="nfd:fibEntry">
217 <xsl:variable name="style">
218 <xsl:choose>
219 <xsl:when test="position() mod 2 = 1">
220 <xsl:text>odd</xsl:text>
221 </xsl:when>
222 <xsl:otherwise>even</xsl:otherwise>
223 </xsl:choose>
224 </xsl:variable>
225 <tr class="{$style}">
226 <td style="text-align:left;vertical-align:top;padding:0"><xsl:value-of select="nfd:prefix"/></td>
227 <td>
Chengyu Fan30aa2072014-07-20 13:52:32 -0600228 <table class="item-sublist">
229 <tr>
230 <th>FaceId</th>
231 <xsl:for-each select="nfd:nextHops/nfd:nextHop">
232 <td><xsl:value-of select="nfd:faceId"/></td>
233 </xsl:for-each>
234 </tr>
235 <tr>
236 <th>Cost</th>
237 <xsl:for-each select="nfd:nextHops/nfd:nextHop">
238 <td><xsl:value-of select="nfd:cost"/></td>
239 </xsl:for-each>
240 </tr>
241 </table>
242 </td>
243 </tr>
244 </xsl:for-each>
245 </tbody>
246 </table>
247</xsl:template>
248
249<xsl:template match="nfd:rib">
250 <h2>RIB</h2>
251 <table class="item-list">
252 <thead>
253 <tr>
254 <th width="20%">Prefix</th>
255 <th>Routes</th>
256 </tr>
257 </thead>
258 <tbody>
259 <xsl:for-each select="nfd:ribEntry">
260 <xsl:variable name="style">
261 <xsl:choose>
262 <xsl:when test="position() mod 2 = 1">
263 <xsl:text>odd</xsl:text>
264 </xsl:when>
265 <xsl:otherwise>even</xsl:otherwise>
266 </xsl:choose>
267 </xsl:variable>
268 <tr class="{$style}">
269 <td style="text-align:left;vertical-align:top;padding:0"><xsl:value-of select="nfd:prefix"/></td>
270 <td>
271 <table class="item-sublist">
272 <tr>
273 <th>FaceId</th>
274 <xsl:for-each select="nfd:routes/nfd:route">
275 <td><xsl:value-of select="nfd:faceId"/></td>
276 </xsl:for-each>
277 </tr>
278 <tr>
279 <th>Origin</th>
280 <xsl:for-each select="nfd:routes/nfd:route">
281 <td><xsl:value-of select="nfd:origin"/></td>
282 </xsl:for-each>
283 </tr>
284 <tr>
285 <th>Cost</th>
286 <xsl:for-each select="nfd:routes/nfd:route">
287 <td><xsl:value-of select="nfd:cost"/></td>
288 </xsl:for-each>
289 </tr>
290 <tr>
Chengyu Fan1c630ba2014-08-20 13:27:58 -0500291 <th>ChildInherit</th>
Chengyu Fan30aa2072014-07-20 13:52:32 -0600292 <xsl:for-each select="nfd:routes/nfd:route">
Chengyu Fan1c630ba2014-08-20 13:27:58 -0500293 <td>
294 <xsl:if test="nfd:flags/nfd:childInherit">
295 Y
296 </xsl:if>
297 </td>
298 </xsl:for-each>
299 </tr>
300 <tr>
301 <th>RibCapture</th>
302 <xsl:for-each select="nfd:routes/nfd:route">
303 <td>
304 <xsl:if test="nfd:flags/nfd:ribCapture">
305 Y
306 </xsl:if>
307 </td>
Chengyu Fan30aa2072014-07-20 13:52:32 -0600308 </xsl:for-each>
309 </tr>
310 <tr>
311 <th>Expires in</th>
312 <xsl:for-each select="nfd:routes/nfd:route">
313 <td>
314 <xsl:choose>
315 <xsl:when test="nfd:expirationPeriod">
316 <xsl:call-template name="formatDuration"><xsl:with-param name="duration" select="nfd:expirationPeriod" /></xsl:call-template>
317 </xsl:when>
318 <xsl:otherwise>
319 Never
320 </xsl:otherwise>
321 </xsl:choose>
322 </td>
323 </xsl:for-each>
324 </tr>
325 </table>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700326 </td>
327 </tr>
Chengyu Fan45d1a762014-07-08 14:21:32 -0600328 </xsl:for-each>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700329 </tbody>
Chengyu Fan45d1a762014-07-08 14:21:32 -0600330 </table>
331</xsl:template>
332
333<xsl:template match="nfd:strategyChoices">
334 <h2>Strategy Choices</h2>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700335 <table class="item-list">
336 <thead>
337 <tr>
Chengyu Fan30aa2072014-07-20 13:52:32 -0600338 <th width="20%">Namespace</th>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700339 <th>Strategy Name</th>
340 </tr>
341 </thead>
342 <tbody>
343 <xsl:for-each select="nfd:strategyChoice">
344 <tr>
345 <td><xsl:value-of select="nfd:namespace"/></td>
346 <td><xsl:value-of select="nfd:strategy/nfd:name"/></td>
347 </tr>
348 </xsl:for-each>
349 </tbody>
Chengyu Fan45d1a762014-07-08 14:21:32 -0600350 </table>
351</xsl:template>
352
353</xsl:stylesheet>