rules_to_clear.html 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"/>
  6. <meta http-equiv="Cache-Control" content="no-siteapp;no-transform">
  7. <meta name="applicable-device" content="pc,mobile">
  8. <meta name="viewport" content="width=device-width, initial-scale=1">
  9. <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
  10. <title>删除已缓存规则列表-{{rules.count}}</title>
  11. <script src="/static/js/jquery.min.js"></script>
  12. <script src="/static/js/grey.js"></script>
  13. </head>
  14. <style>
  15. .red {
  16. color:red;
  17. font-weight: bold
  18. }
  19. .yellow {
  20. color:yellow;
  21. font-weight: bold
  22. }
  23. .yellow a{
  24. width: 100px;
  25. color: #ea7d7d;
  26. }
  27. .refresh{
  28. }
  29. </style>
  30. <body>
  31. <script>
  32. $(document).ready(function(){
  33. $(".refresh").click(function(){
  34. // location.reload();
  35. let rule = this.innerText.trim();
  36. let code = $.ajax({url:"/clear?rule="+rule,async:false}).responseText;
  37. code = typeof(code) === "object"?code:JSON.parse(code);
  38. if(code.code === 200){
  39. alert(code.msg);
  40. location.reload()
  41. }
  42. });
  43. $(".cls").click(function(){
  44. let cls = this.innerText.trim();
  45. if(confirm('确认清除规则'+cls+'缓存的分类?')){
  46. let code = $.ajax({url:"/cls/clear/"+cls,async:false}).responseText;
  47. code = typeof(code) === "object"?code:JSON.parse(code);
  48. if(code.code === 200){
  49. alert('操作成功!\n'+code.msg);
  50. location.reload()
  51. }else{
  52. alert('操作失败!\n'+code.msg);
  53. }
  54. }
  55. });
  56. });
  57. </script>
  58. <h1>缓存规则列表-{{rules.count}}</h1>
  59. {% if rules.count < 1 %}
  60. <h3>暂无已缓存的规则</h3>
  61. {% endif %}
  62. {% for rule in rules.list %}
  63. {% if rule|length > 2 %}
  64. <!-- | 为过滤条件 -->
  65. <li class="red">
  66. <!-- <a class="refresh" href="/clear?rule={{rule}}" target="_blank">{{ rule }}</a>-->
  67. <a class="refresh" href="javascript:void(0);">{{ rule.name }}</a>
  68. </li>
  69. {% else %}
  70. <!-- 如果是if条件,最后必须要有else,否则就会报错 -->
  71. <li class="yellow">
  72. <a class="refresh" href="javascript:void(0);" target="_blank">{{ rule.name }}</a>
  73. </li>
  74. {% endif %}
  75. <!-- if条件必须有endif,否则会报错 -->
  76. {% endfor %}
  77. <h1>缓存分类列表-{{classes|length}}</h1>
  78. {% if classes|length < 1 %}
  79. <h3>暂无已缓存的分类</h3>
  80. {% endif %}
  81. {% for cls in classes %}
  82. {% if cls|length > 2 %}
  83. <li class="red">
  84. <a class="cls" href="javascript:void(0);">{{ cls }}</a>
  85. </li>
  86. {% else %}
  87. <li class="yellow">
  88. <a class="cls" href="javascript:void(0);">{{ cls }}</a>
  89. </li>
  90. {% endif %}
  91. {% endfor %}
  92. </body>
  93. </html>