import{o as a,g as o,b as n,w as e,u as s,F as h,a as u,i as f,f as c,t as l,h as i}from"./app-SC54XQDl.js";import{i as y,c as T}from"./app-Ba7ZqSpq.js";import{L as g}from"./app-Crd12MWL.js";import{_ as k}from"./app-CWnUJ4gg.js";import{C as v}from"./app-BjiVQlSS.js";import{C as d}from"./app-Bt2pXSov.js";import{N as x}from"./app-CL60OiIv.js";import{N as b}from"./app-B2C_dtYI.js";import{_ as D}from"./app-BUqHq_rP.js";import"./app-DHsI_tns.js";import"./app-BZGObKCm.js";import"./app-BPIIxVwk.js";import"./app-PPG0ZS4d.js";import"./app-DgoEZtNT.js";import"./app-Ch8j4za4.js";import"./app-Dw0jKdCD.js";import"./app-DnXuoh8P.js";import"./app-CCkWSX4Q.js";import"./app-C8HFiBxn.js";import"./app-BjSCO7rC.js";import"./app-g-bJrEAS.js";import"./app-DZaelcLs.js";import"./app-D_RBJHM6.js";import"./app-CmrRgGIA.js";import"./app-DyP4Nide.js";import"./app-D9TrJBlL.js";import"./app-_Ovp2dOH.js";import"./app-Dhl-Bw0H.js";import"./app-COidJXl1.js";import"./app-CNHjdV6U.js";function $(){const{utils:m,Tea:t}=y(this);this.$delay(function(){this.reload()}),this.deleteTask=function(p){m.confirm("确定要删除此任务吗？",function(){this.$post(".deleteTask").params({taskId:p}).success(function(){window.location=t.url(".tasks")})})},this.resetTask=function(p){m.confirm("确定要重置任务状态吗？",function(){this.$post(".resetTask").params({taskId:p}).refresh()})},this.reload=function(){this.$post("$").params({taskId:this.task.id}).success(function(p){this.task=p.data.task}).done(function(){this.$delay(function(){this.reload()},1e4)})}}const w={key:0},C={key:1},N={key:0},I={key:1},L={key:2},R={key:0},V={key:1,class:"disabled"},B={key:0,class:"green"},U=["href"],F=u("span",{class:"red"},"失败",-1),K=[F],E={key:2,class:"grey"},M=u("h5",{class:"group-header"},"要操作的缓存Key",-1),O={key:0},S={key:1},j={key:2},q={key:0,class:"green"},z={key:1,class:"red"},A={key:2,class:"grey"},G={key:3,class:"grey"},xt={__name:"task",setup(m){const t=T(new $);return(p,_)=>(a(),o(h,null,[n(x,{"content-name":"任务："+s(t).task.id,"parent-items":[["任务列表",s(t).$Tea.url(".tasks")]]},{tabs:e(()=>[n(b,{href:".task?taskId="+s(t).task.id,overview:"",active:""},null,8,["href"])]),buttons:e(()=>[n(D,{href:"",onClick:_[0]||(_[0]=f(r=>s(t).deleteTask(s(t).task.id),["prevent"])),"action-delete":""},{default:e(()=>[c("删除")]),_:1})]),_:1},8,["content-name","parent-items"]),n(v,null,{default:e(()=>[n(d,null,{name:e(()=>[c("任务编号")]),value:e(()=>[c(l(s(t).task.id),1)]),_:1}),n(d,null,{name:e(()=>[c("任务类型")]),value:e(()=>[s(t).task.type=="purge"?(a(),o("span",w,"刷新")):i("",!0),s(t).task.type=="fetch"?(a(),o("span",C,"预热")):i("",!0)]),_:1}),n(d,null,{name:e(()=>[c("Key类型")]),value:e(()=>[s(t).task.keyType=="key"?(a(),o("span",N,"URL")):i("",!0),s(t).task.keyType=="prefix"?(a(),o("span",I,"目录")):i("",!0),s(t).task.keyType=="all"?(a(),o("span",L,"全部URL")):i("",!0)]),_:1}),n(d,null,{name:e(()=>[c("创建时间")]),value:e(()=>[c(l(s(t).task.createdTime),1)]),_:1}),n(d,null,{name:e(()=>[c("完成时间")]),value:e(()=>[s(t).task.isDone?(a(),o("span",R,l(s(t).task.doneTime),1)):(a(),o("span",V,"尚未完成"))]),_:1}),n(d,null,{name:e(()=>[c("任务状态")]),value:e(()=>[s(t).task.isOk?(a(),o("span",B,"已完成")):s(t).task.isDone?(a(),o("a",{key:1,href:"/servers/components/cache/batch/task?taskId="+s(t).task.id,class:"red"},K,8,U)):s(t).task.isDone?i("",!0):(a(),o("span",E,"等待执行"))]),_:1})]),_:1}),M,n(g,{items:s(t).task.keys},{default:e(()=>[n(k,null,{header:e(()=>[s(t).task.keyType=="key"?(a(),o("span",O,"URL")):i("",!0),s(t).task.keyType=="prefix"?(a(),o("span",S,"目录")):i("",!0),s(t).task.keyType=="all"?(a(),o("span",j,"域名")):i("",!0)]),body:e(({data:r})=>[c(l(r.key),1)]),_:1}),n(k,{header:"状态",class:"fixed-status-column"},{body:e(({data:r})=>[r.isDone&&r.errors.length==0?(a(),o("span",q,"完成")):i("",!0),r.isDone&&r.errors.length>0?(a(),o("span",z,"失败")):i("",!0),!r.isDone&&!r.isDoing?(a(),o("span",A,"未执行")):i("",!0),!r.isDone&&r.isDoing?(a(),o("span",G,"执行中")):i("",!0)]),_:1})]),_:1},8,["items"])],64))}};export{xt as default};
