import{_ as e}from"./index119.js?v=1761009159";import{c as a,r as s,w as l,q as t,aF as i,v as n,x as c,z as r,A as o,y as m,e as u,B as d,C as p,G as v}from"./base-lib.js?v=1761009159";import{b as f,p as g,P as x}from"./utils-lib.js?v=1761009159";import{getBackupLogs as _,stopBackup as w}from"./site.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";const b={class:"p-2rem flex-wrap"},y={class:"relative w-full text-medium flex items-center leading-4rem mb-1rem justify-between"},j={class:"ml-1rem"},C={class:"grid grid-cols-3 leading-3rem py-1rem text-base"},h={class:"flex items-center mr-1rem"},D={class:"truncate flex-1"},k={class:"flex items-center mr-1rem"},T={class:"truncate flex-1"},q={class:"flex items-center"},H={class:"truncate flex-1"},M=a({__name:"backup-log",props:{compData:{default:()=>({type:"scan",endMsg:"扫描结束",logPath:"",successMsg:"修复成功",isClear:!1,completeEvent:null,id:""})}},emits:["close","onCancel"],setup(a,{expose:M,emit:P}){const z=a,A=P,B=s(""),E=s(""),F=s(""),G=s("");l(()=>z.compData,e=>{J.value=!0,O()});const L=f(),I=s("获取中...\t"),J=s(!0),K=s(null);let N=!1;const O=async()=>{if(!N)try{const{data:e}=await _({id:z.compData.id});if(I.value!==e.msg&&(I.value=e.msg),(null==e?void 0:e.total)&&(B.value=e.total,E.value=e.speed,F.value=e.site_name,G.value=e.title),e.stop)return J.value=!1,void(e.status?(L.success(e.title),A("close"),R()):(L.error(e.title),J.value=!1));!e.stop&&J.value&&(K.value=setTimeout(function(){O()},1e3))}catch(e){J.value&&O()}},Q=async()=>{await g({width:"40rem",title:"取消备份",content:'<p>取消选中站点备份文件后，<span class="text-danger">该站点备份文件将永久消失</span>，是否继续？</p>',icon:"warning-filled",isHtml:!0}),await x({loading:"正在取消备份，请稍后...",request:w({id:z.compData.id}),message:!0}),A("close")},R=()=>{K.value&&clearTimeout(K.value)},S=()=>{z.compData.isClear&&clearTimeout(K.value)};return A("onCancel",S),t(()=>{O()}),i(()=>{R(),N=!0}),M({onCancel:S}),(a,s)=>{const l=v,t=e;return n(),c("div",b,[r("div",y,[r("div",null,[s[0]||(s[0]=r("i",{class:"svgtofont-el-loading text-iconLarge"},null,-1)),r("span",j,o(m(G)||"正在备份，请稍后..."),1)]),u(l,{type:"warning",plain:"",onClick:Q},{default:d(()=>s[1]||(s[1]=[p("取消备份",-1)])),_:1,__:[1]})]),s[5]||(s[5]=r("hr",{class:"!border-dark"},null,-1)),r("div",C,[r("div",h,[s[2]||(s[2]=r("span",null,"备份网站：",-1)),r("div",D,o(m(F)||"--"),1)]),r("div",k,[s[3]||(s[3]=r("div",null,"已备份：",-1)),r("div",T,o(m(B)||"--"),1)]),r("div",q,[s[4]||(s[4]=r("div",null,"备份速度：",-1)),r("div",H,o(m(E)||"--"),1)])]),u(t,{class:"h-[30rem]",content:m(I)},null,8,["content"])])}}});export{M as default};
