import{r as g,o,c as k,w as l,u as t,b as a,d as f,e as p,a as s,f as i,g as n,h as r,t as d,F as x,D as T}from"./app-BYcXwl4U.js";import{i as v,c as R}from"./app-a6cKceqE.js";import{_ as b}from"./app-oLjSY4QW.js";import{_ as w}from"./app-CignoBaV.js";import{_ as y}from"./app-Dm54XnL8.js";import{_ as V}from"./app-DY-0PadZ.js";import{C as _}from"./app-iaXXZg9Y.js";import{_ as $}from"./app-CQ-vNlMj.js";import{D as U}from"./app-7GBSHA5C.js";import{_ as B}from"./app-uhTxLRnQ.js";import{_ as C}from"./app-C3oVnfUH.js";import"./app-DCd54JMo.js";import"./app-MrAtUXr3.js";import"./app-BWSI2Z1R.js";import"./app-DPDEogA0.js";import"./app-DxjODhok.js";import"./app-CabATHnR.js";import"./app-BhzV4gWo.js";import"./app-CrjU8lgK.js";import"./app-Btbk6LWy.js";import"./app-D2Wz0BUQ.js";import"./app-D3zbrzdO.js";import"./app-CO4sV-Ic.js";import"./app-yt37eDzA.js";import"./app-BG60hdvp.js";import"./app-BQ5ggxk2.js";import"./app-SxAW7vhf.js";import"./app-CLawzVMq.js";import"./app-BeFNDz9n.js";import"./app-BDgR0DSb.js";function L(){v(this),this.isRequesting=!1,this.isOk=!1,this.message="",this.failKeys=[],this.$delay(function(){this.$refs.keysBox.focus(),this.$watch(()=>this.keyType,function(){this.$refs.keysBox.focus(),this.message="",this.failKeys=[]})}),this.before=function(){this.isRequesting=!0,this.isOk=!1,this.message="",this.failKeys=[]},this.success=function(){this.isOk=!0,this.$NotifyReloadSuccess("任务提交成功")()},this.fail=function(c){this.message=c.message,c.data.failKeys!=null&&(this.failKeys=c.data.failKeys)},this.done=function(){this.isRequesting=!1},this.keyType="key"}const q=s("p",{class:"!mb-4"},"可以在这里批量刷新一组URL缓存。",-1),D=["value"],K=["value"],O=s("td",{class:"title"},"URL类型",-1),N={class:"flex flex-wrap gap-4"},S={key:0,class:"comment"},F={key:1,class:"comment"},I={key:2,class:"comment"},E={key:0},j={key:1},z=s("td",null,"操作结果",-1),A={key:0},G={key:1,class:"red"},H={key:2,class:"fail-keys-box"},J={class:"red"},be={__name:"purge",setup(c){const h=g(),e=R(new L,{refs:{keysBox:h}});return(M,m)=>(o(),k(C,{ctx:t(e)},{default:l(()=>[a(b,{ctx:t(e),"active-tab":"purge"},null,8,["ctx"]),f(s("div",null,[a(B,{"disable-spacing":""},{default:l(()=>[i("没有开启缓存，暂时不需要刷新。")]),_:1})],512),[[p,t(e).webConfig.cache==null||!t(e).webConfig.cache.isOn]]),f(s("div",null,[q,a($,{action:"$",onBefore:t(e).before,onSuccess:t(e).success,onFail:t(e).fail,onDone:t(e).done,timeout:"300"},{default:l(()=>[s("input",{type:"hidden",name:"serverId",value:t(e).serverId},null,8,D),s("input",{type:"hidden",name:"webId",value:t(e).webId},null,8,K),a(U,null,{default:l(()=>[s("tbody",null,[s("tr",null,[O,s("td",null,[s("div",N,[a(y,{name:"keyType",value:"key",modelValue:t(e).keyType,"onUpdate:modelValue":m[0]||(m[0]=u=>t(e).keyType=u)},{default:l(()=>[i("URL")]),_:1},8,["modelValue"]),a(y,{name:"keyType",value:"prefix",modelValue:t(e).keyType,"onUpdate:modelValue":m[1]||(m[1]=u=>t(e).keyType=u)},{default:l(()=>[i("目录")]),_:1},8,["modelValue"]),a(y,{name:"keyType",value:"all",modelValue:t(e).keyType,"onUpdate:modelValue":m[2]||(m[2]=u=>t(e).keyType=u)},{default:l(()=>[i("全部URL")]),_:1},8,["modelValue"])]),t(e).keyType=="key"?(o(),n("p",S,[i("每行一个URL，比如 "),a(_,null,{default:l(()=>[i("https://example.com/hello/world.html")]),_:1}),i(" 。 ")])):r("",!0),t(e).keyType=="prefix"?(o(),n("p",F,[i("每行一个URL目录，比如 "),a(_,null,{default:l(()=>[i("https://example.com/hello/")]),_:1}),i(" ；如果只填写域名部分，表示清理全站，比如 "),a(_,null,{default:l(()=>[i("https://example.com/")]),_:1}),i(" 。 ")])):r("",!0),t(e).keyType=="all"?(o(),n("p",I,"清理当前网站下所有URL的缓存。")):r("",!0)])]),f(s("tr",null,[s("td",null,[t(e).keyType=="key"?(o(),n("span",E,"URL")):r("",!0),t(e).keyType=="prefix"?(o(),n("span",j,"目录")):r("",!0)]),s("td",null,[a(V,{name:"keys",rows:"10",ref_key:"keysBox",ref:h,class:"w-full"},null,512)])],512),[[p,t(e).keyType!="all"]]),s("tr",null,[z,s("td",null,[t(e).isRequesting?(o(),n("div",A,"数据发送中...")):r("",!0),!t(e).isRequesting&&!t(e).isOk&&t(e).message.length>0?(o(),n("span",G,"失败："+d(t(e).message),1)):r("",!0),!t(e).isRequesting&&!t(e).isOk&&t(e).failKeys.length>0?(o(),n("div",H,[(o(!0),n(x,null,T(t(e).failKeys,u=>(o(),n("div",null,[s("span",J,d(u.key)+": "+d(u.reason),1)]))),256))])):r("",!0)])])])]),_:1}),t(e).isRequesting?r("",!0):(o(),k(w,{key:0},{default:l(()=>[i("提交")]),_:1}))]),_:1},8,["onBefore","onSuccess","onFail","onDone"])],512),[[p,t(e).webConfig.cache!=null&&t(e).webConfig.cache.isOn]])]),_:1},8,["ctx"]))}};export{be as default};
