import{p as e,c as s,n as t,x as a}from"./page_layout.js?v=1763625242172";import{k as l,a as i}from"./public.js?v=1763625242172";import{m as n,g as o,n as p}from"./index39.js?v=1763625242172";import{k as r,av as c,w as m,R as u,S as d,n as x,P as f,r as g,c as v,U as k,X as _,a3 as y,a4 as j,V as b,j as h,a2 as w,F as T,O as C,an as L}from"./vue.js?v=1763625242172";import{dc as P,aC as $,bH as H}from"./naive.js?v=1763625242172";import"./common.js?v=1763625242172";import"./__commonjsHelpers__.js?v=1763625242172";import"./index.js?v=1763625242172";import"./soft2.js?v=1763625242172";import"./soft.js?v=1763625242172";import"./site.js?v=1763625242172";import"./file2.js?v=1763625242172";import"./index.vue_vue_type_script_setup_true_lang7.js?v=1763625242172";const R=["innerHTML"],F=e(r({__name:"FileTaskLogs",props:{value:{type:String,default:""}},setup(e){const s=e,t=c("logsRef");return m((()=>s.value),(()=>{x((()=>{const e=t.value;if(e){const{scrollHeight:s}=e;e.scrollTop=s}}))}),{immediate:!0}),(s,a)=>(u(),d("div",{ref_key:"logsRef",ref:t,class:"task-logs",innerHTML:e.value||s.$t("file.task.noLogs")},null,8,R))}}),[["__scopeId","data-v-ee8b8ada"]]),I={class:"p-16px"},M={class:"flex items-center justify-between h-36px px-10px rounded-tl-10px rounded-tr-10px bg-#f5f5f5"},O={class:"max-w-360px"},S={class:"text-desc text-14px"},q={key:0,class:"p-10px"},A={class:"flex items-center justify-between mt-4px"},B={class:"flex"},D={class:"mr-24px"},U={key:2,class:"mt-10px"},V={class:"flex items-center justify-between h-36px px-10px rounded-tl-10px rounded-tr-10px bg-#f5f5f5"},X={class:"text-desc text-14px"},z={class:"flex-1 w-0"},E={class:"min-w-0"},G={class:"text-weak text-14px"},J=["onClick"],K=e(r({__name:"FileTask",props:{taskList:{type:Array,default:()=>[]},store:{type:Object,required:!0}},emits:["close"],setup(e,{emit:r}){const c=r,{t:m}=f(),x=g(e.taskList),R=v((()=>x.value[0]||{log:"",name:"",shell:""})),K=async()=>{const{message:s}=await n();a(s)&&s.length>0?x.value=s:(o(e.store),c("close"))},{loop:N,clearTimer:Q}=l(K,2);N();const W=e=>{i({title:m("file.task.deleteTask"),content:m("file.task.confirmDeleteTask",{name:e.name,shell:e.shell}),onConfirm:async()=>{await p(e.id),(async()=>{Q(),await K(),N()})()}})};return(e,a)=>{const l=P,i=$,n=H;return u(),d("div",I,[k("div",M,[k("div",O,[_(l,null,{default:y((()=>[k("span",S,j(b(R).name+e.$t("Public.Punctuation.Colon")+b(R).shell),1)])),_:1})]),_(i,{type:"primary",text:"",onClick:a[0]||(a[0]=e=>W(b(R)))},{default:y((()=>[h(j(e.$t("Public.Btn.Cancel")),1)])),_:1})]),b(s)(b(R).log)?(u(),d("div",q,[_(n,{type:"line",height:3,"show-indicator":!1,percentage:b(R).log.pre||0},null,8,["percentage"]),k("div",A,[k("span",B,[k("span",D,j(b(R).log.used)+" / "+j(b(t)(b(R).log.total)),1),k("span",null,j(e.$t("file.task.estimatedRemaining"))+": "+j(b(R).log.total),1)]),k("span",null,j(b(R).log.speed)+"/s",1)])])):(u(),w(F,{key:1,value:b(R).log},null,8,["value"])),b(x).length>1?(u(),d("div",U,[k("div",V,[k("span",X,j(e.$t("file.task.waitingTasks")),1)]),(u(!0),d(T,null,C(b(x).slice(1),(s=>(u(),d("div",{key:s.id,class:"flex items-center h-36px px-10px"},[k("div",z,[k("div",E,[_(l,null,{default:y((()=>[k("span",G,j(s.name+e.$t("Public.Punctuation.Colon")+s.shell),1)])),_:2},1024)])]),k("div",{class:"flex items-center ml-12px cursor-pointer",onClick:e=>W(s)},a[1]||(a[1]=[k("i",{class:"i-streamline:delete-1-solid text-10px text-error"},null,-1)]),8,J)])))),128))])):L("",!0)])}}}),[["__scopeId","data-v-93cb7b82"]]);export{K as default};
