| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- <?xml version="1.0" encoding="UTF-8"?>
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exsl="http://exslt.org/common" xmlns:func="http://exslt.org/functions" xmlns:str="http://exslt.org/strings" exclude-result-prefixes="exsl func" extension-element-prefixes="exsl func str">
- <xsl:output method="xml"/>
- <func:function name="func:iif">
- <!-- like a sql iif(coondition, ifTrue, ifFalse)
- returns ifTrue if condition=true() else ifFalse
- -->
- <xsl:param name="condition"/>
- <xsl:param name="ifTrue"/>
- <xsl:param name="ifFalse"/>
- <xsl:variable name="result">
- <xsl:choose>
- <xsl:when test="$condition=true()">
- <xsl:value-of select="$ifTrue"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$ifFalse"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <func:result select="$result"/>
- </func:function>
-
- <xsl:template match="/">
- <html>
- <body>
- <table width="100%%" style="border: 1px solid rgb(204, 204, 204);font: 13px Verdana">
- <thead style="background-color: silver">
- <tr>
- <td/>
- <td>Server</td>
- <td>Description</td>
- <td>Status</td>
- <!--<td>Grid</td>
- <td>TEMP</td>-->
- </tr>
- </thead>
- <tbody>
- <xsl:for-each select="/root/data/servers/group">
- <tr>
- <td colspan="9" style="margin-left:20px;font-weight:bold;background-color:#eee;">
- <xsl:value-of select="@desc"/>
- <span> [<xsl:value-of select="count(server)"/>]</span>
- </td>
- </tr>
- <xsl:for-each select="server">
- <tr>
- <td style="width:20px">
- <a href="{@url}/server_status">
- <img src="{@url}/domainresource/static/graphics/favicon.ico" height="16" width="16" style="margin-right: 10px;"/>
- </a>
- </td>
- <td>
- <a href="{@url}">
- <xsl:value-of select="@url"/>
- </a>
- </td>
- <td align="right">
- <xsl:value-of select="@description"/>
- </td>
- <td>
- <xsl:choose>
- <xsl:when test="@error='true' and @message!='not contacted'">
- <xsl:attribute name="style">background-color: rgb(255, 136, 136)</xsl:attribute>
- <xsl:attribute name="colspan">20</xsl:attribute>
- <xsl:value-of select="@message"/>
- </xsl:when>
- <xsl:when test="@error='true' and @message='not contacted'">
- <xsl:attribute name="style">background-color: rgb(230, 230, 210)</xsl:attribute>
- <xsl:attribute name="colspan">20</xsl:attribute>
- <xsl:value-of select="@message"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="style">background-color: rgb(136, 251, 102)</xsl:attribute>
- <xsl:text>OK</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </td>
- <!--
- <xsl:if test="@error!='true'">
- <td align="center">
- <a href="vlx://grid?name=MyGrid&server={@name}">[grid]</a>
- </td>
- <td align="center">
- <a href="/grid?name=MyGrid&server={@name}">[grid]</a>
- </td>
- </xsl:if>
- -->
- </tr>
- </xsl:for-each>
-
- </xsl:for-each>
- </tbody>
- </table>
- </body>
- </html>
- </xsl:template>
- </xsl:stylesheet>
|