summaryrefslogtreecommitdiffstats
path: root/reports/xsl-transforms/nodes-digest-www.xsl
blob: eb5fc8b838613c2585bc6ff4c095835fed128c74 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<?xml version="1.0"?> 
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
                xmlns="http://www.w3.org/1999/xhtml">
    <xsl:include href="xsl-transform-includes/html-templates.xsl" />
    <xsl:include href="xsl-transform-includes/main-js.xsl" />
    <xsl:include href="xsl-transform-includes/boxypastel-css.xsl" />
    <xsl:output method="xml" media-type="text/html" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
    <xsl:template match="Report">
        <xsl:variable name="cleannodes" select="/Report/Node[count(Statistics/Good)>0]"/>
        <xsl:variable name="dirtynodes" select="/Report/Node[count(Statistics/Bad)>0]"/>
        <xsl:variable name="modifiednodes" select="/Report/Node[count(Statistics/Modified)>0]"/>
        <xsl:variable name="stalenodes" select="/Report/Node[count(Statistics/Stale)>0]"/>
        <xsl:variable name="unpingablenodes" select="/Report/Node[Client/@pingable='N']"/>
        <xsl:variable name="pingablenodes" select="/Report/Node[Client/@pingable='Y']"/>
    
        <html>
              <head>
                    <title>
                        <xsl:choose>
                            <xsl:when test="count(/Report/Node/Statistics/Bad) > 0">BCFG Status (<xsl:value-of select="@name" />)</xsl:when>
                            <xsl:otherwise>BCFG Status (<xsl:value-of select="@name" />)</xsl:otherwise>
                        </xsl:choose>
                    </title>
                    <xsl:if test="count(/Report/@refresh-time) > 0">
			<META HTTP-EQUIV="Refresh" CONTENT="{@refresh-time}"/>
                    </xsl:if>
                    <xsl:copy-of select="$boxypastel-css" />
                    <xsl:copy-of select="$main-js" />
              </head>
              <body bgcolor="#ffffff">
                    <div class="header">
                        <h1>
                            <xsl:choose>
                                <xsl:when test="count(/Report/Node/Statistics/Bad) > 0">
                                    BCFG Status (<xsl:value-of select="@name" />)
                                </xsl:when>
                                <xsl:otherwise>
                                    BCFG Status (<xsl:value-of select="@name" />)
                                </xsl:otherwise>
                            </xsl:choose>
                        </h1><span class="notebox">Report Run @ <xsl:value-of select="@time" /></span>
                    </div>
                    <div class="nodebox">
                        <h2>Summary:</h2>

                        <p class="indented"><xsl:value-of select="count(/Report/Node)" /> Nodes were included in your report.</p>
                        <xsl:if test="count(/Report/Node/Statistics/Good) > 0">
                            <div class="clean">
                                <span class="nodelisttitle"><a href="javascript:toggleLayer('goodsummary');" title="Click to Expand" class="commentLink"><xsl:value-of select="count(/Report/Node/Statistics/Good)" /></a> nodes are clean.<br /></span>
                                <div class="items" id="goodsummary"><ul class="plain">                                    
                                    
                                    <xsl:for-each select="Node">
                                        <xsl:sort select="Client/@name"/>
                                        <xsl:if test="count(Statistics/Good) > 0">
                                            <li><b>Node: </b>
                                            <tt><a href="#{Client/@name}"><xsl:value-of select="Client/@name" /></a></tt><span class="mini-date"><xsl:value-of select="Statistics/@time" /></span></li>
                                        </xsl:if>
                                    </xsl:for-each>
                                </ul></div>
                            </div>
                         </xsl:if>
                         
                         <xsl:if test="count(/Report/Node/Statistics/Bad) > 0">
                            <div class="bad">
                                <span class="nodelisttitle"><a href="javascript:toggleLayer('badsummary');" title="Click to Expand" class="commentLink"><xsl:value-of select="count(/Report/Node/Statistics/Bad)" /></a> nodes are bad.<br /></span>
                                
                                <div class="items" id="badsummary"><ul class="plain">
                                    <xsl:for-each select="Node">
                                        <xsl:sort select="Client/@name"/>
                                        <xsl:if test="count(Statistics/Bad) > 0">
                                            <li><b>Node: </b>
                                            <tt><a href="#{Client/@name}"><xsl:value-of select="Client/@name" /></a></tt><span class="mini-date"><xsl:value-of select="Statistics/@time" /></span></li>
                                        </xsl:if>
                                    </xsl:for-each>
                                </ul></div>
                            </div>
                         </xsl:if>

                         <xsl:if test="count(/Report/Node/Statistics/Extra) > 0">
                            <div class="extra">
                                <span class="nodelisttitle"><a href="javascript:toggleLayer('extrasummary');" title="Click to Expand" class="commentLink"><xsl:value-of select="count(/Report/Node/Statistics/Extra)" /></a> nodes have extra configuration. (includes both good and bad nodes)<br /></span>
                                <div class="items" id="extrasummary"><ul class="plain">
                                    <xsl:for-each select="Node">
                                        <xsl:sort select="Client/@name"/>
                                        <xsl:if test="count(Statistics/Extra) > 0">
                                            <li><b>Node: </b>
                                            <tt><a href="#{Client/@name}"><xsl:value-of select="Client/@name" /></a></tt><span class="mini-date"><xsl:value-of select="Statistics/@time" /></span></li>
                                        </xsl:if>
                                    </xsl:for-each>
                                </ul></div>

                            </div>
                         </xsl:if>
                        
                        <xsl:if test="count(/Report/Node/Statistics/Modified) > 0">
                            <div class="modified">
                                <span class="nodelisttitle"><a href="javascript:toggleLayer('modifiedsummary');" title="Click to Expand" class="commentLink"><xsl:value-of select="count(/Report/Node/Statistics/Modified)" /></a> nodes were modified in the last run. (includes both good and bad nodes)<br /></span>
                                
                                <div class="items" id="modifiedsummary"><ul class="plain">
                                    <xsl:for-each select="Node">
                                        <xsl:sort select="Client/@name"/>
                                        <xsl:if test="count(Statistics/Modified) > 0">
                                            <li><b>Node: </b>
                                            <tt><a href="#{Client/@name}"><xsl:value-of select="Client/@name" /></a></tt><span class="mini-date"><xsl:value-of select="Statistics/@time" /></span></li>
                                        </xsl:if>
                                    </xsl:for-each>
                                </ul></div>
                            </div>
                         </xsl:if>

                        <xsl:if test="count($stalenodes[count(.|$pingablenodes)= count($pingablenodes)]) > 0">
                            <div class="warning">
                                <span class="nodelisttitle"><a href="javascript:toggleLayer('vstalesummary');" title="Click to Expand" class="commentLink"><xsl:value-of select="count($stalenodes[count(.|$pingablenodes)= count($pingablenodes)])" /></a> nodes did not run within the last 24 hours but were pingable.<br /></span>
                                <div class="items" id="vstalesummary"><ul class="plain">
                                    <xsl:for-each select="Node">
                                        <xsl:sort select="Client/@name"/>
                                        <xsl:if test="count(Statistics/Stale)-count(Client[@pingable='N']) > 0">
                                            <li><b>Node: </b>
                                            <tt><a href="#{Client/@name}"><xsl:value-of select="Client/@name" /></a></tt><span class="mini-date"><xsl:value-of select="Statistics/@time" /></span></li>
                                        </xsl:if>
                                    </xsl:for-each>
                                </ul></div>
                            </div>
                         </xsl:if>                            

                        <xsl:if test="count(/Report/Node/Statistics/Stale) > 0">
                            <div class="all-warning">
                                <span class="nodelisttitle"><a href="javascript:toggleLayer('stalesummary');" title="Click to Expand" class="commentLink"><xsl:value-of select="count(/Report/Node/Statistics/Stale)" /></a> nodes did not run within the last 24 hours. (includes nodes up and down)<br /></span>
                                
                                <div class="items" id="stalesummary"><ul class="plain">
                                    <xsl:for-each select="Node">
                                        <xsl:sort select="Client/@name"/>
                                        <xsl:if test="count(Statistics/Stale) > 0">
                                            <li><b>Node: </b>
                                            <tt><a href="#{Client/@name}"><xsl:value-of select="Client/@name" /></a></tt><span class="mini-date"><xsl:value-of select="Statistics/@time" /></span></li>
                                        </xsl:if>
                                    </xsl:for-each>
                                </ul></div>

                            </div>
                         </xsl:if>

                        <xsl:if test="count(/Report/Node[Client/@pingable='N']) > 0">
                            <div class="down">
                                <span class="nodelisttitle"><a href="javascript:toggleLayer('unpingablesummary');" title="Click to Expand" class="commentLink"><xsl:value-of select="count(/Report/Node/Client[@pingable='N'])" /></a> nodes were down.<br /></span>
                                
                                <div class="items" id="unpingablesummary"><ul class="plain">
                                    <xsl:for-each select="Node">
                                        <xsl:sort select="Client/@name"/>
                                        <xsl:if test="count(Client[@pingable='N']) > 0">
                                            <li><b>Node: </b>
                                            <tt><a href="#{Client/@name}"><xsl:value-of select="Client/@name" /></a></tt><span class="mini-date"><xsl:value-of select="Statistics/@time" /></span></li>
                                        </xsl:if>
                                    </xsl:for-each>
                                </ul></div>
                            </div>
                        </xsl:if>




                    </div>
                    
                    <xsl:apply-templates select="Node">
                        <xsl:sort select="Statistics/@state" order="descending"/>
                        <xsl:sort select="@name"/>
                    </xsl:apply-templates>
            <br/>
            <br/>
            <p>
                <a href="http://validator.w3.org/check?uri=referer">Valid XHTML 1.0!</a>
            </p>
            </body>
        </html>
    </xsl:template>
</xsl:stylesheet>