dfsclusterhealth.xsl 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <!--
  2. /**
  3. * Licensed to the Apache Software Foundation (ASF) under one
  4. * or more contributor license agreements. See the NOTICE file
  5. * distributed with this work for additional information
  6. * regarding copyright ownership. The ASF licenses this file
  7. * to you under the Apache License, Version 2.0 (the
  8. * "License"); you may not use this file except in compliance
  9. * with the License. You may obtain a copy of the License at
  10. *
  11. * http://www.apache.org/licenses/LICENSE-2.0
  12. *
  13. * Unless required by applicable law or agreed to in writing, software
  14. * distributed under the License is distributed on an "AS IS" BASIS,
  15. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16. * See the License for the specific language governing permissions and
  17. * limitations under the License.
  18. */
  19. -->
  20. <xsl:stylesheet version="1.0"
  21. xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  22. <xsl:include href="dfsclusterhealth_utils.xsl" />
  23. <xsl:output method="html" encoding="UTF-8" />
  24. <xsl:template match="/">
  25. <html>
  26. <head>
  27. <link rel="stylesheet" type="text/css" href="static/hadoop.css" />
  28. <style type="text/css">th,span {width:8em;}</style>
  29. <title>
  30. Hadoop cluster
  31. <xsl:value-of select="cluster/@clusterId" />
  32. </title>
  33. </head>
  34. <body>
  35. <h1>
  36. Cluster '
  37. <xsl:value-of select="cluster/@clusterId" />
  38. '
  39. </h1>
  40. <h2>Cluster Summary</h2>
  41. <xsl:if test="count(cluster/storage/item)">
  42. <div id="dfstable">
  43. <table>
  44. <tbody>
  45. <xsl:for-each select="cluster/storage/item">
  46. <tr class="rowNormal">
  47. <td id="col1">
  48. <xsl:value-of select="@label" />
  49. </td>
  50. <td id="col2">:</td>
  51. <td id="col3">
  52. <xsl:call-template name="displayValue">
  53. <xsl:with-param name="value">
  54. <xsl:value-of select="@value" />
  55. </xsl:with-param>
  56. <xsl:with-param name="unit">
  57. <xsl:value-of select="@unit" />
  58. </xsl:with-param>
  59. <xsl:with-param name="link">
  60. <xsl:value-of select="@link" />
  61. </xsl:with-param>
  62. </xsl:call-template>
  63. </td>
  64. </tr>
  65. </xsl:for-each>
  66. </tbody>
  67. </table>
  68. </div>
  69. <br />
  70. <hr />
  71. </xsl:if>
  72. <xsl:if test="count(cluster/namenodes/node)">
  73. <h2>Namenodes</h2>
  74. <div id="dfstable">
  75. <table>
  76. <tbody>
  77. <tr class="rowNormal">
  78. <td id="col1">Number of namenodes</td>
  79. <td id="col2">:</td>
  80. <td id="col3">
  81. <xsl:value-of select="count(cluster/namenodes/node)" />
  82. </td>
  83. </tr>
  84. </tbody>
  85. </table>
  86. </div>
  87. <br />
  88. <div id="dfstable">
  89. <table border="1" cellpadding="10" cellspacing="0">
  90. <thead>
  91. <xsl:for-each select="cluster/namenodes/node[1]/item">
  92. <th>
  93. <SPAN><xsl:value-of select="@label" /></SPAN>
  94. </th>
  95. </xsl:for-each>
  96. </thead>
  97. <tbody>
  98. <xsl:for-each select="cluster/namenodes/node">
  99. <tr>
  100. <xsl:for-each select="item">
  101. <td>
  102. <xsl:call-template name="displayValue">
  103. <xsl:with-param name="value">
  104. <xsl:value-of select="@value" />
  105. </xsl:with-param>
  106. <xsl:with-param name="unit">
  107. <xsl:value-of select="@unit" />
  108. </xsl:with-param>
  109. <xsl:with-param name="link">
  110. <xsl:value-of select="@link" />
  111. </xsl:with-param>
  112. </xsl:call-template>
  113. </td>
  114. </xsl:for-each>
  115. </tr>
  116. </xsl:for-each>
  117. </tbody>
  118. </table>
  119. </div>
  120. </xsl:if>
  121. <xsl:if test="count(cluster/unreportedNamenodes/node)">
  122. <h2>Unreported Namenodes</h2>
  123. <div id="dfstable">
  124. <table border="1" cellpadding="10" cellspacing="0">
  125. <tbody>
  126. <xsl:for-each select="cluster/unreportedNamenodes/node">
  127. <tr class="rowNormal">
  128. <td id="col1">
  129. <xsl:value-of select="@name" />
  130. </td>
  131. <td id="col2">
  132. <xsl:value-of select="@exception" />
  133. </td>
  134. </tr>
  135. </xsl:for-each>
  136. </tbody>
  137. </table>
  138. </div>
  139. </xsl:if>
  140. <xsl:if test="count(cluster/message/item)">
  141. <h4>Exception</h4>
  142. <xsl:for-each select="cluster/message/item">
  143. <xsl:value-of select="@msg" />
  144. </xsl:for-each>
  145. </xsl:if>
  146. </body>
  147. </html>
  148. </xsl:template>
  149. </xsl:stylesheet>