mirror of
https://github.com/aaPanel/aaPanel.git
synced 2026-08-17 21:25:47 +02:00
2 lines
3.3 KiB
JavaScript
2 lines
3.3 KiB
JavaScript
import{p as e,d as s,n as t,x as a}from"./page_layout.js?v=1769066082311";import{k as l,a as n}from"./public.js?v=1769066082311";import{a4 as i,w as o,a5 as p}from"./CalcSize.vue_vue_type_script_setup_true_lang.js?v=1769066082311";import{k as r,av as c,w as u,R as m,V as d,n as x,P as f,r as g,c as v,S as k,a2 as _,an as y,W as j,a3 as h,a4 as w,U as b,j as C,F as T,O as L}from"./vue.js?v=1769066082311";import{dd as P,aC as $,bJ as H}from"./naive.js?v=1769066082311";import"./common.js?v=1769066082311";import"./__commonjsHelpers__.js?v=1769066082311";import"./soft2.js?v=1769066082311";import"./soft.js?v=1769066082311";import"./site.js?v=1769066082311";const R=["innerHTML"],F=e(r({__name:"FileTaskLogs",props:{value:{type:String,default:""}},setup(e){const s=e,t=c("logsRef");return u(()=>s.value,()=>{x(()=>{const e=t.value;if(e){const{scrollHeight:s}=e;e.scrollTop=s}})},{immediate:!0}),(s,a)=>(d(),m("div",{ref_key:"logsRef",ref:t,class:"task-logs",innerHTML:e.value||s.$t("file.task.noLogs")},null,8,R))}}),[["__scopeId","data-v-6b50825f"]]),S={class:"p-16px"},I={class:"flex items-center justify-between h-36px px-10px rounded-tl-10px rounded-tr-10px bg-#f5f5f5"},M={class:"max-w-360px"},O={class:"text-desc text-14px"},q={key:0,class:"p-10px"},z={class:"flex items-center justify-between mt-4px"},A={class:"flex"},B={class:"mr-24px"},D={key:2,class:"mt-10px"},J={class:"flex items-center justify-between h-36px px-10px rounded-tl-10px rounded-tr-10px bg-#f5f5f5"},U={class:"text-desc text-14px"},V={class:"flex-1 w-0"},W={class:"min-w-0"},E={class:"text-weak text-14px"},G=["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:u}=f(),x=g(e.taskList),R=v(()=>x.value[0]||{log:"",name:"",shell:""}),K=async()=>{const{message:s}=await i();a(s)&&s.length>0?x.value=s:(o(e.store),c("close"))},{loop:N,clearTimer:Q}=l(K,2);N();const X=e=>{n({title:u("file.task.deleteTask"),content:u("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,n=$,i=H;return d(),m("div",S,[k("div",I,[k("div",M,[j(l,null,{default:h(()=>[k("span",O,w(b(R).name+e.$t("Public.Punctuation.Colon")+b(R).shell),1)]),_:1})]),j(n,{type:"primary",text:"",onClick:a[0]||(a[0]=e=>X(b(R)))},{default:h(()=>[C(w(e.$t("Public.Btn.Cancel")),1)]),_:1})]),b(s)(b(R).log)?(d(),m("div",q,[j(i,{type:"line",height:3,"show-indicator":!1,percentage:b(R).log.pre||0},null,8,["percentage"]),k("div",z,[k("span",A,[k("span",B,w(b(R).log.used)+" / "+w(b(t)(b(R).log.total)),1),k("span",null,w(e.$t("file.task.estimatedRemaining"))+": "+w(b(R).log.total),1)]),k("span",null,w(b(R).log.speed)+"/s",1)])])):(d(),_(F,{key:1,value:b(R).log},null,8,["value"])),b(x).length>1?(d(),m("div",D,[k("div",J,[k("span",U,w(e.$t("file.task.waitingTasks")),1)]),(d(!0),m(T,null,L(b(x).slice(1),s=>(d(),m("div",{key:s.id,class:"flex items-center h-36px px-10px"},[k("div",V,[k("div",W,[j(l,null,{default:h(()=>[k("span",E,w(s.name+e.$t("Public.Punctuation.Colon")+s.shell),1)]),_:2},1024)])]),k("div",{class:"flex items-center ml-12px cursor-pointer",onClick:e=>X(s)},a[1]||(a[1]=[k("i",{class:"i-streamline:delete-1-solid text-10px text-error"},null,-1)]),8,G)]))),128))])):y("",!0)])}}}),[["__scopeId","data-v-a04e1252"]]);export{K as default};
|