improved stylesheet

This commit is contained in:
Roman Arutyunyan
2012-05-10 16:35:29 +04:00
parent d82c16499d
commit e572e242c2

164
stat.xsl
View File

@ -3,90 +3,128 @@
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/"> <xsl:template match="/">
<html> <html>
<head><title>RTMP statistics</title></head> <head>
<body> <title>RTMP statistics</title>
<xsl:apply-templates select="rtmp"/> </head>
<hr/> <body>
Generated by <a href='https://github.com/arut/nginx-rtmp-module'>NGINX RTMP module</a> <xsl:apply-templates select="rtmp"/>
</body></html> <hr/>
Generated by <a href='https://github.com/arut/nginx-rtmp-module'>NGINX RTMP module</a>
</body>
</html>
</xsl:template> </xsl:template>
<xsl:template match="rtmp"> <xsl:template match="rtmp">
<table cellspacing="1" cellpadding="5"> <table cellspacing="1" cellpadding="5">
<tr bgcolor="#999999"> <tr bgcolor="#999999">
<th>RTMP</th> <th>RTMP</th>
<th>#clients</th> <th>#clients</th>
<th>In bytes</th> <th>In bytes</th>
<th>Out bytes</th> <th>Out bytes</th>
<th>In Kbps</th> <th>In Kbps</th>
<th>Out Kbps</th> <th>Out Kbps</th>
<th>State</th> <th>State</th>
<th>Address</th> </tr>
<th>Flash version</th> <tr>
<th>Page URL</th> <td colspan="2"/>
<th>Dropped</th> <td><xsl:value-of select="in"/></td>
<th bgcolor="#ffffff"></th> <td><xsl:value-of select="out"/></td>
</tr> <td><xsl:value-of select="round(bwin div 1024)"/></td>
<tr> <td><xsl:value-of select="round(bwout div 1024)"/></td>
<td colspan="2"/> <td><xsl:apply-templates select="publishing"/></td>
<td><xsl:value-of select="in"/></td> </tr>
<td><xsl:value-of select="out"/></td> <xsl:apply-templates select="server"/>
<td><xsl:value-of select="round(bwin div 1024)"/></td> </table>
<td><xsl:value-of select="round(bwout div 1024)"/></td>
<td><xsl:apply-templates select="publishing"/></td>
</tr>
<xsl:apply-templates select="server"/>
</table>
</xsl:template> </xsl:template>
<xsl:template match="server"> <xsl:template match="server">
<xsl:apply-templates select="application"/> <xsl:apply-templates select="application"/>
</xsl:template> </xsl:template>
<xsl:template match="application"> <xsl:template match="application">
<tr bgcolor="#999999"> <tr bgcolor="#999999">
<td><b><xsl:value-of select="name"/></b></td> <td>
</tr> <b><xsl:value-of select="name"/></b>
<xsl:apply-templates select="live"/> </td>
</tr>
<xsl:apply-templates select="live"/>
</xsl:template> </xsl:template>
<xsl:template match="live"> <xsl:template match="live">
<tr bgcolor="#aaaaaa"> <tr bgcolor="#aaaaaa">
<td><i>live streams</i></td> <td>
<td align="middle"><xsl:value-of select="nclients"/></td> <i>live streams</i>
</tr> </td>
<xsl:apply-templates select="stream"/> <td align="middle">
<xsl:value-of select="nclients"/>
</td>
</tr>
<xsl:apply-templates select="stream"/>
</xsl:template> </xsl:template>
<xsl:template match="stream"> <xsl:template match="stream">
<tr valign="top" bgcolor="#cccccc"> <tr valign="top" bgcolor="#cccccc">
<td><xsl:value-of select="name"/></td> <td>
<td align="middle"><xsl:value-of select="nclients"/></td> <xsl:value-of select="name"/>
<td><xsl:value-of select="in"/></td> </td>
<td><xsl:value-of select="out"/></td> <td align="middle">
<td><xsl:value-of select="round(bwin div 1024)"/></td> <xsl:value-of select="nclients"/>
<td><xsl:value-of select="round(bwout div 1024)"/></td> </td>
<td><xsl:apply-templates select="publishing"/></td> <td>
<td bgcolor="#ffffff"> <xsl:value-of select="in"/>
<xsl:apply-templates select="client"/> </td>
</td> <td>
</tr> <xsl:value-of select="out"/>
</td>
<td>
<xsl:value-of select="round(bwin div 1024)"/>
</td>
<td>
<xsl:value-of select="round(bwout div 1024)"/>
</td>
<td>
<xsl:apply-templates select="publishing"/>
</td>
</tr>
<tr>
<td colspan="7" ngcolor="#eeeeee">
<table cellspacing="1" cellpadding="5">
<tr>
<th>State</th>
<th>Address</th>
<th>Flash version</th>
<th>Page URL</th>
<th>Dropped</th>
</tr>
<xsl:apply-templates select="client"/>
</table>
</td>
</tr>
</xsl:template> </xsl:template>
<xsl:template match="client"> <xsl:template match="client">
<tr bgcolor="#eeeeee"> <tr bgcolor="#eeeeee">
<td colspan="6" bgcolor="#ffffff"/> <td>
<td><xsl:apply-templates select="publishing"/></td> <xsl:apply-templates select="publishing"/>
<td><xsl:value-of select="address"/></td> </td>
<td><xsl:value-of select="flashver"/></td> <td>
<td><xsl:value-of select="pageurl"/></td> <xsl:value-of select="address"/>
<td><xsl:value-of select="dropped"/></td> </td>
</tr> <td>
<xsl:value-of select="flashver"/>
</td>
<td>
<xsl:value-of select="pageurl"/>
</td>
<td>
<xsl:value-of select="dropped"/>
</td>
</tr>
</xsl:template> </xsl:template>
<xsl:template match="publishing"> <xsl:template match="publishing">
publishing publishing
</xsl:template> </xsl:template>
</xsl:stylesheet> </xsl:stylesheet>