import{B as s}from"./index118.js?v=20260328163632";import{aU as a,l,s as e,am as t,bv as n,bm as i,z as o,x as c,dz as r,_ as u}from"./utils-lib.js?v=20260328163632";import{u as p}from"./index115.js?v=20260328163632";import{k as m,i as d,r as v,c as x,o as f,J as g,V as h,W as w,Y as j,F as k,X as _,Z as b,O as y,a3 as C,j as I,L as z,a1 as F}from"./base-lib.js?v=20260328163632";import{aA as H}from"./naive-ui.js?v=20260328163632";import"./__commonjsHelpers__.js?v=20260328163632";import"./env-lib.js?v=20260328163632";import"./index88.js?v=20260328163632";const L={class:"p-16px realTaskDialog w-full max-h-full overflow-auto"},T={class:"title"},q=["title"],A={class:"p-[10px]"},B={class:"mt-[4px] flex justify-between items-center"},D={class:"flex"},J={class:"mr-[25px]"},N={class:"title"},O={class:"truncate max-w-[360px]"},U={class:"max-h-[180px] overflow-auto"},V={key:2,class:"wait mt-10px"},W={class:"title"},X={class:"truncate"},Y=["onClick"],Z=u(m({__name:"index",setup(u){const{refreshFilesList:m}=p(),Z=d("popupClose",(()=>{}));let E=null;const G=v([]),K=x((()=>G.value[0]||{log:"",name:"",shell:""})),M=async()=>{try{const s=await n({status:-3});if(0===s.data.length)return clearInterval(E),m(),void Z();G.value=s.data,E=setTimeout(M,2e3)}catch(s){i(s)}},P=async s=>{await o({title:l("删除任务"),content:l("您真的要删除当前任务【{0}】吗？",[s.name+":"+s.shell])}),c({loading:l("正在删除，请稍后..."),request:r({id:s.id}),message:!0,success:M})};return f(M),g((()=>{G.value=[],clearInterval(E)})),(n,i)=>{var o,c,r,u,p;const m=H;return h(),w("div",L,[j(a)(j(K).log)?(h(),w(k,{key:0},[_("div",T,[_("span",{class:"truncate max-w-[360px]",title:j(K).shell},b(j(l)("正在下载"))+":"+b(j(K).shell),9,q),y(j(e),{onClick:i[0]||(i[0]=s=>P(j(K)))},{default:C((()=>[I(b(j(l)("取消")),1)])),_:1})]),_("div",A,[y(m,{"stroke-width":3,percentage:Number((null==(o=j(K).log)?void 0:o.pre)||0),"show-indicator":!1},null,8,["percentage"]),_("div",B,[_("div",D,[_("span",J,b(null==(c=j(K).log)?void 0:c.used)+" / "+b(j(t)(null==(r=j(K).log)?void 0:r.total)),1),_("span",null,b(j(l)("预计还要"))+":"+b(null==(u=j(K).log)?void 0:u.time),1)]),_("span",null,b(null==(p=j(K).log)?void 0:p.speed)+"/s",1)])])],64)):(h(),w(k,{key:1},[_("div",N,[_("span",O,b("".concat(j(K).name,":").concat(j(K).shell)),1),y(j(e),{onClick:i[1]||(i[1]=s=>P(j(K)))},{default:C((()=>[I(b(j(l)("取消")),1)])),_:1})]),_("div",U,[y(s,{content:j(K).log,isHtml:!0,class:"max-h-[180px] h-[180px]"},null,8,["content"])])],64)),j(G).length>1?(h(),w("div",V,[_("div",W,b(j(l)("等待执行任务")),1),(h(!0),w(k,null,z(j(G).slice(1),(s=>(h(),w("div",{class:"title item w-full !text-[#ccc] items-center",key:s.id},[_("span",X,b("".concat(s.name,":").concat(s.shell)),1),_("span",{class:"svgtofont-el-close-bold text-danger cursor-pointer ml-10px",onClick:a=>P(s)},null,8,Y)])))),128))])):F("",!0)])}}}),[["__scopeId","data-v-c0969206"]]);export{Z as default};
