<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="../../admin/common/init.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<%@ include file="../../admin/common/top.jsp"%>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>云阅卷</title>
</head>
<body>
	<div class="container-fluid">
		<div class="row-fluid">
			<h3>缓存列表</h3>
			<table class="table table-bordered">
				<thead>
					<tr>
						<th>名称</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody>
					<c:forEach items="${caches}" var="name">
					<tr>
						<td>${name}
						<c:if test="${cacheSize!=null}">
						<span class="badge badge-info">${cacheSize[name]}</span>
						</c:if>
						</td>
						<td>
							<a href="##" class="btn btn-warning clear-button" data-name="${name}">清空</a>
						</td>
					</tr>
					</c:forEach>
				</tbody>
			</table>
		</div>
	</div>
</body>
<script type="text/javascript">
$(document).ready(function() {
	$('.clear-button').click(function(){
		$.post('${ctx}/monitor/cache/clear',{name:$(this).attr('data-name')}, function(result){
			if(result==true){
				alert('操作成功');
				window.location.href='${ctx}/monitor/cache';
			}else{
				alert('缓存不存在');
			}
		})
	});
});
</script>
</html>