cziegeler    01/11/14 00:37:10

  Modified:    webapp/stylesheets/system status2html.xsl
  Log:
  [PATCH] Readable Memory status
  Submitted by: Sebastien Koechlin [[EMAIL PROTECTED]]
  
  Revision  Changes    Path
  1.3       +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.3
  diff -u -r1.2 -r1.3
  --- status2html.xsl   2001/05/23 12:32:21     1.2
  +++ status2html.xsl   2001/11/14 08:37:10     1.3
  @@ -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:     [EMAIL PROTECTED]
To unsubscribe, e-mail:          [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to