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-BYcXwl4U.js";import{i as y,c as T}from"./app-a6cKceqE.js";import{L as g}from"./app-W_y7sflh.js";import{_ as k}from"./app-BqeukU67.js";import{C as v}from"./app-Biqm6MNM.js";import{C as d}from"./app-C14NbwKQ.js";import{N as x}from"./app-DCd54JMo.js";import{N as b}from"./app-CabATHnR.js";import{_ as D}from"./app-DmX24te2.js";import"./app-CJCAnMrx.js";import"./app-Cp3gmk2J.js";import"./app--MWyBMkA.js";import"./app-BG60hdvp.js";import"./app-CNARLpXE.js";import"./app-SxAW7vhf.js";import"./app-D5k1HLu9.js";import"./app-ysQ8KbGS.js";import"./app-BDgR0DSb.js";import"./app-Cc2zXvHs.js";import"./app-DPDEogA0.js";import"./app-aSafd0Me.js";import"./app-BHl80pFw.js";import"./app-Btbk6LWy.js";import"./app-CrkKi1Ag.js";import"./app-u5shTDG_.js";import"./app-MrAtUXr3.js";import"./app-BWSI2Z1R.js";import"./app-DxjODhok.js";import"./app-BhzV4gWo.js";import"./app-CrjU8lgK.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};
