aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2011-07-19 04:14:40 +0000
committerRob Austein <sra@hactrn.net>2011-07-19 04:14:40 +0000
commit5b0797809f761734fe1477795e60f63f5c1c7a49 (patch)
tree6d054edaccfc2f1a035226d406cf1e5c4486f1fa
parentbcb63e45661fe6d2cd7888e8e5f9e69cfd4090da (diff)
Further antics summarizing XML data
svn path=/rcynic-ng/rcynic.c; revision=3937
-rw-r--r--rcynic-ng/rcynic.c4
-rw-r--r--rcynic-ng/rcynic.xsl192
2 files changed, 112 insertions, 84 deletions
diff --git a/rcynic-ng/rcynic.c b/rcynic-ng/rcynic.c
index 12ccb0a7..993b1538 100644
--- a/rcynic-ng/rcynic.c
+++ b/rcynic-ng/rcynic.c
@@ -3651,8 +3651,8 @@ static void walk_cert(rcynic_ctx_t *rc, STACK_OF(walk_ctx_t) *wsk)
walk_ctx_loop_next(rc, wsk);
continue;
}
-
- log_validation_status(rc, &uri, unknown_object_type, generation);
+
+ log_validation_status(rc, &uri, unknown_object_type, object_generation_null);
walk_ctx_loop_next(rc, wsk);
continue;
diff --git a/rcynic-ng/rcynic.xsl b/rcynic-ng/rcynic.xsl
index a24bbd36..ed3c6e07 100644
--- a/rcynic-ng/rcynic.xsl
+++ b/rcynic-ng/rcynic.xsl
@@ -76,13 +76,13 @@
<meta http-equiv="Refresh" content="{$refresh}"/>
</xsl:if>
<style type="text/css">
- td { text-align: center; padding: 4px }
- td.uri { text-align: left }
- td.host { text-align: left }
+ td { text-align: center; padding: 4px }
+ td.uri { text-align: left }
+ td.host { text-align: left }
<xsl:if test="$use-colors != 0">
- tr.good { background-color: #77ff77 }
- tr.warn { background-color: yellow }
- tr.bad { background-color: #ff5500 }
+ tr.good { background-color: #77ff77 }
+ tr.warn { background-color: yellow }
+ tr.bad { background-color: #ff5500 }
</xsl:if>
</style>
</head>
@@ -105,7 +105,7 @@
<xsl:value-of select="substring($uri, string-length($uri) - 3)"/>
</xsl:if>
</xsl:variable>
- <x hostname="{$hostname}" timestamp="{@timestamp}" uri="{$uri}" status="{@status}" mood="{$mood}" fn2="{$fn2}"/>
+ <x hostname="{$hostname}" timestamp="{@timestamp}" uri="{$uri}" status="{@status}" mood="{$mood}" fn2="{$fn2}" generation="{@generation}"/>
</xsl:if>
</xsl:for-each>
</xsl:variable>
@@ -124,6 +124,13 @@
</xsl:for-each>
</xsl:variable>
+ <!-- Generation names -->
+ <xsl:variable name="unique-generations">
+ <xsl:for-each select="com:node-set($host-data)/x[not(@generation = following::x/@generation)]">
+ <x generation="{@generation}"/>
+ </xsl:for-each>
+ </xsl:variable>
+
<!-- Calculate totals, figure out which columns to display -->
<xsl:variable name="totals">
<xsl:for-each select="rcynic-summary/labels/*">
@@ -145,56 +152,20 @@
<!-- Calculate how many columns we'll be displaying -->
<xsl:variable name="columns" select="count(com:node-set($totals)/x[@show = 1])"/>
- <!-- Generate the HTML -->
- <br/>
- <h2>Summary by Repository Host</h2>
- <table class="summary" rules="all" border="1">
- <thead>
- <tr>
- <td><b>Publication Repository</b></td>
- <xsl:for-each select="com:node-set($totals)/x[@show = 1]">
- <td><b><xsl:value-of select="@text"/></b></td>
- </xsl:for-each>
- </tr>
- </thead>
- <tbody>
- <xsl:for-each select="com:node-set($unique-hostnames)/x">
- <xsl:sort order="ascending" data-type="text" select="@hostname"/>
- <xsl:variable name="hostname" select="@hostname"/>
+ <!-- Show the total -->
+ <xsl:if test="$show-total != 0">
+ <br/>
+ <h2>Totals</h2>
+ <table class="summary" rules="all" border="1">
+ <thead>
<tr>
- <td class="host"><xsl:value-of select="$hostname"/></td>
- <td colspan="{$columns}"/>
+ <td/> <!-- was hostname -->
+ <xsl:for-each select="com:node-set($totals)/x[@show = 1]">
+ <td><b><xsl:value-of select="@text"/></b></td>
+ </xsl:for-each>
</tr>
- <xsl:for-each select="com:node-set($unique-fn2s)/x">
- <xsl:sort order="ascending" data-type="text" select="@fn2"/>
- <xsl:variable name="fn2" select="@fn2"/>
- <xsl:variable name="goodness" select="count(com:node-set($host-data)/x[@hostname = $hostname and @fn2 = $fn2 and @mood = 'good'])"/>
- <xsl:variable name="badness" select="count(com:node-set($host-data)/x[@hostname = $hostname and @fn2 = $fn2 and @mood = 'bad'])"/>
- <xsl:variable name="warnings" select="count(com:node-set($host-data)/x[@hostname = $hostname and @fn2 = $fn2 and @mood = 'warn'])"/>
- <xsl:variable name="mood">
- <xsl:choose>
- <xsl:when test="$goodness != 0 and $warnings = 0 and $badness = 0">good</xsl:when>
- <xsl:when test="$goodness + $warnings != 0">warn</xsl:when>
- <xsl:otherwise>bad</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:if test="$goodness + $badness + $warnings">
- <tr class="{$mood}">
- <td><xsl:value-of select="$fn2"/></td>
- <xsl:for-each select="com:node-set($totals)/x[@show = 1]">
- <xsl:variable name="label" select="@name"/>
- <xsl:variable name="value" select="count(com:node-set($host-data)/x[@hostname = $hostname and @fn2 = $fn2 and @status = $label])"/>
- <td>
- <xsl:if test="$value != 0">
- <xsl:value-of select="$value"/>
- </xsl:if>
- </td>
- </xsl:for-each>
- </tr>
- </xsl:if>
- </xsl:for-each>
- </xsl:for-each>
- <xsl:if test="$show-total != 0">
+ </thead>
+ <tbody>
<tr>
<td><b>Total</b></td>
<xsl:for-each select="com:node-set($totals)/x">
@@ -203,35 +174,90 @@
</xsl:if>
</xsl:for-each>
</tr>
- </xsl:if>
- </tbody>
- </table>
- </xsl:if>
+ </tbody>
+ </table>
+ </xsl:if>
- <!-- "Problems" display -->
- <xsl:if test="$show-problems != 0">
+ <!-- Generate the HTML -->
<br/>
- <h2>Problems</h2>
- <table class="problems" rules="all" border="1" >
- <thead>
- <tr>
- <td class="status"><b>Status</b></td>
- <td class="uri"><b>URI</b></td>
- </tr>
- </thead>
- <tbody>
- <xsl:for-each select="rcynic-summary/validation_status">
- <xsl:variable name="status" select="@status"/>
- <xsl:variable name="mood" select="/rcynic-summary/labels/*[name() = $status]/@kind"/>
- <xsl:if test="$mood != 'good'">
- <tr class="{$mood}">
- <td class="status"><xsl:value-of select="/rcynic-summary/labels/*[name() = $status] "/></td>
- <td class="uri"><xsl:value-of select="."/></td>
- </tr>
- </xsl:if>
- </xsl:for-each>
- </tbody>
- </table>
+ <h2>Summaries by Repository Host</h2>
+ <xsl:for-each select="com:node-set($unique-hostnames)/x">
+ <xsl:sort order="ascending" data-type="text" select="@hostname"/>
+ <xsl:variable name="hostname" select="@hostname"/>
+ <br/>
+ <h3><xsl:value-of select="$hostname"/></h3>
+ <table class="summary" rules="all" border="1">
+ <thead>
+ <tr>
+ <td/> <!-- was hostname -->
+ <xsl:for-each select="com:node-set($totals)/x[@show = 1]">
+ <td><b><xsl:value-of select="@text"/></b></td>
+ </xsl:for-each>
+ </tr>
+ </thead>
+ <tbody>
+ <xsl:for-each select="com:node-set($unique-fn2s)/x">
+ <xsl:sort order="ascending" data-type="text" select="@fn2"/>
+ <xsl:variable name="fn2" select="@fn2"/>
+ <xsl:for-each select="com:node-set($unique-generations)/x">
+ <xsl:sort order="ascending" data-type="text" select="@generation"/>
+ <xsl:variable name="generation" select="@generation"/>
+ <xsl:variable name="goodness" select="count(com:node-set($host-data)/x[@hostname = $hostname and @fn2 = $fn2 and @generation = $generation and @mood = 'good'])"/>
+ <xsl:variable name="badness" select="count(com:node-set($host-data)/x[@hostname = $hostname and @fn2 = $fn2 and @generation = $generation and @mood = 'bad'])"/>
+ <xsl:variable name="warnings" select="count(com:node-set($host-data)/x[@hostname = $hostname and @fn2 = $fn2 and @generation = $generation and @mood = 'warn'])"/>
+ <xsl:variable name="mood">
+ <xsl:choose>
+ <xsl:when test="$goodness != 0 and $warnings = 0 and $badness = 0">good</xsl:when>
+ <xsl:when test="$goodness + $warnings != 0">warn</xsl:when>
+ <xsl:otherwise>bad</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:if test="$goodness + $badness + $warnings">
+ <tr class="{$mood}">
+ <td><xsl:value-of select="concat($generation, ' ', $fn2)"/></td>
+ <xsl:for-each select="com:node-set($totals)/x[@show = 1]">
+ <xsl:variable name="label" select="@name"/>
+ <xsl:variable name="value" select="count(com:node-set($host-data)/x[@hostname = $hostname and @fn2 = $fn2 and @status = $label])"/>
+ <td>
+ <xsl:if test="$value != 0">
+ <xsl:value-of select="$value"/>
+ </xsl:if>
+ </td>
+ </xsl:for-each>
+ </tr>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:for-each>
+ </tbody>
+ </table>
+ </xsl:for-each>
+
+ <!-- "Problems" display -->
+ <xsl:if test="$show-problems != 0">
+ <br/>
+ <h2>Problems</h2>
+ <table class="problems" rules="all" border="1" >
+ <thead>
+ <tr>
+ <td class="status"><b>Status</b></td>
+ <td class="uri"><b>URI</b></td>
+ </tr>
+ </thead>
+ <tbody>
+ <xsl:for-each select="rcynic-summary/validation_status">
+ <xsl:variable name="status" select="@status"/>
+ <xsl:variable name="mood" select="/rcynic-summary/labels/*[name() = $status]/@kind"/>
+ <xsl:if test="$mood != 'good'">
+ <tr class="{$mood}">
+ <td class="status"><xsl:value-of select="/rcynic-summary/labels/*[name() = $status] "/></td>
+ <td class="uri"><xsl:value-of select="."/></td>
+ </tr>
+ </xsl:if>
+ </xsl:for-each>
+ </tbody>
+ </table>
+ </xsl:if>
</xsl:if>
<!-- Detailed status display -->
@@ -242,6 +268,7 @@
<thead>
<tr>
<td class="timestamp"><b>Timestamp</b></td>
+ <td class="generation"><b>Generation</b></td>
<td class="status"><b>Status</b></td>
<td class="uri"><b>URI</b></td>
</tr>
@@ -252,6 +279,7 @@
<xsl:variable name="mood" select="/rcynic-summary/labels/*[name() = $status]/@kind"/>
<tr class="{$mood}">
<td class="timestamp"><xsl:value-of select="@timestamp"/></td>
+ <td class="generation"><xsl:value-of select="@generation"/></td>
<td class="status"><xsl:value-of select="/rcynic-summary/labels/*[name() = $status] "/></td>
<td class="uri"><xsl:value-of select="."/></td>
</tr>