You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by cz...@apache.org on 2001/11/14 09:36:42 UTC

cvs commit: xml-cocoon2/webapp/stylesheets/system status2html.xsl

cziegeler    01/11/14 00:36:42

  Modified:    webapp/stylesheets/system Tag: cocoon_20_branch
                        status2html.xsl
  Log:
  [PATCH] Readable Memory status
  Submitted by: Sebastien Koechlin [skoechlin@ivision.fr]
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.2.2.1   +42 -0     xml-cocoon2/webapp/stylesheets/system/status2html.xsl
  
  Index: status2html.xsl
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/webapp/stylesheets/system/status2html.xsl,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  --- status2html.xsl	2001/05/23 12:32:21	1.2
  +++ status2html.xsl	2001/11/14 08:36:42	1.2.2.1
  @@ -86,4 +86,46 @@
       </tr>
   
     </xsl:template>
  +
  +
  +	<xsl:template match="status:value[../@status:name='memory' and ( @status:name='total' or @status:name='free')]">
  +		<tr>
  +			<td bgcolor="#0086b2" valign="top" align="left">
  +			 <FONT face="arial,helvetica,sanserif" color="#ffffff">
  +				<xsl:value-of select="@status:name"/>
  +			 </FONT>
  +			</td>
  +			<td bgcolor="ffffff" width="100%">
  +			 <FONT face="arial,helvetica,sanserif">
  +				<xsl:call-template name="suffix">
  +					<xsl:with-param 
  +						name="bytes" 
  +						select="number(.)"/>
  +				</xsl:call-template>
  +			 </FONT>
  +			</td>
  +		</tr>
  +	</xsl:template>
  +
  +	<xsl:template name="suffix">
  +		<xsl:param name="bytes"/>
  +		<xsl:choose>
  +			<!-- More than 4 MB (=4194304) -->
  +			<xsl:when test="$bytes &gt;= 4194304">
  +				<xsl:value-of select="round($bytes div 10485.76) div 100"/> MB
  +				<small>(<xsl:value-of select="$bytes"/>)</small>
  +			</xsl:when>
  +			<!-- More than 4 KB (=4096) -->
  +			<xsl:when test="$bytes &gt; 4096">
  +				<xsl:value-of select="round($bytes div 10.24) div 100"/> KB
  +				<small>(<xsl:value-of select="$bytes"/>)</small>
  +			</xsl:when>
  +			<!-- Less -->
  +			<xsl:otherwise>
  +				<xsl:value-of select="$bytes"/> B
  +			</xsl:otherwise>
  +		</xsl:choose>
  +	</xsl:template>
  +
  +
   </xsl:stylesheet>
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org