const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["js/backup-success.js?v=1753954525509","js/public.js?v=1753954525509","js/page_layout.js?v=1753954525509","js/vue.js?v=1753954525509","js/__commonjsHelpers__.js?v=1753954525509","js/naive.js?v=1753954525509","js/common.js?v=1753954525509","css/page_layout.css?v=1753954525509","css/public.css?v=1753954525509","js/backup-error.js?v=1753954525509"])))=>i.map(i=>d[i]);
import{a as e,c as s,n as a,_ as t}from"./page_layout.js?v=1753954525509";import{_ as o}from"./index.js?v=1753954525509";import{_ as i}from"./index101.js?v=1753954525509";import{J as n,K as r}from"./utils.js?v=1753954525509";import{e as p,d as c}from"./public.js?v=1753954525509";import{k as l,P as _,e as u,o as m,b as f,U as d,V as k,al as g,Q as h,a2 as b,X as w,a1 as x,W as y,_ as j}from"./vue.js?v=1753954525509";import{bA as v,bY as C}from"./naive.js?v=1753954525509";import"./common.js?v=1753954525509";import"./__commonjsHelpers__.js?v=1753954525509";import"./soft.js?v=1753954525509";const I={class:"p-16px"},B={class:"h-250px"},R=l({__name:"index",props:{onRefresh:{},type:{default:"backup"}},emits:["close"],setup(l,{emit:R}){const{t:z}=_(),E=j((()=>e((()=>import("./backup-success.js?v=1753954525509")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),A=j((()=>e((()=>import("./backup-error.js?v=1753954525509")),__vite__mapDeps([9,1,2,3,4,5,6,7,8])))),D=R,P=l,U=p("backup"===P.type?z("Config.Backup.index_80"):z("Config.Backup.index_81")),V=p("backup"===P.type?z("Config.Backup.index_82"):z("Config.Backup.index_83")),L=u({}),O=()=>{const e="backup"===P.type?z("Config.Backup.index_78"):z("Config.Backup.index_79");c({title:z("Config.Backup.index_14"),content:e,onConfirm:async()=>{H&&clearInterval(H),await n({timestamp:void 0}),T()}})},T=()=>{H&&clearInterval(H),D("close"),P.onRefresh()};let H=null;const J=async()=>{const{message:e}=await r({type:P.type});if(s(e)){if(L.task_msg=e.task_msg,L.exec_log=e.exec_log,L.progress=e.progress,100!==e.progress&&2!==e.task_status&&3!==e.task_status||H&&clearInterval(H),2===e.task_status||3===e.task_status)return P.onRefresh(),U.data.type=P.type,U.data.backup_file_info={name:e.backup_file_info.backup_name,files_size:a(Number(e.backup_file_info.backup_file_size)),end_time:e.backup_file_info.done_time,time_count:"backup"===P.type?e.backup_file_info.total_time:e.backup_file_info.restore_total_time,backup_file_sha256:e.backup_file_info.backup_file_sha256},U.show=!0,void(H&&clearInterval(H));3===e.task_status&&(P.onRefresh(),V.data.errData=e.err_info,V.show=!0,H&&clearInterval(H))}};return m((()=>{J(),H=window.setInterval((()=>{J()}),2e3)})),f((()=>{H&&clearInterval(H)})),(e,s)=>{const a=v,n=t,r=C,p=i,c=o;return d(),k("div",I,[g("",!0),h(r,{class:"flex-nowrap! items-center my-10px",size:5},{default:b((()=>[h(a,{height:24,percentage:w(L).progress,"indicator-placement":"inside",processing:w(L).progress<100,status:"success"},null,8,["percentage","processing"]),w(L).progress<100?(d(),x(n,{key:0,name:"base-error",class:"text-error",size:20,onClick:O})):g("",!0)])),_:1}),y("div",B,[h(p,{log:w(L).exec_log},null,8,["log"])]),h(c,{show:w(U).show,"onUpdate:show":s[0]||(s[0]=e=>w(U).show=e),title:w(U).title,data:w(U).data,width:"600","min-height":350,component:w(E),onClose:T},null,8,["show","title","data","component"]),h(c,{show:w(V).show,"onUpdate:show":s[1]||(s[1]=e=>w(V).show=e),title:w(V).title,data:w(V).data,width:"600","min-height":350,component:w(A),onClose:T},null,8,["show","title","data","component"])])}}});export{R as default};
