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"> |
Joao Pereira | 4e274ac | 2015-07-23 11:54:20 -0400 | [diff] [blame] | 4 | <xsl:output method="html" encoding="utf-8" indent="yes" doctype-system="about:legacy-compat"/> |
Chengyu Fan | 45d1a76 | 2014-07-08 14:21:32 -0600 | [diff] [blame] | 5 | |
| 6 | <xsl:template match="/"> |
| 7 | <html> |
| 8 | <head> |
| 9 | <title>NFD Status</title> |
Alexander Afanasyev | 8a09376 | 2014-07-16 18:43:09 -0700 | [diff] [blame] | 10 | <link rel="stylesheet" type="text/css" href="style.css" /> |
Chengyu Fan | 45d1a76 | 2014-07-08 14:21:32 -0600 | [diff] [blame] | 11 | </head> |
| 12 | <body> |
Alexander Afanasyev | 8a09376 | 2014-07-16 18:43:09 -0700 | [diff] [blame] | 13 | <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 Afanasyev | d7bb88b | 2015-01-26 18:59:29 -0800 | [diff] [blame] | 25 | <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] | 26 | </footer> |
Chengyu Fan | 45d1a76 | 2014-07-08 14:21:32 -0600 | [diff] [blame] | 27 | </body> |
| 28 | </html> |
| 29 | </xsl:template> |
| 30 | |
Alexander Afanasyev | 8a09376 | 2014-07-16 18:43:09 -0700 | [diff] [blame] | 31 | |
| 32 | <xsl:template name="formatDate"> |
| 33 | <xsl:param name="date" /> |
| 34 | <xsl:value-of select="substring($date, 0, 11)"/> <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 Fan | a55663d | 2014-08-13 20:31:03 -0600 | [diff] [blame] | 40 | <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 Afanasyev | 8a09376 | 2014-07-16 18:43:09 -0700 | [diff] [blame] | 43 | <xsl:choose> |
Chengyu Fan | a55663d | 2014-08-13 20:31:03 -0600 | [diff] [blame] | 44 | <xsl:when test="$days = 1"> |
| 45 | <xsl:value-of select="$days"/> day |
| 46 | </xsl:when> |
| 47 | <xsl:when test="$days > 1"> |
Alexander Afanasyev | 8a09376 | 2014-07-16 18:43:09 -0700 | [diff] [blame] | 48 | <xsl:value-of select="$days"/> days |
| 49 | </xsl:when> |
Chengyu Fan | a55663d | 2014-08-13 20:31:03 -0600 | [diff] [blame] | 50 | <xsl:when test="$hours = 1"> |
| 51 | <xsl:value-of select="$hours"/> hour |
| 52 | </xsl:when> |
| 53 | <xsl:when test="$hours > 1"> |
Alexander Afanasyev | 8a09376 | 2014-07-16 18:43:09 -0700 | [diff] [blame] | 54 | <xsl:value-of select="$hours"/> hours |
| 55 | </xsl:when> |
Chengyu Fan | a55663d | 2014-08-13 20:31:03 -0600 | [diff] [blame] | 56 | <xsl:when test="$minutes = 1"> |
| 57 | <xsl:value-of select="$minutes"/> minute |
| 58 | </xsl:when> |
| 59 | <xsl:when test="$minutes > 1"> |
Alexander Afanasyev | 8a09376 | 2014-07-16 18:43:09 -0700 | [diff] [blame] | 60 | <xsl:value-of select="$minutes"/> minutes |
| 61 | </xsl:when> |
Chengyu Fan | a55663d | 2014-08-13 20:31:03 -0600 | [diff] [blame] | 62 | <xsl:when test="$seconds = 1"> |
| 63 | <xsl:value-of select="$seconds"/> second |
| 64 | </xsl:when> |
Alexander Afanasyev | 8a09376 | 2014-07-16 18:43:09 -0700 | [diff] [blame] | 65 | <xsl:otherwise> |
| 66 | <xsl:value-of select="$seconds"/> seconds |
| 67 | </xsl:otherwise> |
| 68 | </xsl:choose> |
Alexander Afanasyev | 8a09376 | 2014-07-16 18:43:09 -0700 | [diff] [blame] | 69 | </xsl:template> |
| 70 | |
Chengyu Fan | 45d1a76 | 2014-07-08 14:21:32 -0600 | [diff] [blame] | 71 | <xsl:template match="nfd:generalStatus"> |
| 72 | <h2>General NFD status</h2> |
Alexander Afanasyev | 8a09376 | 2014-07-16 18:43:09 -0700 | [diff] [blame] | 73 | <table class="item-list"> |
| 74 | <thead> |
| 75 | <tr> |
Chengyu Fan | 8a53caf | 2014-08-01 14:08:37 -0600 | [diff] [blame] | 76 | <th>NFD ID</th> |
Alexander Afanasyev | 8a09376 | 2014-07-16 18:43:09 -0700 | [diff] [blame] | 77 | <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> |
| 90 | </tr> |
| 91 | </thead> |
| 92 | <tbody> |
| 93 | <tr class="center"> |
Chengyu Fan | 8a53caf | 2014-08-01 14:08:37 -0600 | [diff] [blame] | 94 | <td><xsl:apply-templates select="nfd:nfdId"/></td> |
Hila Ben Abraham | 2ef9957 | 2014-12-02 02:45:51 -0600 | [diff] [blame] | 95 | <td><xsl:value-of select="nfd:version"/></td> |
Alexander Afanasyev | 8a09376 | 2014-07-16 18:43:09 -0700 | [diff] [blame] | 96 | <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> |
| 106 | <td><xsl:value-of select="nfd:packetCounters/nfd:incomingPackets/nfd:nDatas"/></td> |
| 107 | <td><xsl:value-of select="nfd:packetCounters/nfd:outgoingPackets/nfd:nDatas"/></td> |
| 108 | </tr> |
| 109 | </tbody> |
Chengyu Fan | 45d1a76 | 2014-07-08 14:21:32 -0600 | [diff] [blame] | 110 | </table> |
| 111 | </xsl:template> |
| 112 | |
| 113 | <xsl:template match="nfd:channels"> |
| 114 | <h2>Channels</h2> |
Alexander Afanasyev | 8a09376 | 2014-07-16 18:43:09 -0700 | [diff] [blame] | 115 | <table class="item-list"> |
| 116 | <thead> |
| 117 | <tr> |
| 118 | <th>Channel URI</th> |
| 119 | </tr> |
| 120 | </thead> |
| 121 | <tbody> |
| 122 | <xsl:for-each select="nfd:channel"> |
| 123 | <xsl:variable name="style"> |
| 124 | <xsl:choose> |
| 125 | <xsl:when test="position() mod 2 = 1"> |
| 126 | <xsl:text>odd</xsl:text> |
| 127 | </xsl:when> |
| 128 | <xsl:otherwise>even</xsl:otherwise> |
| 129 | </xsl:choose> |
| 130 | </xsl:variable> |
| 131 | <tr class="{$style}"> |
| 132 | <td><xsl:value-of select="nfd:localUri"/></td> |
| 133 | </tr> |
| 134 | </xsl:for-each> |
| 135 | </tbody> |
Chengyu Fan | 45d1a76 | 2014-07-08 14:21:32 -0600 | [diff] [blame] | 136 | </table> |
| 137 | </xsl:template> |
| 138 | |
| 139 | <xsl:template match="nfd:faces"> |
| 140 | <h2>Faces</h2> |
Alexander Afanasyev | 8a09376 | 2014-07-16 18:43:09 -0700 | [diff] [blame] | 141 | <table class="item-list"> |
| 142 | <thead> |
| 143 | <tr> |
| 144 | <th>Face ID</th> |
| 145 | <th>Remote URI</th> |
| 146 | <th>Local URI</th> |
Chengyu Fan | 27d570a | 2014-10-09 11:52:17 -0600 | [diff] [blame] | 147 | <th>Scope</th> |
| 148 | <th>Persistency</th> |
| 149 | <th>LinkType</th> |
Chengyu Fan | 6717964 | 2014-08-15 16:00:43 -0600 | [diff] [blame] | 150 | <th>Expires in</th> |
Alexander Afanasyev | 8a09376 | 2014-07-16 18:43:09 -0700 | [diff] [blame] | 151 | <th>In Interests</th> |
| 152 | <th>In Data</th> |
Chengyu Fan | 3331cfa | 2014-07-25 17:36:31 -0600 | [diff] [blame] | 153 | <th>In Bytes</th> |
Alexander Afanasyev | 8a09376 | 2014-07-16 18:43:09 -0700 | [diff] [blame] | 154 | <th>Out Interests</th> |
| 155 | <th>Out Data</th> |
Chengyu Fan | 3331cfa | 2014-07-25 17:36:31 -0600 | [diff] [blame] | 156 | <th>Out Bytes</th> |
Alexander Afanasyev | 8a09376 | 2014-07-16 18:43:09 -0700 | [diff] [blame] | 157 | </tr> |
| 158 | </thead> |
| 159 | <tbody> |
| 160 | <xsl:for-each select="nfd:face"> |
| 161 | <xsl:variable name="style"> |
| 162 | <xsl:choose> |
| 163 | <xsl:when test="position() mod 2 = 1"> |
| 164 | <xsl:text>odd</xsl:text> |
| 165 | </xsl:when> |
| 166 | <xsl:otherwise>even</xsl:otherwise> |
| 167 | </xsl:choose> |
| 168 | </xsl:variable> |
| 169 | <tr class="{$style}"> |
| 170 | <td><xsl:value-of select="nfd:faceId"/></td> |
| 171 | <td><xsl:value-of select="nfd:remoteUri"/></td> |
| 172 | <td><xsl:value-of select="nfd:localUri"/></td> |
Chengyu Fan | 27d570a | 2014-10-09 11:52:17 -0600 | [diff] [blame] | 173 | <td><xsl:value-of select="nfd:faceScope"/></td> |
| 174 | <td><xsl:value-of select="nfd:facePersistency"/></td> |
| 175 | <td><xsl:value-of select="nfd:linkType"/></td> |
Chengyu Fan | 6717964 | 2014-08-15 16:00:43 -0600 | [diff] [blame] | 176 | <td> |
| 177 | <xsl:choose> |
| 178 | <xsl:when test="nfd:expirationPeriod"> |
| 179 | <xsl:call-template name="formatDuration"><xsl:with-param name="duration" select="nfd:expirationPeriod" /></xsl:call-template> |
| 180 | </xsl:when> |
| 181 | <xsl:otherwise> |
| 182 | Never |
| 183 | </xsl:otherwise> |
| 184 | </xsl:choose> |
| 185 | </td> |
Alexander Afanasyev | 8a09376 | 2014-07-16 18:43:09 -0700 | [diff] [blame] | 186 | <td><xsl:value-of select="nfd:packetCounters/nfd:incomingPackets/nfd:nInterests"/></td> |
| 187 | <td><xsl:value-of select="nfd:packetCounters/nfd:incomingPackets/nfd:nDatas"/></td> |
Chengyu Fan | 3331cfa | 2014-07-25 17:36:31 -0600 | [diff] [blame] | 188 | <td><xsl:value-of select="nfd:byteCounters/nfd:incomingBytes"/></td> |
Alexander Afanasyev | 8a09376 | 2014-07-16 18:43:09 -0700 | [diff] [blame] | 189 | <td><xsl:value-of select="nfd:packetCounters/nfd:outgoingPackets/nfd:nInterests"/></td> |
| 190 | <td><xsl:value-of select="nfd:packetCounters/nfd:outgoingPackets/nfd:nDatas"/></td> |
Chengyu Fan | 3331cfa | 2014-07-25 17:36:31 -0600 | [diff] [blame] | 191 | <td><xsl:value-of select="nfd:byteCounters/nfd:outgoingBytes"/></td> |
Alexander Afanasyev | 8a09376 | 2014-07-16 18:43:09 -0700 | [diff] [blame] | 192 | </tr> |
| 193 | </xsl:for-each> |
| 194 | </tbody> |
Chengyu Fan | 45d1a76 | 2014-07-08 14:21:32 -0600 | [diff] [blame] | 195 | </table> |
| 196 | </xsl:template> |
| 197 | |
| 198 | <xsl:template match="nfd:fib"> |
| 199 | <h2>FIB</h2> |
Alexander Afanasyev | 8a09376 | 2014-07-16 18:43:09 -0700 | [diff] [blame] | 200 | <table class="item-list"> |
| 201 | <thead> |
| 202 | <tr> |
Chengyu Fan | 30aa207 | 2014-07-20 13:52:32 -0600 | [diff] [blame] | 203 | <th width="20%">Prefix</th> |
Alexander Afanasyev | 8a09376 | 2014-07-16 18:43:09 -0700 | [diff] [blame] | 204 | <th>NextHops</th> |
| 205 | </tr> |
| 206 | </thead> |
| 207 | <tbody> |
| 208 | <xsl:for-each select="nfd:fibEntry"> |
| 209 | <xsl:variable name="style"> |
| 210 | <xsl:choose> |
| 211 | <xsl:when test="position() mod 2 = 1"> |
| 212 | <xsl:text>odd</xsl:text> |
| 213 | </xsl:when> |
| 214 | <xsl:otherwise>even</xsl:otherwise> |
| 215 | </xsl:choose> |
| 216 | </xsl:variable> |
| 217 | <tr class="{$style}"> |
| 218 | <td style="text-align:left;vertical-align:top;padding:0"><xsl:value-of select="nfd:prefix"/></td> |
| 219 | <td> |
Chengyu Fan | 30aa207 | 2014-07-20 13:52:32 -0600 | [diff] [blame] | 220 | <table class="item-sublist"> |
| 221 | <tr> |
| 222 | <th>FaceId</th> |
| 223 | <xsl:for-each select="nfd:nextHops/nfd:nextHop"> |
| 224 | <td><xsl:value-of select="nfd:faceId"/></td> |
| 225 | </xsl:for-each> |
| 226 | </tr> |
| 227 | <tr> |
| 228 | <th>Cost</th> |
| 229 | <xsl:for-each select="nfd:nextHops/nfd:nextHop"> |
| 230 | <td><xsl:value-of select="nfd:cost"/></td> |
| 231 | </xsl:for-each> |
| 232 | </tr> |
| 233 | </table> |
| 234 | </td> |
| 235 | </tr> |
| 236 | </xsl:for-each> |
| 237 | </tbody> |
| 238 | </table> |
| 239 | </xsl:template> |
| 240 | |
| 241 | <xsl:template match="nfd:rib"> |
| 242 | <h2>RIB</h2> |
| 243 | <table class="item-list"> |
| 244 | <thead> |
| 245 | <tr> |
| 246 | <th width="20%">Prefix</th> |
| 247 | <th>Routes</th> |
| 248 | </tr> |
| 249 | </thead> |
| 250 | <tbody> |
| 251 | <xsl:for-each select="nfd:ribEntry"> |
| 252 | <xsl:variable name="style"> |
| 253 | <xsl:choose> |
| 254 | <xsl:when test="position() mod 2 = 1"> |
| 255 | <xsl:text>odd</xsl:text> |
| 256 | </xsl:when> |
| 257 | <xsl:otherwise>even</xsl:otherwise> |
| 258 | </xsl:choose> |
| 259 | </xsl:variable> |
| 260 | <tr class="{$style}"> |
| 261 | <td style="text-align:left;vertical-align:top;padding:0"><xsl:value-of select="nfd:prefix"/></td> |
| 262 | <td> |
| 263 | <table class="item-sublist"> |
| 264 | <tr> |
| 265 | <th>FaceId</th> |
| 266 | <xsl:for-each select="nfd:routes/nfd:route"> |
| 267 | <td><xsl:value-of select="nfd:faceId"/></td> |
| 268 | </xsl:for-each> |
| 269 | </tr> |
| 270 | <tr> |
| 271 | <th>Origin</th> |
| 272 | <xsl:for-each select="nfd:routes/nfd:route"> |
| 273 | <td><xsl:value-of select="nfd:origin"/></td> |
| 274 | </xsl:for-each> |
| 275 | </tr> |
| 276 | <tr> |
| 277 | <th>Cost</th> |
| 278 | <xsl:for-each select="nfd:routes/nfd:route"> |
| 279 | <td><xsl:value-of select="nfd:cost"/></td> |
| 280 | </xsl:for-each> |
| 281 | </tr> |
| 282 | <tr> |
Chengyu Fan | 1c630ba | 2014-08-20 13:27:58 -0500 | [diff] [blame] | 283 | <th>ChildInherit</th> |
Chengyu Fan | 30aa207 | 2014-07-20 13:52:32 -0600 | [diff] [blame] | 284 | <xsl:for-each select="nfd:routes/nfd:route"> |
Chengyu Fan | 1c630ba | 2014-08-20 13:27:58 -0500 | [diff] [blame] | 285 | <td> |
| 286 | <xsl:if test="nfd:flags/nfd:childInherit"> |
| 287 | Y |
| 288 | </xsl:if> |
| 289 | </td> |
| 290 | </xsl:for-each> |
| 291 | </tr> |
| 292 | <tr> |
| 293 | <th>RibCapture</th> |
| 294 | <xsl:for-each select="nfd:routes/nfd:route"> |
| 295 | <td> |
| 296 | <xsl:if test="nfd:flags/nfd:ribCapture"> |
| 297 | Y |
| 298 | </xsl:if> |
| 299 | </td> |
Chengyu Fan | 30aa207 | 2014-07-20 13:52:32 -0600 | [diff] [blame] | 300 | </xsl:for-each> |
| 301 | </tr> |
| 302 | <tr> |
| 303 | <th>Expires in</th> |
| 304 | <xsl:for-each select="nfd:routes/nfd:route"> |
| 305 | <td> |
| 306 | <xsl:choose> |
| 307 | <xsl:when test="nfd:expirationPeriod"> |
| 308 | <xsl:call-template name="formatDuration"><xsl:with-param name="duration" select="nfd:expirationPeriod" /></xsl:call-template> |
| 309 | </xsl:when> |
| 310 | <xsl:otherwise> |
| 311 | Never |
| 312 | </xsl:otherwise> |
| 313 | </xsl:choose> |
| 314 | </td> |
| 315 | </xsl:for-each> |
| 316 | </tr> |
| 317 | </table> |
Alexander Afanasyev | 8a09376 | 2014-07-16 18:43:09 -0700 | [diff] [blame] | 318 | </td> |
| 319 | </tr> |
Chengyu Fan | 45d1a76 | 2014-07-08 14:21:32 -0600 | [diff] [blame] | 320 | </xsl:for-each> |
Alexander Afanasyev | 8a09376 | 2014-07-16 18:43:09 -0700 | [diff] [blame] | 321 | </tbody> |
Chengyu Fan | 45d1a76 | 2014-07-08 14:21:32 -0600 | [diff] [blame] | 322 | </table> |
| 323 | </xsl:template> |
| 324 | |
| 325 | <xsl:template match="nfd:strategyChoices"> |
| 326 | <h2>Strategy Choices</h2> |
Alexander Afanasyev | 8a09376 | 2014-07-16 18:43:09 -0700 | [diff] [blame] | 327 | <table class="item-list"> |
| 328 | <thead> |
| 329 | <tr> |
Chengyu Fan | 30aa207 | 2014-07-20 13:52:32 -0600 | [diff] [blame] | 330 | <th width="20%">Namespace</th> |
Alexander Afanasyev | 8a09376 | 2014-07-16 18:43:09 -0700 | [diff] [blame] | 331 | <th>Strategy Name</th> |
| 332 | </tr> |
| 333 | </thead> |
| 334 | <tbody> |
| 335 | <xsl:for-each select="nfd:strategyChoice"> |
| 336 | <tr> |
| 337 | <td><xsl:value-of select="nfd:namespace"/></td> |
| 338 | <td><xsl:value-of select="nfd:strategy/nfd:name"/></td> |
| 339 | </tr> |
| 340 | </xsl:for-each> |
| 341 | </tbody> |
Chengyu Fan | 45d1a76 | 2014-07-08 14:21:32 -0600 | [diff] [blame] | 342 | </table> |
| 343 | </xsl:template> |
| 344 | |
| 345 | </xsl:stylesheet> |