Chengyu Fan | 45d1a76 | 2014-07-08 14:21:32 -0600 | [diff] [blame] | 1 | <xsl:stylesheet version="1.0" |
Chengyu Fan | 45d1a76 | 2014-07-08 14:21:32 -0600 | [diff] [blame] | 2 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
| 3 | xmlns:nfd="ndn:/localhost/nfd/status/1"> |
Alexander Afanasyev | 8a09376 | 2014-07-16 18:43:09 -0700 | [diff] [blame] | 4 | <xsl:output method="html" encoding="utf-8" indent="yes" /> |
Chengyu Fan | 45d1a76 | 2014-07-08 14:21:32 -0600 | [diff] [blame] | 5 | |
| 6 | <xsl:template match="/"> |
Alexander Afanasyev | 8a09376 | 2014-07-16 18:43:09 -0700 | [diff] [blame] | 7 | <xsl:text disable-output-escaping='yes'><!DOCTYPE html></xsl:text> |
Chengyu Fan | 45d1a76 | 2014-07-08 14:21:32 -0600 | [diff] [blame] | 8 | <html> |
| 9 | <head> |
| 10 | <title>NFD Status</title> |
Alexander Afanasyev | 8a09376 | 2014-07-16 18:43:09 -0700 | [diff] [blame] | 11 | <link rel="stylesheet" type="text/css" href="style.css" /> |
Chengyu Fan | 45d1a76 | 2014-07-08 14:21:32 -0600 | [diff] [blame] | 12 | </head> |
| 13 | <body> |
Alexander Afanasyev | 8a09376 | 2014-07-16 18:43:09 -0700 | [diff] [blame] | 14 | <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 Afanasyev | d7bb88b | 2015-01-26 18:59:29 -0800 | [diff] [blame^] | 26 | <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 Afanasyev | 8a09376 | 2014-07-16 18:43:09 -0700 | [diff] [blame] | 27 | </footer> |
Chengyu Fan | 45d1a76 | 2014-07-08 14:21:32 -0600 | [diff] [blame] | 28 | </body> |
| 29 | </html> |
| 30 | </xsl:template> |
| 31 | |
Alexander Afanasyev | 8a09376 | 2014-07-16 18:43:09 -0700 | [diff] [blame] | 32 | |
| 33 | <xsl:template name="formatDate"> |
| 34 | <xsl:param name="date" /> |
| 35 | <xsl:value-of select="substring($date, 0, 11)"/> <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 Fan | a55663d | 2014-08-13 20:31:03 -0600 | [diff] [blame] | 41 | <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 Afanasyev | 8a09376 | 2014-07-16 18:43:09 -0700 | [diff] [blame] | 44 | <xsl:choose> |
Chengyu Fan | a55663d | 2014-08-13 20:31:03 -0600 | [diff] [blame] | 45 | <xsl:when test="$days = 1"> |
| 46 | <xsl:value-of select="$days"/> day |
| 47 | </xsl:when> |
| 48 | <xsl:when test="$days > 1"> |
Alexander Afanasyev | 8a09376 | 2014-07-16 18:43:09 -0700 | [diff] [blame] | 49 | <xsl:value-of select="$days"/> days |
| 50 | </xsl:when> |
Chengyu Fan | a55663d | 2014-08-13 20:31:03 -0600 | [diff] [blame] | 51 | <xsl:when test="$hours = 1"> |
| 52 | <xsl:value-of select="$hours"/> hour |
| 53 | </xsl:when> |
| 54 | <xsl:when test="$hours > 1"> |
Alexander Afanasyev | 8a09376 | 2014-07-16 18:43:09 -0700 | [diff] [blame] | 55 | <xsl:value-of select="$hours"/> hours |
| 56 | </xsl:when> |
Chengyu Fan | a55663d | 2014-08-13 20:31:03 -0600 | [diff] [blame] | 57 | <xsl:when test="$minutes = 1"> |
| 58 | <xsl:value-of select="$minutes"/> minute |
| 59 | </xsl:when> |
| 60 | <xsl:when test="$minutes > 1"> |
Alexander Afanasyev | 8a09376 | 2014-07-16 18:43:09 -0700 | [diff] [blame] | 61 | <xsl:value-of select="$minutes"/> minutes |
| 62 | </xsl:when> |
Chengyu Fan | a55663d | 2014-08-13 20:31:03 -0600 | [diff] [blame] | 63 | <xsl:when test="$seconds = 1"> |
| 64 | <xsl:value-of select="$seconds"/> second |
| 65 | </xsl:when> |
Alexander Afanasyev | 8a09376 | 2014-07-16 18:43:09 -0700 | [diff] [blame] | 66 | <xsl:otherwise> |
| 67 | <xsl:value-of select="$seconds"/> seconds |
| 68 | </xsl:otherwise> |
| 69 | </xsl:choose> |
Alexander Afanasyev | 8a09376 | 2014-07-16 18:43:09 -0700 | [diff] [blame] | 70 | </xsl:template> |
| 71 | |
Chengyu Fan | 45d1a76 | 2014-07-08 14:21:32 -0600 | [diff] [blame] | 72 | <xsl:template match="nfd:generalStatus"> |
| 73 | <h2>General NFD status</h2> |
Alexander Afanasyev | 8a09376 | 2014-07-16 18:43:09 -0700 | [diff] [blame] | 74 | <table class="item-list"> |
| 75 | <thead> |
| 76 | <tr> |
Chengyu Fan | 8a53caf | 2014-08-01 14:08:37 -0600 | [diff] [blame] | 77 | <th>NFD ID</th> |
Alexander Afanasyev | 8a09376 | 2014-07-16 18:43:09 -0700 | [diff] [blame] | 78 | <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 Fan | 8a53caf | 2014-08-01 14:08:37 -0600 | [diff] [blame] | 95 | <td><xsl:apply-templates select="nfd:nfdId"/></td> |
Hila Ben Abraham | 2ef9957 | 2014-12-02 02:45:51 -0600 | [diff] [blame] | 96 | <td><xsl:value-of select="nfd:version"/></td> |
Alexander Afanasyev | 8a09376 | 2014-07-16 18:43:09 -0700 | [diff] [blame] | 97 | <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 Fan | 45d1a76 | 2014-07-08 14:21:32 -0600 | [diff] [blame] | 111 | </table> |
| 112 | </xsl:template> |
| 113 | |
| 114 | <xsl:template match="nfd:channels"> |
| 115 | <h2>Channels</h2> |
Alexander Afanasyev | 8a09376 | 2014-07-16 18:43:09 -0700 | [diff] [blame] | 116 | <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 Fan | 45d1a76 | 2014-07-08 14:21:32 -0600 | [diff] [blame] | 137 | </table> |
| 138 | </xsl:template> |
| 139 | |
| 140 | <xsl:template match="nfd:faces"> |
| 141 | <h2>Faces</h2> |
Alexander Afanasyev | 8a09376 | 2014-07-16 18:43:09 -0700 | [diff] [blame] | 142 | <table class="item-list"> |
| 143 | <thead> |
| 144 | <tr> |
| 145 | <th>Face ID</th> |
| 146 | <th>Remote URI</th> |
| 147 | <th>Local URI</th> |
Chengyu Fan | 27d570a | 2014-10-09 11:52:17 -0600 | [diff] [blame] | 148 | <th>Scope</th> |
| 149 | <th>Persistency</th> |
| 150 | <th>LinkType</th> |
Chengyu Fan | 6717964 | 2014-08-15 16:00:43 -0600 | [diff] [blame] | 151 | <th>Expires in</th> |
Alexander Afanasyev | 8a09376 | 2014-07-16 18:43:09 -0700 | [diff] [blame] | 152 | <th>In Interests</th> |
| 153 | <th>In Data</th> |
Chengyu Fan | 3331cfa | 2014-07-25 17:36:31 -0600 | [diff] [blame] | 154 | <th>In Bytes</th> |
Alexander Afanasyev | 8a09376 | 2014-07-16 18:43:09 -0700 | [diff] [blame] | 155 | <th>Out Interests</th> |
| 156 | <th>Out Data</th> |
Chengyu Fan | 3331cfa | 2014-07-25 17:36:31 -0600 | [diff] [blame] | 157 | <th>Out Bytes</th> |
Alexander Afanasyev | 8a09376 | 2014-07-16 18:43:09 -0700 | [diff] [blame] | 158 | </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 Fan | 27d570a | 2014-10-09 11:52:17 -0600 | [diff] [blame] | 174 | <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 Fan | 6717964 | 2014-08-15 16:00:43 -0600 | [diff] [blame] | 177 | <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 Afanasyev | 8a09376 | 2014-07-16 18:43:09 -0700 | [diff] [blame] | 187 | <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 Fan | 3331cfa | 2014-07-25 17:36:31 -0600 | [diff] [blame] | 189 | <td><xsl:value-of select="nfd:byteCounters/nfd:incomingBytes"/></td> |
Alexander Afanasyev | 8a09376 | 2014-07-16 18:43:09 -0700 | [diff] [blame] | 190 | <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 Fan | 3331cfa | 2014-07-25 17:36:31 -0600 | [diff] [blame] | 192 | <td><xsl:value-of select="nfd:byteCounters/nfd:outgoingBytes"/></td> |
Alexander Afanasyev | 8a09376 | 2014-07-16 18:43:09 -0700 | [diff] [blame] | 193 | </tr> |
| 194 | </xsl:for-each> |
| 195 | </tbody> |
Chengyu Fan | 45d1a76 | 2014-07-08 14:21:32 -0600 | [diff] [blame] | 196 | </table> |
| 197 | </xsl:template> |
| 198 | |
| 199 | <xsl:template match="nfd:fib"> |
| 200 | <h2>FIB</h2> |
Alexander Afanasyev | 8a09376 | 2014-07-16 18:43:09 -0700 | [diff] [blame] | 201 | <table class="item-list"> |
| 202 | <thead> |
| 203 | <tr> |
Chengyu Fan | 30aa207 | 2014-07-20 13:52:32 -0600 | [diff] [blame] | 204 | <th width="20%">Prefix</th> |
Alexander Afanasyev | 8a09376 | 2014-07-16 18:43:09 -0700 | [diff] [blame] | 205 | <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 Fan | 30aa207 | 2014-07-20 13:52:32 -0600 | [diff] [blame] | 221 | <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 Fan | 1c630ba | 2014-08-20 13:27:58 -0500 | [diff] [blame] | 284 | <th>ChildInherit</th> |
Chengyu Fan | 30aa207 | 2014-07-20 13:52:32 -0600 | [diff] [blame] | 285 | <xsl:for-each select="nfd:routes/nfd:route"> |
Chengyu Fan | 1c630ba | 2014-08-20 13:27:58 -0500 | [diff] [blame] | 286 | <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 Fan | 30aa207 | 2014-07-20 13:52:32 -0600 | [diff] [blame] | 301 | </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 Afanasyev | 8a09376 | 2014-07-16 18:43:09 -0700 | [diff] [blame] | 319 | </td> |
| 320 | </tr> |
Chengyu Fan | 45d1a76 | 2014-07-08 14:21:32 -0600 | [diff] [blame] | 321 | </xsl:for-each> |
Alexander Afanasyev | 8a09376 | 2014-07-16 18:43:09 -0700 | [diff] [blame] | 322 | </tbody> |
Chengyu Fan | 45d1a76 | 2014-07-08 14:21:32 -0600 | [diff] [blame] | 323 | </table> |
| 324 | </xsl:template> |
| 325 | |
| 326 | <xsl:template match="nfd:strategyChoices"> |
| 327 | <h2>Strategy Choices</h2> |
Alexander Afanasyev | 8a09376 | 2014-07-16 18:43:09 -0700 | [diff] [blame] | 328 | <table class="item-list"> |
| 329 | <thead> |
| 330 | <tr> |
Chengyu Fan | 30aa207 | 2014-07-20 13:52:32 -0600 | [diff] [blame] | 331 | <th width="20%">Namespace</th> |
Alexander Afanasyev | 8a09376 | 2014-07-16 18:43:09 -0700 | [diff] [blame] | 332 | <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 Fan | 45d1a76 | 2014-07-08 14:21:32 -0600 | [diff] [blame] | 343 | </table> |
| 344 | </xsl:template> |
| 345 | |
| 346 | </xsl:stylesheet> |