← Back
Editing: FileTask-CCmWcyYx.js
import{c as v,i as C,D as $,n as B,h as F}from"./index-LQ-JIYiv.js?v=1774508183068";import{u as R}from"./useLoop-CG4Cjj7d.js?v=1774508183068";import{a1 as j,t as P,a2 as N}from"./FileIcon-MbTGjXAj.js?v=1774508183068";import{k as y,al as S,w as V,$ as l,Z as i,n as D,R as H,r as I,c as A,_ as e,a0 as _,a9 as f,aa as o,S as s,j as M,a8 as O,F as q,P as E,ak as G}from"./vue-core-BlDeWrD6.js?v=1774508183068";import{n as U,B as Z,ab as z}from"./naive-ui-BjvXgNtF.js?v=1774508183068";import"./prismjs-BZPoR7_J.js?v=1774508183068";import"./copy-DTOfN-dY.js?v=1774508183068";const J=["innerHTML"],K=y({__name:"FileTaskLogs",props:{value:{type:String,default:""}},setup(c){const m=c,p=S("logsRef"),d=()=>{D(()=>{const a=p.value;if(a){const{scrollHeight:t}=a;a.scrollTop=t}})};return V(()=>m.value,()=>{d()},{immediate:!0}),(a,t)=>(l(),i("div",{ref_key:"logsRef",ref:p,class:"task-logs",innerHTML:c.value||a.$t("file.task.noLogs")},null,8,J))}}),Q=v(K,[["__scopeId","data-v-ee8b8ada"]]),W={class:"p-16px"},X={class:"flex items-center justify-between h-36px px-10px rounded-tl-10px rounded-tr-10px bg-#f5f5f5"},Y={class:"max-w-360px"},ee={class:"text-desc text-14px"},se={key:0,class:"p-10px"},te={class:"flex items-center justify-between mt-4px"},ne={class:"flex"},ae={class:"mr-24px"},oe={key:2,class:"mt-10px"},le={class:"flex items-center justify-between h-36px px-10px rounded-tl-10px rounded-tr-10px bg-#f5f5f5"},ie={class:"text-desc text-14px"},ce={class:"flex-1 w-0"},re={class:"min-w-0"},pe={class:"text-weak text-14px"},de=["onClick"],ue=y({__name:"FileTask",props:{taskList:{type:Array,default:()=>[]},store:{type:Object,required:!0}},emits:["close"],setup(c,{emit:m}){const p=m,{t:d}=H(),a=I(c.taskList),t=A(()=>a.value[0]||{log:"",name:"",shell:""}),x=async()=>{const{message:n}=await j();B(n)&&n.length>0?a.value=n:(P(c.store),p("close"))},{loop:g,clearTimer:T}=R(x,2);g();const b=async()=>{T(),await x(),g()},k=n=>{F({title:d("file.task.deleteTask"),content:d("file.task.confirmDeleteTask",{name:n.name,shell:n.shell}),onConfirm:async()=>{await N(n.id),b()}})};return(n,u)=>{const h=U,w=Z,L=z;return l(),i("div",W,[e("div",X,[e("div",Y,[_(h,null,{default:f(()=>[e("span",ee,o(s(t).name+n.$t("Public.Punctuation.Colon")+s(t).shell),1)]),_:1})]),_(w,{type:"primary",text:"",onClick:u[0]||(u[0]=r=>k(s(t)))},{default:f(()=>[M(o(n.$t("Public.Btn.Cancel")),1)]),_:1})]),s(C)(s(t).log)?(l(),i("div",se,[_(L,{type:"line",height:3,"show-indicator":!1,percentage:s(t).log.pre||0},null,8,["percentage"]),e("div",te,[e("span",ne,[e("span",ae,o(s(t).log.used)+" / "+o(s($)(s(t).log.total)),1),e("span",null,o(n.$t("file.task.estimatedRemaining"))+": "+o(s(t).log.total),1)]),e("span",null,o(s(t).log.speed)+"/s",1)])])):(l(),O(Q,{key:1,value:s(t).log},null,8,["value"])),s(a).length>1?(l(),i("div",oe,[e("div",le,[e("span",ie,o(n.$t("file.task.waitingTasks")),1)]),(l(!0),i(q,null,E(s(a).slice(1),r=>(l(),i("div",{key:r.id,class:"flex items-center h-36px px-10px"},[e("div",ce,[e("div",re,[_(h,null,{default:f(()=>[e("span",pe,o(r.name+n.$t("Public.Punctuation.Colon")+r.shell),1)]),_:2},1024)])]),e("div",{class:"flex items-center ml-12px cursor-pointer",onClick:_e=>k(r)},u[1]||(u[1]=[e("i",{class:"i-streamline:delete-1-solid text-10px text-error"},null,-1)]),8,de)]))),128))])):G("",!0)])}}}),ye=v(ue,[["__scopeId","data-v-93cb7b82"]]);export{ye as default};
Save File
Cancel