import{_ as b}from"./index-lEMZglLp.js?v=1773287522785";import{_ as y,l as B,h as I,i as M}from"./index-BTglIPU2.js?v=1773287522785";import{c as N,g as R}from"./index-DbJBn-i5.js?v=1773287522785";import{k as V,R as $,e as j,o as z,b as D,$ as l,Z as q,ak as m,a0 as o,a9 as r,_ as u,j as E,S as a,a8 as O}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import{ad as P,ab as S,k as T}from"./naive-ui--dJnpVcV.js?v=1773287522785";import"./prismjs-BZPoR7_J.js?v=1773287522785";import"./index-DIKmrNCq.js?v=1773287522785";import"./index.vue_vue_type_script_setup_true_lang-D8O2mMsP.js?v=1773287522785";import"./backup-info-oSTuIzgU.js?v=1773287522785";import"./index.vue_vue_type_script_setup_true_lang-BeO8Hyma.js?v=1773287522785";import"./data-BVsViUMm.js?v=1773287522785";import"./utils-fCmtiQ1f.js?v=1773287522785";import"./useTableData-BmkIKQ_R.js?v=1773287522785";const U={class:"p-16px"},Z={class:"h-250px"},te=V({__name:"index",props:{onRefresh:{}},emits:["close"],setup(g,{emit:d}){const{t:_}=$(),i=d,p=g,s=j({task_msg:"",exec_log:"",progress:0}),f=()=>{I({title:_("Config.Backup.index_14"),content:_("Config.Migrate.index_24"),onConfirm:async()=>{t&&clearInterval(t),await N(),i("close")}})};let t=null;const c=async()=>{const{message:e}=await R();M(e)&&(s.task_msg=e.migrate_msg,s.exec_log=e.migrate_log,s.progress=e.migrate_progress,(e.run_status===2||e.run_status===3)&&(t&&clearInterval(t),e.run_status===2?p.onRefresh("success",{panel_addr:e.panel_addr,panel_user:e.panel_user,panel_password:e.panel_password,start_time:e.start_time,last_update:e.last_update}):p.onRefresh("error",{errData:e.err_info,start_time:e.start_time,last_update_time:e.last_update,server_ip:e.server_ip,ssh_port:e.ssh_port,ssh_user:e.ssh_user,password:e.password}),i("close")))};return z(()=>{c(),t=window.setInterval(()=>{c()},2e3)}),D(()=>{t&&clearInterval(t)}),(e,n)=>{const x=y,h=P,k=S,w=B,v=T,C=b;return l(),q("div",U,[m("",!0),o(h,{type:"warning"},{default:r(()=>[n[1]||(n[1]=u("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)),o(x,{href:"mailto:support@yakpanel.com",target:"_blank"},{default:r(()=>n[0]||(n[0]=[E("support@yakpanel.com")])),_:1,__:[0]})]),_:1,__:[1]}),o(v,{class:"flex-nowrap! items-center my-10px",size:5},{default:r(()=>[o(k,{height:24,percentage:a(s).progress,"indicator-placement":"inside",processing:a(s).progress<100,status:"success"},null,8,["percentage","processing"]),a(s).progress<100?(l(),O(w,{key:0,name:"base-error",class:"text-error hover:text-#777777",size:20,onClick:f})):m("",!0)]),_:1}),u("div",Z,[o(C,{log:a(s).exec_log},null,8,["log"])])])}}});export{te as default};