import{_ as s}from"./index101.js?v=1753954525509";import{c as e,o as a,_ as t}from"./page_layout.js?v=1753954525509";import{c as r,g as o}from"./index17.js?v=1753954525509";import{d as n}from"./public.js?v=1753954525509";import{k as p,P as i,e as l,o as _,b as c,U as m,V as u,al as g,Q as d,a2 as f,W as x,j,X as h,a1 as v}from"./vue.js?v=1753954525509";import{c6 as w,bA as y,bY as k}from"./naive.js?v=1753954525509";import"./common.js?v=1753954525509";import"./__commonjsHelpers__.js?v=1753954525509";import"./index.js?v=1753954525509";import"./index.vue_vue_type_script_setup_true_lang.js?v=1753954525509";import"./backup-info.js?v=1753954525509";import"./utils.js?v=1753954525509";import"./soft.js?v=1753954525509";const b={class:"p-16px"},C={class:"h-250px"},I=p({__name:"index",props:{onRefresh:{}},emits:["close"],setup(p,{emit:I}){const{t:R}=i(),z=I,M=p,q=l({task_msg:"",exec_log:"",progress:0}),A=()=>{n({title:R("Config.Backup.index_14"),content:R("Config.Migrate.index_24"),onConfirm:async()=>{B&&clearInterval(B),await r(),z("close")}})};let B=null;const D=async()=>{const{message:s}=await o();e(s)&&(q.task_msg=s.migrate_msg,q.exec_log=s.migrate_log,q.progress=s.migrate_progress,2!==s.run_status&&3!==s.run_status||(B&&clearInterval(B),2===s.run_status?M.onRefresh("success",{panel_addr:s.panel_addr,panel_user:s.panel_user,panel_password:s.panel_password,start_time:s.start_time,last_update:s.last_update}):M.onRefresh("error",{errData:s.err_info,start_time:s.start_time,last_update_time:s.last_update,server_ip:s.server_ip,ssh_port:s.ssh_port,ssh_user:s.ssh_user,password:s.password}),z("close")))};return _((()=>{D(),B=window.setInterval((()=>{D()}),2e3)})),c((()=>{B&&clearInterval(B)})),(e,r)=>{const o=a,n=w,p=y,i=t,l=k,_=s;return m(),u("div",b,[g("",!0),d(n,{type:"warning"},{default:f((()=>[r[1]||(r[1]=x("span",{class:"color-warning"},"Migration is in progress, please do not close the page, if you have any questions please contact us in time ",-1)),d(o,{href:"mailto:support@aapanel.com",target:"_blank"},{default:f((()=>r[0]||(r[0]=[j("support@aapanel.com")]))),_:1,__:[0]})])),_:1,__:[1]}),d(l,{class:"flex-nowrap! items-center my-10px",size:5},{default:f((()=>[d(p,{height:24,percentage:h(q).progress,"indicator-placement":"inside",processing:h(q).progress<100,status:"success"},null,8,["percentage","processing"]),h(q).progress<100?(m(),v(i,{key:0,name:"base-error",class:"text-error hover:text-#777777",size:20,onClick:A})):g("",!0)])),_:1}),x("div",C,[d(_,{log:h(q).exec_log},null,8,["log"])])])}}});export{I as default};
