rules.html 1.9 KB
Newer Older
H
hjdhnx 已提交
1 2 3 4
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
H
hjdhnx 已提交
5
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"/>
H
hjdhnx 已提交
6 7 8 9
    <meta http-equiv="Cache-Control" content="no-siteapp;no-transform">
    <meta name="applicable-device" content="pc,mobile">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
H
hjdhnx 已提交
10
    <title>删除已缓存规则列表-{{rules.count}}</title>
H
hjdhnx 已提交
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
    <script src="/static/js/jquery.min.js"></script>
</head>
<style>
    .red {
        color:red;
        font-weight: bold
    }
    .yellow {
        color:yellow;
        font-weight: bold
    }
    .refresh{

    }
</style>
<body>
<script>
    $(document).ready(function(){
        $(".refresh").click(function(){
            // location.reload();
            let rule = this.innerText.trim();
            let code = $.ajax({url:"/clear?rule="+rule,async:false}).responseText;
            code = typeof(code) === "object"?code:JSON.parse(code);
            if(code.code === 200){
                alert(code.msg);
                location.reload()
            }

        });
});

</script>
{% if rules.count < 1 %}
<h3>暂无已缓存的规则</h3>
{% endif %}

{% for rule in rules.list %}

    	{% if rule|length > 2 %}
        <!-- | 为过滤条件 -->
        	<li class="red">
<!--                <a class="refresh" href="/clear?rule={{rule}}" target="_blank">{{ rule }}</a>-->
                <a class="refresh" href="javascript:void(0);">{{ rule }}</a>
            </li>

        {% else %}
         <!-- 如果是if条件,最后必须要有else,否则就会报错 -->
            <li class="yellow">
                <a class="refresh" href="javascript:void(0);" target="_blank">{{ rule }}</a>
            </li>

        {% endif %}
      	<!-- if条件必须有endif,否则会报错 -->

     {% endfor %}
</body>

</html>