Files
iblog2/public/dist/js/cachemanage.js
2018-11-19 20:30:53 +08:00

1 line
871 B
JavaScript

"use strict";$(function(){$("#side-menu>li:eq(6)").addClass("active"),$("#keyinput").on("changed.fu.combobox",function(e,t){t.value&&$("#cacheKey").val(t.value)}),$("#btnQuery").on("click",function(){var e=$("#cacheKey").val();e&&$.ajax({url:"/admin/getcache",type:"Post",data:{key:e},success:function(e){var t=e?JSON.stringify(e,null,2):"";$("#cacheContent").html(t),$("#cacheContent").focus()},error:function(){swal({title:"获取失败!",type:"error",showConfirmButton:!1,timer:2e3})}})}),$("#btnClear").on("click",function(){var e=$("#cacheKey").val();e&&$.ajax({url:"/admin/clearcache",type:"Post",data:{key:e},success:function(){swal({title:"成功清除!",type:"success",showConfirmButton:!1,timer:2e3}),$("#cacheContent").html(""),$("#cacheContent").focus()},error:function(){swal({title:"清除失败!",type:"error",showConfirmButton:!1,timer:2e3})}})})});