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-BYcXwl4U.js";import{i as y,c as k}from"./app-a6cKceqE.js";import{_ as g}from"./app-CPH3DNXR.js";import{_ as x}from"./app-BsFusN7_.js";import{_ as c}from"./app-BqeukU67.js";import{L as b}from"./app-W_y7sflh.js";import{_ as v}from"./app-uhTxLRnQ.js";import"./app-DCd54JMo.js";import"./app-MrAtUXr3.js";import"./app-BWSI2Z1R.js";import"./app-DPDEogA0.js";import"./app-DxjODhok.js";import"./app-CabATHnR.js";import"./app-BhzV4gWo.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-aSafd0Me.js";import"./app-BHl80pFw.js";import"./app-Btbk6LWy.js";import"./app-CrkKi1Ag.js";import"./app-u5shTDG_.js";import"./app-CO4sV-Ic.js";import"./app-yt37eDzA.js";import"./app-BQ5ggxk2.js";import"./app-D3zbrzdO.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};
