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