]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Display a per-view list of zones in the web interface
authorMichał Kępień <michal@isc.org>
Thu, 25 Oct 2018 08:03:03 +0000 (10:03 +0200)
committerMichał Kępień <michal@isc.org>
Thu, 25 Oct 2018 08:03:03 +0000 (10:03 +0200)
The XSL stylesheet used by the web interface does not currently include
any element which would cause a list of zones configured in each view to
be displayed, making the "Zones" section of the web interface empty
unless some zone has been configured with "zone-statistics full;" and
queried.  Since this can be confusing, modify the XSL stylesheet so that
a list of zones configured in each view is displayed in the web
interface.

bin/named/bind9.xsl
bin/named/bind9.xsl.h

index 4f3778ef59151c298edb815f3dc2f8c9f18c77d3..0fe5750248fe73e55e23662e0c01a9b4fe327b40 100644 (file)
       background-color: #99ddff;
      }
 
+     table.zones {
+      border: 1px solid grey;
+      width: 500px;
+     }
+     table.zones th {
+      text-align: center;
+      border: 1px solid grey;
+     }
+     table.zones td {
+      text-align: center;
+      font-family: monospace;
+     }
+     table.zones td:nth-child(1) {
+      text-align: right;
+     }
+     table.zones td:nth-child(4) {
+      text-align: right;
+     }
+
      .totals {
       background-color: rgb(1,169,206);
       color: #ffffff;
           </table>
           <br/>
         </xsl:if>
+        <xsl:for-each select="views/view">
+         <xsl:if test="zones/zone">
+            <h3>Zones for View <xsl:value-of select="@name"/></h3>
+            <table class="zones">
+              <tr>
+                <th>Name</th>
+                <th>Class</th>
+                <th>Type</th>
+                <th>Serial</th>
+              </tr>
+              <xsl:for-each select="zones/zone">
+                <tr>
+                  <td>
+                    <xsl:value-of select="@name"/>
+                  </td>
+                  <td>
+                    <xsl:value-of select="@rdataclass"/>
+                  </td>
+                  <td>
+                    <xsl:value-of select="type"/>
+                  </td>
+                  <td>
+                    <xsl:value-of select="serial"/>
+                  </td>
+                </tr>
+              </xsl:for-each>
+            </table>
+         </xsl:if>
+        </xsl:for-each>
         <xsl:if test="views/view[zones/zone/counters[@type=&quot;qtype&quot;]/counter &gt;0]">
           <h2>Received QTYPES per view/zone</h2>
           <xsl:for-each select="views/view[zones/zone/counters[@type=&quot;qtype&quot;]/counter &gt;0]">
index 50fd2ba3f248c2808452ba440e951c762eb95f09..8339fd3838f475c12cef4c5a49f878da93fc21cf 100644 (file)
@@ -203,6 +203,25 @@ static char xslmsg[] =
        " background-color: #99ddff;\n"
        " }\n"
        "\n"
+       " table.zones {\n"
+       " border: 1px solid grey;\n"
+       " width: 500px;\n"
+       " }\n"
+       " table.zones th {\n"
+       " text-align: center;\n"
+       " border: 1px solid grey;\n"
+       " }\n"
+       " table.zones td {\n"
+       " text-align: center;\n"
+       " font-family: monospace;\n"
+       " }\n"
+       " table.zones td:nth-child(1) {\n"
+       " text-align: right;\n"
+       " }\n"
+       " table.zones td:nth-child(4) {\n"
+       " text-align: right;\n"
+       " }\n"
+       "\n"
        " .totals {\n"
        " background-color: rgb(1,169,206);\n"
        " color: #ffffff;\n"
@@ -710,6 +729,35 @@ static char xslmsg[] =
        " </table>\n"
        " <br/>\n"
        " </xsl:if>\n"
+       " <xsl:for-each select=\"views/view\">\n"
+       " <xsl:if test=\"zones/zone\">\n"
+       " <h3>Zones for View <xsl:value-of select=\"@name\"/></h3>\n"
+       " <table class=\"zones\">\n"
+       " <tr>\n"
+       " <th>Name</th>\n"
+       " <th>Class</th>\n"
+       " <th>Type</th>\n"
+       " <th>Serial</th>\n"
+       " </tr>\n"
+       " <xsl:for-each select=\"zones/zone\">\n"
+       " <tr>\n"
+       " <td>\n"
+       " <xsl:value-of select=\"@name\"/>\n"
+       " </td>\n"
+       " <td>\n"
+       " <xsl:value-of select=\"@rdataclass\"/>\n"
+       " </td>\n"
+       " <td>\n"
+       " <xsl:value-of select=\"type\"/>\n"
+       " </td>\n"
+       " <td>\n"
+       " <xsl:value-of select=\"serial\"/>\n"
+       " </td>\n"
+       " </tr>\n"
+       " </xsl:for-each>\n"
+       " </table>\n"
+       " </xsl:if>\n"
+       " </xsl:for-each>\n"
        " <xsl:if test=\"views/view[zones/zone/counters[@type=&quot;qtype&quot;]/counter &gt;0]\">\n"
        " <h2>Received QTYPES per view/zone</h2>\n"
        " <xsl:for-each select=\"views/view[zones/zone/counters[@type=&quot;qtype&quot;]/counter &gt;0]\">\n"