import{o as t,g as s,b as a,u as n,c as h,w as o,h as r,F as f,f as d,a as m,t as l,i as u}from"./app-SC54XQDl.js";import{i as y,c as k}from"./app-Ba7ZqSpq.js";import{_ as g}from"./app-CWUdaaxi.js";import{_ as x}from"./app-DZcB_Zcx.js";import{_ as c}from"./app-CWnUJ4gg.js";import{L as b}from"./app-Crd12MWL.js";import{_ as v}from"./app-D9UgVOV0.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-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-g-bJrEAS.js";import"./app-DZaelcLs.js";import"./app-D_RBJHM6.js";import"./app-CmrRgGIA.js";import"./app-DyP4Nide.js";import"./app-C28obFWS.js";import"./app-CkINxBL9.js";import"./app--Lj8zATS.js";import"./app-C2mBgI5Z.js";function T(){const{utils:p,Tea:i}=y(this);this.deleteTask=function(_){p.confirm("确定要删除此任务吗？",function(){this.$post(".deleteTask").params({taskId:_}).refresh()})}}const C={key:1},$=["href"],w={key:0},B={key:1},I={key:0},L={key:1},N={key:2},V={key:0,class:"green"},z=["href"],D=m("span",{class:"red"},"失败",-1),R=[D],F={key:2,class:"grey"},U=["href"],E=["onClick"],ge={__name:"tasks",setup(p){const i=k(new T);return(_,K)=>(t(),s(f,null,[a(g,{ctx:n(i),"active-tab":"task"},null,8,["ctx"]),n(i).tasks.length==0?(t(),h(v,{key:0,"disable-spacing":""},{default:o(()=>[d("暂时还没有任务。")]),_:1})):r("",!0),n(i).tasks.length>0?(t(),s("div",C,[a(b,{items:n(i).tasks},{default:o(()=>[a(c,{header:"任务编号",class:"normal-value-column",frozen:""},{body:o(({data:e})=>[m("a",{href:"/servers/cache/task?taskId="+e.id},l(e.id),9,$)]),_:1}),a(c,{header:"任务类型",class:"normal-value-column"},{body:o(({data:e})=>[e.type=="purge"?(t(),s("span",w,"刷新")):r("",!0),e.type=="fetch"?(t(),s("span",B,"预热")):r("",!0)]),_:1}),a(c,{header:"Key类型",class:"normal-value-column"},{body:o(({data:e})=>[e.keyType=="key"?(t(),s("span",I,"URL")):r("",!0),e.keyType=="prefix"?(t(),s("span",L,"目录")):r("",!0),e.keyType=="all"?(t(),s("span",N,"全部URL")):r("",!0)]),_:1}),a(c,{header:"创建时间",class:"datetime-column"},{body:o(({data:e})=>[d(l(e.createdTime),1)]),_:1}),a(c,{header:"任务状态",class:"fixed-status-column"},{body:o(({data:e})=>[e.isOk?(t(),s("span",V,"已完成")):e.isDone?(t(),s("a",{key:1,href:"/servers/cache/task?taskId="+e.id,class:"red"},R,8,z)):e.isDone?r("",!0):(t(),s("span",F,"等待执行"))]),_:1}),a(c,{header:"操作",class:"two op",frozen:"","align-frozen":"right"},{body:o(({data:e})=>[m("a",{href:"/servers/cache/task?taskId="+e.id},"详情",8,U),d("   "),m("a",{href:"",onClick:u(M=>n(i).deleteTask(e.id),["prevent"])},"删除",8,E)]),_:1})]),_:1},8,["items"])])):r("",!0),a(x,{data:n(i).page},null,8,["data"])],64))}};export{ge as default};
