File: /www/server/panel/BTPanel/static/js/index472.js
import{c as k,g as n,j as u,k as p,q as e,s as r,p as o,e as y,y as g,aX as w}from"./base-lib.js?v=1777008528";import{cZ as F}from"./utils-lib.js?v=1777008528";import"./__commonjsHelpers__.js?v=1777008528";const N={class:"file-transfer-progress"},S={class:"transfer-content"},P={class:"transfer-paths"},L={class:"path-item"},T={class:"path-value"},B={class:"path-item"},I={class:"path-value"},M={class:"path-item"},V=["title"],$={class:"progress-section"},C={class:"progress-info"},E={class:"progress-percentage"},Z={key:0,class:"text-tertiary text-small mt-[1rem]"},j={class:"transfer-stats"},q={class:"stat-left"},O={class:"stat-item total"},X={class:"stat-value"},z={class:"stat-right"},A={class:"stat-item success"},G={class:"stat-value"},H={class:"stat-item error"},J={class:"stat-value"},K={class:"stat-item remaining"},Q={class:"stat-value"},R={key:1,class:"transfer-details"},U={class:"detail-item"},W=k({__name:"index",props:{compData:{default:()=>({target_path:"",target_node:{name:""},source_node:{name:""},file_count:0,file_complete:0,file_error:0,progress:0,fileList:[]})}},setup(h){const s=h,m=n(()=>{const a=s.compData.value.progress||0;if(typeof a!="number"||isNaN(a)||a===0)return 0;const t=a.toString(),d=t.indexOf(".");if(d===-1||a%1===0)return a;const l=t.substring(d+1);let i=0;for(;i<l.length&&l[i]==="0";)i++;const b=i+2;return parseFloat(a.toFixed(b))}),c=n(()=>Math.max(0,s.compData.value.file_count-s.compData.value.file_complete-s.compData.value.file_error)),v=n(()=>{var a;for(let t=0;t<((a=s.compData.value.fileList)==null?void 0:a.length);t++)if(s.compData.value.fileList[t].status==="pending")return s.compData.value.fileList[t].target_path;return""}),_=n(()=>s.compData.value.file_count===0?"waiting":c.value===0?"completed":s.compData.value.file_error>0&&c.value===0?"error":"transferring"),f=n(()=>_.value==="transferring"),D=n(()=>{switch(_.value){case"completed":return s.compData.value.file_error>0?"warning":"success";case"error":return"exception";case"transferring":return;default:return}}),x=n(()=>{if(!f.value||s.compData.value.file_complete===0)return"计算中...";const t=c.value*2;return t<60?"".concat(t,"秒"):t<3600?"".concat(Math.round(t/60),"分钟"):"".concat(Math.round(t/3600),"小时")});return(a,t)=>{var l,i;const d=w;return u(),p("div",N,[e("div",S,[e("div",P,[e("div",L,[t[0]||(t[0]=e("div",{class:"path-label"},"源节点:",-1)),e("div",T,r(((l=s.compData.value.source_node)==null?void 0:l.name)||"未指定"),1)]),e("div",B,[t[1]||(t[1]=e("div",{class:"path-label"},"目标节点:",-1)),e("div",I,r(((i=s.compData.value.target_node)==null?void 0:i.name)||"未指定"),1)]),e("div",M,[t[2]||(t[2]=e("div",{class:"path-label"},"目标路径:",-1)),e("div",{class:"path-value",title:s.compData.value.target_path},r(s.compData.value.target_path||"未指定"),9,V)])]),e("div",$,[e("div",C,[t[3]||(t[3]=e("span",{class:"progress-text"},"传输进度",-1)),e("span",E,r(o(m))+"%",1)]),y(d,{percentage:o(m),status:o(D),"stroke-width":8,"show-text":!1,color:"var(--el-color-primary)"},null,8,["percentage","status"])]),o(v)?(u(),p("div",Z,"正在传输:"+r(o(v)),1)):g("",!0),e("div",j,[e("div",q,[e("div",O,[t[4]||(t[4]=e("div",{class:"stat-label"},"总计",-1)),e("div",X,r(s.compData.value.file_count),1)])]),e("div",z,[e("div",A,[t[5]||(t[5]=e("span",{class:"text-success mr-[0.5rem] svgtofont-el-circle-check"},null,-1)),t[6]||(t[6]=e("div",{class:"stat-label text-success"},"已完成",-1)),e("div",G,r(s.compData.value.file_complete),1)]),e("div",H,[t[7]||(t[7]=e("span",{class:"text-dangerDark mr-[0.5rem] svgtofont-el-circle-close"},null,-1)),t[8]||(t[8]=e("div",{class:"stat-label text-dangerDark"},"失败",-1)),e("div",J,r(s.compData.value.file_error),1)]),e("div",K,[t[9]||(t[9]=e("span",{class:"text-secondary mr-[0.5rem] svgtofont-icon-login-time"},null,-1)),t[10]||(t[10]=e("div",{class:"stat-label text-secondary"},"剩余",-1)),e("div",Q,r(o(c)),1)])])]),o(f)?(u(),p("div",R,[e("div",U,[e("span",null,"预计剩余时间: "+r(o(x)),1)])])):g("",!0)])])}}}),st=F(W,[["__scopeId","data-v-f92cd569"]]);export{st as default};