관리-도구
편집 파일: WebStatisticsPlugin.xsl
<?xml version="1.0" encoding="UTF-8"?> <xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html" indent="yes" omit-xml-declaration="yes"/> <xsl:template match="/"> <html> <xsl:variable name="reverseProxy"><xsl:value-of select="listing/props/reverseProxy"/></xsl:variable> <head> <title>WebStatistics</title> <link href="/WebInterface/style.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="{$reverseProxy}/WebInterface/crushftp_functions.js"></script> <meta http-equiv="refresh" content="300;URL=" /> </head> <body bgcolor="#CCCCCC"> <xsl:comment> start div </xsl:comment> <div id="pathdivcontainer"> <center> <font size="-2"><a href="javascript:doLogout();">Logout</a><br/></font> Server IP : <xsl:value-of select="listing/webstatistics/server_ip"/> , <xsl:value-of select="listing/webstatistics/version_info_str"/><xsl:value-of select="listing/webstatistics/sub_version_info_str"/><br/> Started At: <xsl:value-of select="listing/webstatistics/server_start_time"/> </center> <div style="visibility:hidden; position:absolute;"> <form name="crushftp_action" enctype="multipart/form-data" method="post"> <input type="hidden" name="the_action" value="" /> <input type="hidden" name="item1" value="" /> <input type="hidden" name="item2" value="" /> <input type="hidden" name="item3" value="" /> </form> </div> <div id="pathdiv"> <table width="100%"> <tr> <td> <table align="center"> <tr> <td nowrap="nowrap" onMouseOver="startHover(this);" onMouseout="endHover(this);"> <xsl:call-template name="formatBytes"><xsl:with-param name="data" select="listing/webstatistics/total_server_bytes_transfered" /></xsl:call-template> total, <xsl:value-of select="listing/webstatistics/total_logins"/> logins, <xsl:value-of select="listing/webstatistics/uploaded_files + listing/webstatistics/downloaded_files"/> transfers. <div style="position:absolute; display:none; z-index:5; background-color:#F8C070;"><table cellpadding="5"><tr><td> <font size="-2"> <xsl:call-template name="formatBytes"><xsl:with-param name="data" select="listing/webstatistics/total_server_bytes_sent" /></xsl:call-template> out, <xsl:call-template name="formatBytes"><xsl:with-param name="data" select="listing/webstatistics/total_server_bytes_received" /></xsl:call-template> in. <br/> <xsl:value-of select="listing/webstatistics/successful_logins"/> accepted, <xsl:value-of select="listing/webstatistics/failed_logins"/> denied. <br/> <xsl:value-of select="listing/webstatistics/downloaded_files"/> downloads, <xsl:value-of select="listing/webstatistics/uploaded_files"/> uploads. </font> </td></tr></table></div> </td> </tr> <tr> <td nowrap="nowrap"> Incoming <xsl:call-template name="formatBytes"><xsl:with-param name="data" select="listing/webstatistics/current_upload_speed * 1024" /></xsl:call-template>/sec, Outgoing <xsl:call-template name="formatBytes"><xsl:with-param name="data" select="listing/webstatistics/current_download_speed * 1024" /></xsl:call-template>/sec </td> </tr> </table> </td> </tr> </table> <center> Last User : <i><xsl:value-of select="listing/webstatistics/last_login_user"/></i> from <i><xsl:value-of select="listing/webstatistics/last_login_ip"/></i> at <i><xsl:value-of select="substring-after(listing/webstatistics/last_login_date_time,' ')"/></i> </center> <div class="ClearFloatHack"> </div> </div> </div> <xsl:comment> end div </xsl:comment> <div id="contentDiv"> <center> <table cellpadding="3"> <tr> <td id="serverInfoTD" onclick="selectTab(this.id);" onMouseOver="if (!window.widget) this.style.cursor = 'hand';if (!window.widget) this.style.cursor = 'pointer'; " bgColor="#F8A050">Server Info</td> <td id="recentUsersTD" onclick="selectTab(this.id);" onMouseOver="if (!window.widget) this.style.cursor = 'hand';if (!window.widget) this.style.cursor = 'pointer'; " bgColor="#F8C070">Recent Users</td> <td id="recentUploadsTD" onclick="selectTab(this.id);" onMouseOver="if (!window.widget) this.style.cursor = 'hand';if (!window.widget) this.style.cursor = 'pointer'; " bgColor="#F8C070">Recent Uploads</td> <td id="recentDownloadsTD" onclick="selectTab(this.id);" onMouseOver="if (!window.widget) this.style.cursor = 'hand';if (!window.widget) this.style.cursor = 'pointer'; " bgColor="#F8C070">Recent Downloads</td> </tr> </table> <table cellspacing="0" cellpadding="0"> <tr> <td> <div id="resultDiv"> </div> </td> </tr> </table> </center> </div> <xsl:comment> start div </xsl:comment> <div id="serverInfo" style="width:1px; height:1px; display:none; position:absolute; visibility:hidden;"> <A NAME="serverInfo"></A> <table border="0" cellspacing="0" cellpadding="5"> <tr> <td><b>Protocol</b></td> <td><b>Port</b></td> <td><b>Connected</b></td> <td><b>Processed</b></td> </tr> <xsl:for-each select="listing/webstatistics/server_list/server_list_subitem"> <tr> <td nowrap="nowrap" onMouseOver="startHover(this);" onMouseout="endHover(this);"> <font size="-2"><xsl:value-of select="serverType"/></font> <div style="position:absolute; display:none; z-index:5; background-color:#F8C070;"><table cellpadding="5"><tr><td> <font size="-2"> IP:<xsl:value-of select="ip"/> <br/> <xsl:choose> <xsl:when test="string-length(linkedServer) = 0"> </xsl:when> <xsl:otherwise> Users linked to:<xsl:value-of select="linkedServer"/> </xsl:otherwise> </xsl:choose> </font> </td></tr></table></div> </td> <td nowrap="nowrap"><font size="-2"><xsl:value-of select="port"/></font></td> <td nowrap="nowrap" onMouseOver="startHover(this);" onMouseout="endHover(this);"> <font size="-2"><xsl:value-of select="connected_users"/></font> <div style="position:absolute; display:none; z-index:5; background-color:#F8C070;"><table cellpadding="5"><tr><td> <font size="-2"><xsl:value-of select="display"/></font> </td></tr></table></div> </td> <td nowrap="nowrap" onMouseOver="startHover(this);" onMouseout="endHover(this);"> <font size="-2"><xsl:value-of select="connection_number"/></font> <div style="position:absolute; display:none; z-index:5; background-color:#F8C070;"><table cellpadding="5"><tr><td> <font size="-2"><xsl:value-of select="display"/></font> </td></tr></table></div> </td> </tr> </xsl:for-each> </table> </div> <xsl:comment> end div </xsl:comment> <xsl:comment> start div </xsl:comment> <div id="recentUsers" style="width:1px; height:1px; display:none; position:absolute; visibility:hidden;"> <A NAME="recentUsers"></A> <table border="0" cellspacing="0" cellpadding="5"> <tr> <td><b>Date</b></td> <td><b>User</b></td> <td><b>IP</b></td> <td><b>Status</b></td> <td><b>Uploads</b></td> <td><b>Downloads</b></td> </tr> <xsl:for-each select="listing/webstatistics/recent_users/recent_users_subitem"> <tr> <td nowrap="nowrap" onMouseOver="startHover(this);" onMouseout="endHover(this);"> <font size="-2"><xsl:value-of select="substring-after(login_date_formatted,' ')"/></font> <div style="position:absolute; display:none; z-index:5; background-color:#F8C070;"><table cellpadding="5"><tr><td> <font size="-2"><xsl:value-of select="login_date_formatted"/></font> </td></tr></table></div> </td> <td nowrap="nowrap"><font size="-2"><xsl:value-of select="user_name"/></font></td> <td nowrap="nowrap" onMouseOver="startHover(this);" onMouseout="endHover(this);"> <font size="-2"><xsl:value-of select="user_ip"/></font> <div style="position:absolute; display:none; z-index:5; background-color:#F8C070;"><table cellpadding="5"><tr><td> <font size="-2"><xsl:value-of select="user_protocol"/></font> </td></tr></table></div> </td> <td nowrap="nowrap" onMouseOver="startHover(this);" onMouseout="endHover(this);"> <xsl:value-of select="status"/> <div style="position:absolute; display:none; z-index:5; background-color:#F8C070;"><table cellpadding="5"><tr><td> <font size="-2"> <xsl:choose> <xsl:when test="status = 'active'"> <xsl:choose> <xsl:when test="receiving_file = 'true'">Uploading <xsl:value-of select="last_file_name"/></xsl:when> <xsl:when test="sending_file = 'true'">Downloading <xsl:value-of select="last_file_name"/></xsl:when> <xsl:otherwise>Idle</xsl:otherwise> </xsl:choose> <xsl:choose> <xsl:when test="seconds_remaining > 0"> : <xsl:value-of select="seconds_remaining"/> seconds remaining.</xsl:when> </xsl:choose> </xsl:when> <xsl:otherwise>Disconnected</xsl:otherwise> </xsl:choose> </font> </td></tr></table></div> </td> <td nowrap="nowrap" onMouseOver="startHover(this);" onMouseout="endHover(this);"> <font size="-2"><xsl:value-of select="session_upload_count"/></font> <xsl:choose> <xsl:when test="session_upload_count > 0"> <div style="position:absolute; display:none; z-index:5; background-color:#F8C070;"><table cellpadding="5"><tr><td> <table border="0" cellspacing="0" cellpadding="5"> <tr> <td><font size="-2"><b>Date</b></font></td> <td><font size="-2"><b>File</b></font></td> <td><font size="-2"><b>Speed</b></font></td> </tr> <xsl:for-each select="session_commands/session_commands_subitem[the_command='STOR']"> <tr> <td nowrap="nowrap"><font size="-2"><xsl:value-of select="substring-after(user_time,' ')"/></font></td> <td nowrap="nowrap"><font size="-2"><xsl:value-of select="the_file_path"/><xsl:value-of select="the_file_name"/></font></td> <td nowrap="nowrap"><font size="-2">(<xsl:call-template name="formatBytes"><xsl:with-param name="data" select="the_file_size" /></xsl:call-template> @ <xsl:call-template name="formatBytes"><xsl:with-param name="data" select="the_file_speed * 1024" /></xsl:call-template>/sec)</font></td> </tr> </xsl:for-each> </table> </td></tr></table></div> </xsl:when> <xsl:otherwise><div></div></xsl:otherwise> </xsl:choose> </td> <td nowrap="nowrap" onMouseOver="startHover(this);" onMouseout="endHover(this);"> <font size="-2"><xsl:value-of select="session_download_count"/></font> <xsl:choose> <xsl:when test="session_download_count > 0"> <div style="position:absolute; display:none; z-index:5; background-color:#F8C070;"><table cellpadding="5"><tr><td> <table border="0" cellspacing="0" cellpadding="5"> <tr> <td><font size="-2"><b>Date</b></font></td> <td><font size="-2"><b>File</b></font></td> <td><font size="-2"><b>Speed</b></font></td> </tr> <xsl:for-each select="session_commands/session_commands_subitem[the_command='RETR']"> <tr> <td nowrap="nowrap"><font size="-2"><xsl:value-of select="substring-after(user_time,' ')"/></font></td> <td nowrap="nowrap"><font size="-2"><xsl:value-of select="the_file_path"/><xsl:value-of select="the_file_name"/></font></td> <td nowrap="nowrap"><font size="-2">(<xsl:call-template name="formatBytes"><xsl:with-param name="data" select="the_file_size" /></xsl:call-template> @ <xsl:call-template name="formatBytes"><xsl:with-param name="data" select="the_file_speed * 1024" /></xsl:call-template>/sec)</font></td> </tr> </xsl:for-each> </table> </td></tr></table></div> </xsl:when> <xsl:otherwise><div></div></xsl:otherwise> </xsl:choose> </td> </tr> </xsl:for-each> </table> </div> <xsl:comment> end div </xsl:comment> <xsl:comment> start div </xsl:comment> <div id="recentUploads" style="width:1px; height:1px; display:none; position:absolute; visibility:hidden;"> <A NAME="recentUploads"></A> <table border="0" cellspacing="0" cellpadding="5"> <tr> <td><b>Date</b></td> <td><b>User</b></td> <td><b>File</b></td> <td><b>Speed</b></td> </tr> <xsl:for-each select="listing/webstatistics/recent_users/recent_users_subitem/session_commands/session_commands_subitem[the_command='STOR']"> <tr> <td nowrap="nowrap" onMouseOver="startHover(this);" onMouseout="endHover(this);"> <font size="-2"><xsl:value-of select="substring-after(user_time,' ')"/></font> <div style="position:absolute; display:none; z-index:5; background-color:#F8C070;"><table cellpadding="5"><tr><td> <font size="-2"><xsl:value-of select="user_time"/></font> </td></tr></table></div> </td> <td nowrap="nowrap"><font size="-2"><xsl:value-of select="../../user_name"/></font></td> <td nowrap="nowrap" onMouseOver="startHover(this);" onMouseout="endHover(this);"> <font size="-2"><xsl:value-of select="the_file_path"/><xsl:value-of select="the_file_name"/></font> <div style="position:absolute; display:none; z-index:5; background-color:#F8C070;"><table cellpadding="5"><tr><td> <font size="-2"><xsl:value-of select="url"/></font> </td></tr></table></div> </td> <td nowrap="nowrap"><font size="-2">(<xsl:call-template name="formatBytes"><xsl:with-param name="data" select="the_file_size" /></xsl:call-template> @ <xsl:call-template name="formatBytes"><xsl:with-param name="data" select="the_file_speed * 1024" /></xsl:call-template>/sec)</font></td> </tr> </xsl:for-each> </table> </div> <xsl:comment> end div </xsl:comment> <xsl:comment> start div </xsl:comment> <div id="recentDownloads" style="width:1px; height:1px; display:none; position:absolute; visibility:hidden;"> <A NAME="recentDownloads"></A> <table border="0" cellspacing="0" cellpadding="5"> <tr> <td><b>Date</b></td> <td><b>User</b></td> <td><b>File</b></td> <td><b>Speed</b></td> </tr> <xsl:for-each select="listing/webstatistics/recent_users/recent_users_subitem/session_commands/session_commands_subitem[the_command='RETR']"> <tr> <td nowrap="nowrap" onMouseOver="startHover(this);" onMouseout="endHover(this);"> <font size="-2"><xsl:value-of select="substring-after(user_time,' ')"/></font> <div style="position:absolute; display:none; z-index:5; background-color:#F8C070;"><table cellpadding="5"><tr><td> <font size="-2"><xsl:value-of select="user_time"/></font> </td></tr></table></div> </td> <td nowrap="nowrap"><font size="-2"><xsl:value-of select="../../user_name"/></font></td> <td nowrap="nowrap" onMouseOver="startHover(this);" onMouseout="endHover(this);"> <font size="-2"><xsl:value-of select="the_file_path"/><xsl:value-of select="the_file_name"/></font> <div style="position:absolute; display:none; z-index:5; background-color:#F8C070;"><table cellpadding="5"><tr><td> <font size="-2"><xsl:value-of select="url"/></font> </td></tr></table></div> </td> <td nowrap="nowrap"><font size="-2">(<xsl:call-template name="formatBytes"><xsl:with-param name="data" select="the_file_size" /></xsl:call-template> @ <xsl:call-template name="formatBytes"><xsl:with-param name="data" select="the_file_speed * 1024" /></xsl:call-template>/sec)</font></td> </tr> </xsl:for-each> </table> </div> <xsl:comment> end div </xsl:comment> <form method="post" action="" id="testForm" target="_self" enctype="multipart/form-data"></form> <script type="text/javascript"> selectedTD = document.getElementById("serverInfoTD"); if (document.location.href.indexOf("#") != -1) { var tab = document.location.href.substring(document.location.href.indexOf("#")+1); selectTab(tab+"TD", true); } else { changeDiv('serverInfo','resultDiv'); } function selectTab(id, skipUrl) { var obj = document.getElementById(id); changeDiv(id.substring(0,id.length-2),'resultDiv'); selectedTD.bgColor='#F8C070'; selectedTD=obj; obj.bgColor='#F8A050'; if (skipUrl) { createCookie("webstatisticsUrl",document.location.href); setTimeout("reloadPage();",300*1000); return; } var f = document.getElementById("testForm"); f.action = "#" + id.substring(0,id.length-2); f.submit(); } function reloadPage() { var webstatisticsUrl = readCookie('webstatisticsUrl'); if (webstatisticsUrl != null) { if (webstatisticsUrl != "") { var f = document.getElementById("testForm"); f.action = webstatisticsUrl; f.submit(); } } } function changeDiv(src, dest) { document.getElementById(dest).innerHTML = document.getElementById(src).innerHTML; } var curNode; function startHover(obj) { tooltip(obj.childNodes[obj.childNodes.length-2]); } function endHover(obj) { exit(); } var offsetx = 12; var offsety = 8; var tooltipDiv = ""; var ie5 = false; var ns6 = false; if (document.getElementById){ if(document.all) ie5 = true;} if (document.getElementById){ if(!document.all) ns6 = true;} var ua = navigator.userAgent.toLowerCase(); var isapple = (ua.indexOf('applewebkit') != -1 ? 1 : 0); function getmouseposition(e) { if(document.getElementById) { var iebody=""; if (document.compatMode) { if(document.compatMode != 'BackCompat') iebody = document.documentElement; else iebody = document.body; } else iebody = document.body; pagex = (isapple == 1 ? 0:(ie5)?iebody.scrollLeft:window.pageXOffset); pagey = (isapple == 1 ? 0:(ie5)?iebody.scrollTop:window.pageYOffset); mousex = (ie5)?event.x:(ns6)?clientX = e.clientX:false; mousey = (ie5)?event.y:(ns6)?clientY = e.clientY:false; tooltipDiv.style.left = (mousex+pagex+offsetx-(tooltipDiv.clientWidth/2)-10) + 'px'; tooltipDiv.style.top = (mousey+pagey+offsety) + 'px'; } } function tooltip(tip) { if (tooltipDiv) tooltipDiv.style.display = 'none'; tooltipDiv = tip; tooltipDiv.style.display = 'block'; document.onmousemove = getmouseposition; } function exit() { tooltipDiv.style.display = 'none'; } </script> </body> </html> </xsl:template> <xsl:template name="formatBytes"> <xsl:param name="data"/> <xsl:choose> <xsl:when test="string-length($data) > 9"><xsl:value-of select="floor(100*($data div (1024 * 1024 * 1024))) div 100"/> GB</xsl:when> <xsl:when test="string-length($data) > 6"><xsl:value-of select="floor(100*($data div (1024 * 1024))) div 100"/> MB</xsl:when> <xsl:when test="string-length($data) > 3"><xsl:value-of select="floor(100*($data div (1024))) div 100"/> KB</xsl:when> <xsl:otherwise><xsl:value-of select="$data"/> Bytes</xsl:otherwise> </xsl:choose> </xsl:template> </xsl:transform>