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-DnroACXc.js";import{i as y,c as k}from"./app-DckefXYL.js";import{_ as g}from"./app-gVd4RIjO.js";import{_ as x}from"./app-CjXr3cCY.js";import{_ as c}from"./app-KcnMuQGX.js";import{L as b}from"./app-DM6WPmnv.js";import{_ as v}from"./app-DezwSKU9.js";import"./app-C9iVkiu5.js";import"./app-DrIi-dNq.js";import"./app-zueB50zj.js";import"./app-B0NrURRk.js";import"./app-Co2SIBzr.js";import"./app-CUPmXIij.js";import"./app-Cu6FD8m8.js";import"./app-uFawAv7F.js";import"./app-BJhJ7lM8.js";import"./app-Dd07dUxy.js";import"./app-CYYQ_Zep.js";import"./app-Dpl5YSiv.js";import"./app-CF8nmC-F.js";import"./app-NVAx7Sc3.js";import"./app-CF0qXH5Q.js";import"./app-xECxwo4T.js";import"./app-BtWF1kMA.js";import"./app-CGj1gg44.js";import"./app-B4bUdtyo.js";import"./app-BeuOvIof.js";import"./app-DSjO_8RR.js";import"./app-CZGZgDLc.js";import"./app-R-vSvFIF.js";import"./app-HaDoyrq5.js";import"./app-Cmxxk_WX.js";import"./app-B09rlSqG.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};
