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-SC54XQDl.js";import{i as v,c as R}from"./app-Ba7ZqSpq.js";import{_ as b}from"./app-2eNgyX55.js";import{_ as w}from"./app-DWUwCFNm.js";import{_ as y}from"./app-Y56vIEoR.js";import{_ as V}from"./app-T1ysvErZ.js";import{C as _}from"./app-Ciy_QwIW.js";import{_ as $}from"./app-DFulsyXy.js";import{D as U}from"./app-ZeVDYyDS.js";import{_ as B}from"./app-D9UgVOV0.js";import{_ as C}from"./app-Cft_lrsr.js";import"./app-CL60OiIv.js";import"./app-D9TrJBlL.js";import"./app-_Ovp2dOH.js";import"./app-BjSCO7rC.js";import"./app-Dhl-Bw0H.js";import"./app-B2C_dtYI.js";import"./app-COidJXl1.js";import"./app-CNHjdV6U.js";import"./app-D_RBJHM6.js";import"./app-DoVkxbmA.js";import"./app-C2mBgI5Z.js";import"./app-C28obFWS.js";import"./app-CkINxBL9.js";import"./app-PPG0ZS4d.js";import"./app--Lj8zATS.js";import"./app-Ch8j4za4.js";import"./app-qhR41k1m.js";import"./app-CS3AUTAk.js";import"./app-CCkWSX4Q.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};
