<include file="public:header" />
<!--清理缓存-->
<div class="subnav">
    <h1 class="title_2 line_x">{:L('clear_cache')}</h1>
</div>
<div class="common-form pad_lr_10">
	<form id="info_form" action="{:u('cache/clear')}" method="post">
		<table width="100%" cellpadding="2" cellspacing="1" class="table_form">
			<tr>
				<th width="30"></th>
				<td width="120"><label><input type="checkbox" checked value="field" name="type" class="mr5" data-uri="{:U('cache/clear', array('type'=>'field'))}"> {:L('field_cache')}</label></td>
				<td><span class="gray mr10">{:L('field_cache_desc')}</span><span id="field_ifm"></span></td>
			</tr>
			<tr>
				<th></th>
				<td><label><input type="checkbox" checked value="tpl" name="type" class="mr5" data-uri="{:U('cache/clear', array('type'=>'tpl'))}"> {:L('tpl_cache')}</label></td>
				<td><span class="gray mr10">{:L('tpl_cache_desc')}</span><span id="tpl_ifm"></span></td>
			</tr>
			<tr>
				<th></th>
				<td><label><input type="checkbox" checked value="data" name="type" class="mr5" data-uri="{:U('cache/clear', array('type'=>'data'))}"> {:L('data_cache')}</label></td>
				<td><span class="gray mr10">{:L('data_cache_desc')}</span><span id="data_ifm"></span></td>
			</tr>
			<tr>
				<th></th>
				<td><label><input type="checkbox" checked value="runtime" name="type" class="mr5" data-uri="{:U('cache/clear', array('type'=>'runtime'))}"> {:L('runtime_cache')}</label></td>
				<td><span class="gray mr10">{:L('runtime_cache_desc')}</span><span id="runtime_ifm"></span></td>
			</tr>
			<tr>
				<th></th>
				<td><label><input type="checkbox" checked value="logs" name="type" class="mr5" data-uri="{:U('cache/clear', array('type'=>'logs'))}"> {:L('logs_cache')}</label></td>
				<td><span class="gray mr10">{:L('logs_cache_desc')}</span><span id="logs_ifm"></span></td>
			</tr>
			<tr>
				<th></th>
				<td><label><input type="checkbox" checked value="js" name="type" class="mr5" data-uri="{:U('cache/clear', array('type'=>'js'))}"> JS缓存文件</label></td>
				<td><span class="gray mr10">修改过JS文件需要更新才会生效</span><span id="js_ifm"></span></td>
			</tr>

			<tr>
				<th></th>
				<td><label><input type="checkbox" checked value="api" name="type" class="mr5" data-uri="{:U('cache/clear', array('type'=>'api'))}"> 飞天侠API缓存</label></td>
				<td><span class="gray mr10">清空飞天侠开放平台API缓存文件</span><span id="api_ifm"></span></td>
			</tr>
            <tr>
            	<th></th>
                <td><input type="button" id="J_clear_cache" class="smt mr10" value="{:L('clear')}"/></td>
                <td></td>
            </tr>
		</table>
	</form>
</div>
</div>
<include file="public:footer" />
<script>
$(function(){
    $('#J_clear_cache').live('click', function(){
        $('input[name="type"]:checked').each(function(){
            var type = $(this).val();
                uri = $(this).attr('data-uri');
            $('#'+type+'_ifm').html(lang.clear_wait);
            $.getJSON(uri, {type:type}, function(result){
                $('#'+type+'_ifm').addClass('onCorrect').html(lang.clear_success);
            });
        });
    });
});
</script>
</body>
</html>