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-DA7OTM4Q.js";import{i as y,c as k}from"./app-BT68AfZ-.js";import{_ as g}from"./app-DUju7TPe.js";import{_ as x}from"./app-D21nXKzm.js";import{_ as c}from"./app-Dapk2SAF.js";import{L as b}from"./app-CjSxNKvA.js";import{_ as v}from"./app-BWsCS5pa.js";import"./app-scFtFqL8.js";import"./app-DREBJ-ou.js";import"./app-CWBL8eTX.js";import"./app-CnGe5nlE.js";import"./app-OC5wWJiS.js";import"./app-BX4pd6U-.js";import"./app-Bhreb6Cm.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-45ZaIHUI.js";import"./app-KNE_24OY.js";import"./app-SLkqftrw.js";import"./app-BxVwOz69.js";import"./app-WOreqTiW.js";import"./app-up4gT9D9.js";import"./app-D29bbm9n.js";import"./app-B_5dka6q.js";import"./app-CQwVTjAx.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};
