📄 cache.jsp
字号:
<tr bgcolor="#ffffff">
<form action="cache.jsp">
<input type="hidden" name="doClear" value="true">
<input type="hidden" name="cacheID" value="<%= DbCacheManager.FORUM_CACHE %>">
<% cache = cacheManager.getCache(DbCacheManager.FORUM_CACHE); %>
<td>论坛</td>
<%
memUsed = (double)cache.getSize()/(1024*1024);
totalMem = (double)cache.getMaxSize()/(1024*1024);
freeMem = 100 - 100*memUsed/totalMem;
%>
<td><%= formatter.format(totalMem) %> MB,
<%= formatter.format(freeMem)%>%空闲
</td>
<td align=right> <%= cache.getNumElements() %> </td>
<%
hits = cache.getCacheHits();
misses = cache.getCacheMisses();
if (hits + misses == 0) { hitPercent = 0.0; }
else { hitPercent = 100*(double)hits/(hits+misses); }
%>
<td><%= formatter.format(hitPercent)%>% (<%= hits %>命中,<%= misses %>错失)</td>
<form action="cache.jsp">
<input type="hidden" name="doEdit" value="true">
<input type="hidden" name="cacheID" value="<%= DbCacheManager.FORUM_CACHE %>">
</form>
<form action="cache.jsp">
<input type="hidden" name="doClear" value="true">
<input type="hidden" name="cacheID" value="<%= DbCacheManager.FORUM_CACHE %>">
<td><input type="submit" value="清理缓存"></td>
</form>
</tr>
<% if( doEdit && cacheID==DbCacheManager.FORUM_CACHE ) { %>
<tr bgcolor="#ffffff">
<form action="cache.jsp">
<input type="hidden" name="doSave" value="true">
<input type="hidden" name="cacheID" value="<%= DbCacheManager.FORUM_CACHE %>">
<td colspan="4">
设置帖子大小:
<input type="text" value="<%= cache.getMaxSize()/1024 %>" size="6"
name="cacheMaxSize">K
<br>
1024 K = 1 MB, 2048 K = 2 MB, 3072 K = 3 MB
</td>
<td colspan="2" align="center"><input type="submit" value="保存"></td>
</form>
</tr>
<% } %>
<tr bgcolor="#ffffff">
<form action="cache.jsp">
<input type="hidden" name="doClear" value="true">
<input type="hidden" name="cacheID" value="<%= DbCacheManager.USER_CACHE %>">
<% cache = cacheManager.getCache(DbCacheManager.USER_CACHE); %>
<td>用户</td>
<%
memUsed = (double)cache.getSize()/(1024*1024);
totalMem = (double)cache.getMaxSize()/(1024*1024);
freeMem = 100 - 100*memUsed/totalMem;
%>
<td><%= formatter.format(totalMem) %> MB,
<%= formatter.format(freeMem)%>%空闲
</td>
<td align=right> <%= cache.getNumElements() %> </td>
<%
hits = cache.getCacheHits();
misses = cache.getCacheMisses();
if (hits + misses == 0) { hitPercent = 0.0; }
else { hitPercent = 100*(double)hits/(hits+misses); }
%>
<td><%= formatter.format(hitPercent)%>% (<%= hits %>命中,<%= misses %>错失)</td>
<form action="cache.jsp">
<input type="hidden" name="doEdit" value="true">
<input type="hidden" name="cacheID" value="<%= DbCacheManager.USER_CACHE %>">
</form>
<form action="cache.jsp">
<input type="hidden" name="doClear" value="true">
<input type="hidden" name="cacheID" value="<%= DbCacheManager.USER_CACHE %>">
<td><input type="submit" value="清理缓存"></td>
</form>
</tr>
<% if( doEdit && cacheID==DbCacheManager.USER_CACHE ) { %>
<tr bgcolor="#ffffff">
<form action="cache.jsp">
<input type="hidden" name="doSave" value="true">
<input type="hidden" name="cacheID" value="<%= DbCacheManager.USER_CACHE %>">
<td colspan="4">
设置帖子大小:
<input type="text" value="<%= cache.getMaxSize()/1024 %>" size="6"
name="cacheMaxSize">K
<br>
1024 K = 1 MB, 2048 K = 2 MB, 3072 K = 3 MB
</td>
<td colspan="2" align="center"><input type="submit" value="保存"></td>
</form>
</tr>
<% } %>
<tr bgcolor="#ffffff">
<form action="cache.jsp">
<input type="hidden" name="doClear" value="true">
<input type="hidden" name="cacheID" value="<%= DbCacheManager.GROUP_CACHE %>">
<% cache = cacheManager.getCache(DbCacheManager.GROUP_CACHE); %>
<td>用户组</td>
<%
memUsed = (double)cache.getSize()/(1024*1024);
totalMem = (double)cache.getMaxSize()/(1024*1024);
freeMem = 100 - 100*memUsed/totalMem;
%>
<td><%= formatter.format(totalMem) %> MB,
<%= formatter.format(freeMem)%>%空闲
</td>
<td align=right> <%= cache.getNumElements() %> </td>
<%
hits = cache.getCacheHits();
misses = cache.getCacheMisses();
if (hits + misses == 0) { hitPercent = 0.0; }
else { hitPercent = 100*(double)hits/(hits+misses); }
%>
<td><%= formatter.format(hitPercent)%>% (<%= hits %>命中,<%= misses %>错失)</td>
<form action="cache.jsp">
<input type="hidden" name="doEdit" value="true">
<input type="hidden" name="cacheID" value="<%= DbCacheManager.GROUP_CACHE %>">
</form>
<form action="cache.jsp">
<input type="hidden" name="doClear" value="true">
<input type="hidden" name="cacheID" value="<%= DbCacheManager.GROUP_CACHE %>">
<td><input type="submit" value="清理缓存"></td>
</form>
</tr>
<% if( doEdit && cacheID==DbCacheManager.GROUP_CACHE ) { %>
<tr bgcolor="#ffffff">
<form action="cache.jsp">
<input type="hidden" name="doSave" value="true">
<input type="hidden" name="cacheID" value="<%= DbCacheManager.GROUP_CACHE %>">
<td colspan="4">
设置帖子大小:
<input type="text" value="<%= cache.getMaxSize()/1024 %>" size="6"
name="cacheMaxSize">K
<br>
1024 K = 1 MB, 2048 K = 2 MB, 3072 K = 3 MB
</td>
<td colspan="2" align="center"><input type="submit" value="保存"></td>
</form>
</tr>
<% } %>
</table>
</td>
</table>
</ul>
<p>
<b>Java虚拟机内存</b>
<ul>
<%
double freeMemory = (double)runtime.freeMemory()/(1024*1024);
double totalMemory = (double)runtime.totalMemory()/(1024*1024);
double usedMemory = totalMemory - freeMemory;
double percentFree = ((double)freeMemory/(double)totalMemory)*100.0;
%>
<table border=0>
<tr><td>使用的内存:</td><td><%= formatter.format(usedMemory) %> MB</td></tr>
<tr><td>内存总额:</td><td><%= formatter.format(totalMemory) %> MB</td></tr>
</table>
<br>
<!--
<table bgcolor="#000000" cellpadding="1" cellspacing="0" border="0" width="300">
<td>
<table bgcolor="#ffffff" cellpadding="0" cellspacing="0" border="0" width="100%">
<td width="<%= percentFree %>%" background="images/cache.gif"><img src="images/blank.gif" width="<%= percentFree %>" height="20" border="0"></td>
<td width="<%= 100-percentFree %>%"></td>
</table>
</td>
</table>
<b><%= formatter.format(percentFree) %>% free</b>
<p>
-->
<% int free = 100-(int)Math.round(percentFree); %>
<% int tableWidth = 200; %>
<% int numBlocks = 50; %>
<table border=0><td>
<table bgcolor="#000000" cellpadding="1" cellspacing="0" border="0" width="<%= tableWidth %>" align=left>
<td>
<table bgcolor="#000000" cellpadding="1" cellspacing="1" border="0" width="100%">
<% for( int i=0; i<numBlocks; i++ ) { %>
<% if( (i*(100/numBlocks)) < free ) { %>
<td bgcolor="#00ff00" width="<%= (100/numBlocks) %>%"><img src="blank.gif" width="1" height="15" border="0"></td>
<% } else { %>
<td bgcolor="#006600" width="<%= (100/numBlocks) %>%"><img src="blank.gif" width="1" height="15" border="0"></td>
<% } %>
<% } %>
</table>
</td>
</table></td><td> <b><%= formatter.format(percentFree) %>% 空闲</b> </td></table>
</ul>
<p>
<b>缓存状态</b>
<ul>
<form action="cache.jsp">
<input type="hidden" name="doCache" value="true">
<table bgcolor="#666666" cellpadding="0" cellspacing="0" border="0" width="300">
<td>
<table bgcolor="#666666" cellpadding="3" cellspacing="1" border="0" width="100%">
<tr bgcolor="#ffffff">
<td align="center"<%= (cacheEnabled)?" bgcolor=\"#99cc99\"":"" %>>
<input type="radio" name="cacheEnabled" value="true" id="rb01"
<%= (cacheEnabled)?"checked":"" %>>
<label for="rb01"><%= (cacheEnabled)?"<b>开</b>":"开" %></label>
</td>
<td align="center"<%= (!cacheEnabled)?" bgcolor=\"#cc6666\"":"" %>>
<input type="radio" name="cacheEnabled" value="false" id="rb02"
<%= (!cacheEnabled)?"checked":"" %>>
<label for="rb02"><%= (!cacheEnabled)?"<b>关</b>":"关" %></label>
</td>
<td align="center">
<input type="submit" value="修改">
</td>
</tr>
</table>
</td>
</table>
</ul>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -