main.jsp
上传用户:jhtang88
上传日期:2014-01-27
资源大小:28528k
文件大小:8k
源码类别:

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html; charset=utf-8"%>
  2. <%@ page import="java.util.*,
  3.  java.text.*,
  4.  cn.js.fan.util.*,
  5.  cn.js.fan.cache.jcs.*"
  6. %>
  7. <%@ page import="cn.js.fan.module.pvg.*" %>
  8. <%@ taglib uri="/WEB-INF/tlds/LabelTag.tld" prefix="lt" %>
  9. <%
  10. String priv="class";
  11. String op = ParamUtil.get(request, "op");
  12. RMCache rmcache = RMCache.getInstance();
  13. if (op.equals("startcache")) {
  14. rmcache.setCanCache(true);
  15. }
  16. if (op.equals("stopcache")) {
  17. rmcache.setCanCache(false);
  18. }
  19. %>
  20. <%! // global variables
  21. // decimal formatter for cache values
  22. static final DecimalFormat mbFormat = new DecimalFormat("#0.00");
  23. static final DecimalFormat percentFormat = new DecimalFormat("#0.0");
  24.     // variable for the VM memory monitor box
  25.     static final int NUM_BLOCKS = 50;
  26. %>
  27. <HTML><HEAD><TITLE>main</TITLE>
  28. <META http-equiv=Content-Type content="text/html; charset=utf-8">
  29. <LINK href="images/default.css" type=text/css rel=stylesheet>
  30. <META content="MSHTML 6.00.3790.259" name=GENERATOR></HEAD>
  31. <BODY text=#000000 bgColor=#eeeeee leftMargin=0 topMargin=0><!-- ACP Page Header Start -->
  32. <jsp:useBean id="privilege" scope="page" class="cn.js.fan.module.pvg.Privilege"/>
  33. <%
  34. if (!privilege.isUserLogin(request)) {
  35. out.print(cn.js.fan.web.SkinUtil.makeErrMsg(request, cn.js.fan.web.SkinUtil.LoadString(request, "pvg_invalid")));
  36. return;
  37. }
  38. %>
  39. <TABLE cellSpacing=0 cellPadding=0 width="100%">
  40.   <TBODY>
  41.   <TR>
  42.     <TD class=head><span class="tab">
  43.       <lt:Label res="res.label.forum.admin.index" key="forum_manage"/>
  44.     </span></TD>
  45.   </TR></TBODY></TABLE><BR><!-- ACP Page Header End -->
  46. <STYLE type=text/css>.tab {
  47. PADDING-RIGHT: 30px; PADDING-LEFT: 10px; FONT-SIZE: 12px; PADDING-BOTTOM: 1px; CURSOR: hand; PADDING-TOP: 5px; LETTER-SPACING: 1px
  48. }
  49. </STYLE>
  50. <SCRIPT language=JavaScript>
  51. function tabClick( idx ) {
  52.   for ( i = 0; i < 2; i++ ) {
  53.     if ( i == idx ) {
  54.       var tabImgLeft = eval("document.all.tabImgLeft__" + idx );
  55.       var tabImgRight = eval("document.all.tabImgRight__" + idx );
  56.       var tabLabel = eval("document.all.tabLabel__" + idx );
  57.       var tabContent = eval("document.all.tabContent__" + idx );
  58.       tabImgLeft.src = "images/tab_active_left.gif";
  59.       tabImgRight.src = "images/tab_active_right.gif";
  60.       tabLabel.background = "images/tab_active_bg.gif";
  61.       tabContent.style.visibility = "visible";
  62.       tabContent.style.display = "block";
  63.       continue;
  64.     }
  65.     var tabImgLeft = eval("document.all.tabImgLeft__" + i );
  66.     var tabImgRight = eval("document.all.tabImgRight__" + i );
  67.     var tabLabel = eval("document.all.tabLabel__" + i );
  68.     var tabContent = eval("document.all.tabContent__" + i );
  69.     tabImgLeft.src = "images/tab_unactive_left.gif";
  70.     tabImgRight.src = "images/tab_unactive_right.gif";
  71.     tabLabel.background = "images/tab_unactive_bg.gif";
  72.     tabContent.style.visibility = "hidden";
  73.     tabContent.style.display = "none";
  74.   }
  75. }
  76. </SCRIPT>
  77. <TABLE cellSpacing=0 cellPadding=0 width="95%" align=center border=0>
  78.   <TBODY>
  79.   <TR>
  80.     <TD style="PADDING-LEFT: 2px; HEIGHT: 22px" 
  81.     background=images/tab_top_bg.gif>
  82.       <TABLE cellSpacing=0 cellPadding=0 border=0>
  83.         <TBODY>
  84.         <TR>
  85.           <TD>
  86.             <TABLE height=22 cellSpacing=0 cellPadding=0 border=0>
  87.               <TBODY>
  88.               <TR>
  89.                 <TD width=3><IMG id=tabImgLeft__0 height=22 
  90.                   src="images/tab_active_left.gif" width=3></TD>
  91.                 <TD class=tab id=tabLabel__0 onClick="tabClick( 0 )" 
  92.                 background=images/tab_active_bg.gif 
  93.                   UNSELECTABLE="on"><lt:Label res="res.label.blog.admin.index" key="system_info"/></TD>
  94.                 <TD width=3><IMG id=tabImgRight__0 height=22 
  95.                   src="images/tab_active_right.gif" 
  96.               width=3></TD></TR></TBODY></TABLE></TD>
  97.           <TD>&nbsp;</TD>
  98.         </TR></TBODY></TABLE></TD></TR>
  99.   <TR>
  100.     <TD bgColor=#ffffff>
  101.       <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  102.         <TBODY>
  103.         <TR>
  104.           <TD width=1 background=images/tab_bg.gif><IMG height=1 
  105.             src="images/tab_bg.gif" width=1></TD>
  106.           <TD 
  107.           style="PADDING-RIGHT: 15px; PADDING-LEFT: 15px; PADDING-BOTTOM: 15px; PADDING-TOP: 15px; HEIGHT: 350px" 
  108.           vAlign=top>
  109.             <DIV id=tabContent__0 style="DISPLAY: block; VISIBILITY: visible"><!-- Main Table Start -->
  110.   <TABLE 
  111. style="BORDER-RIGHT: #a6a398 1px solid; BORDER-TOP: #a6a398 1px solid; BORDER-LEFT: #a6a398 1px solid; BORDER-BOTTOM: #a6a398 1px solid" 
  112. cellSpacing=0 cellPadding=3 width="95%" align=center>
  113.             <!-- Table Head Start-->
  114.             <TBODY>
  115.               <TR>
  116.                 <TD class=thead style="PADDING-LEFT: 10px" noWrap width="70%"><font size="-1"><b>
  117.                   <lt:Label res="res.label.blog.admin.cache" key="java_memory"/>
  118.                 </b></font></TD>
  119.               </TR>
  120.               <TR class=row style="BACKGROUND-COLOR: #fafafa">
  121.                 <TD height="175" align="center" style="PADDING-LEFT: 10px"><p>
  122.                     <ul>
  123.                       <% // The java runtime
  124. Runtime runtime = Runtime.getRuntime();
  125.     double freeMemory = (double)runtime.freeMemory()/(1024*1024);
  126. double totalMemory = (double)runtime.totalMemory()/(1024*1024);
  127. double usedMemory = totalMemory - freeMemory;
  128. double percentFree = ((double)freeMemory/(double)totalMemory)*100.0;
  129.     int free = 100-(int)Math.round(percentFree);
  130. %>
  131.                       <table border=0>
  132.                         <tr>
  133.                           <td><font size="-1">
  134.                             <lt:Label res="res.label.blog.admin.cache" key="used_memory"/></font></td>
  135.                           <td><font size="-1"><%= mbFormat.format(usedMemory) %> MB</font></td>
  136.                         </tr>
  137.                         <tr>
  138.                           <td><font size="-1">
  139.                             <lt:Label res="res.label.blog.admin.cache" key="memory_total"/>
  140.                             :</font></td>
  141.                           <td><font size="-1"><%= mbFormat.format(totalMemory) %> MB</font></td>
  142.                         </tr>
  143.                       </table>
  144.                       <br>
  145.                       <table border=0>
  146.             <td><table bgcolor="#000000" cellpadding="1" cellspacing="0" border="0" width="200" align=left>
  147.                   <td><table bgcolor="#000000" cellpadding="1" cellspacing="1" border="0" width="100%">
  148.                         <%    for (int i=0; i<NUM_BLOCKS; i++) {
  149.         if ((i*(100/NUM_BLOCKS)) < free) {
  150.     %>
  151.                         <td bgcolor="#00ff00" width="<%= (100/NUM_BLOCKS) %>%"><img src="images/blank.gif" width="1" height="15" border="0"></td>
  152.                             <% } else { %>
  153.                             <td bgcolor="#006600" width="<%= (100/NUM_BLOCKS) %>%"><img src="images/blank.gif" width="1" height="15" border="0"></td>
  154.                             <% }
  155.     }
  156. %>
  157.                     </table></td>
  158.               </table></td>
  159.                 <td><font size="-1"> &nbsp;<b><%= percentFormat.format(percentFree) %>% 
  160.                   <lt:Label res="res.label.blog.admin.cache" key="free"/>
  161.                 </b> </font> </td>
  162.                       </table>
  163.                       <br>
  164.                       <br>
  165.                       <br>
  166.                       <br>
  167.                       <br>
  168.                       <br>
  169.                       <!--<br>
  170. >>&nbsp;<a href="cache_jvm.jsp">管理</a>
  171.                     </ul>
  172.                     <% // Destroy the runtime reference
  173. runtime = null;
  174. %>
  175.                     <%if (rmcache.getCanCache()) {%>
  176.         缓存已启用 >><a href="cache.jsp?op=stopcache">停用</a>
  177.         <%}else{%>
  178.         缓存已停用 >><a href="cache.jsp?op=startcache">启用</a>
  179.         <%}%>-->
  180.                 </TD>
  181.               </TR>
  182.               <!-- Table Body End -->
  183.               <!-- Table Foot -->
  184.               <TR>
  185.                 <TD class=tfoot align=right><DIV align=right> </DIV></TD>
  186.               </TR>
  187.               <!-- Table Foot -->
  188.             </TBODY>
  189.           </TABLE></div>
  190.             </TD>
  191.           <TD width=1 background=images/tab_bg.gif><IMG height=1 
  192.             src="images/tab_bg.gif" width=1></TD></TR></TBODY></TABLE></TD></TR>
  193.   <TR>
  194.     <TD background=images/tab_bg.gif bgColor=#ffffff><IMG height=1 
  195.       src="images/tab_bg.gif" width=1></TD></TR></TBODY></TABLE>
  196. </BODY></HTML>