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-DA7OTM4Q.js";import{i as y,c as T}from"./app-BT68AfZ-.js";import{L as g}from"./app-CjSxNKvA.js";import{_ as k}from"./app-Dapk2SAF.js";import{C as v}from"./app-CDbNm056.js";import{C as d}from"./app-CVfeXVc-.js";import{N as x}from"./app-scFtFqL8.js";import{N as b}from"./app-BX4pd6U-.js";import{_ as D}from"./app-C6hnOMuv.js";import"./app-z_TsLOhk.js";import"./app-C5ROEzFd.js";import"./app-Bnbo6OlJ.js";import"./app-Dxa5h-uG.js";import"./app-AbPAjGV5.js";import"./app-BqY8p2gl.js";import"./app-C-GI59rl.js";import"./app-DSiZNBrr.js";import"./app-BotiHebp.js";import"./app-DUjqI3OV.js";import"./app-CnGe5nlE.js";import"./app-45ZaIHUI.js";import"./app-KNE_24OY.js";import"./app-SLkqftrw.js";import"./app-BxVwOz69.js";import"./app-WOreqTiW.js";import"./app-DREBJ-ou.js";import"./app-CWBL8eTX.js";import"./app-OC5wWJiS.js";import"./app-Bhreb6Cm.js";import"./app-Zes_jb7S.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};
