const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["js/backup-success-Nl3VMVXX.js?v=1773287522785","js/index-DIKmrNCq.js?v=1773287522785","js/index-BTglIPU2.js?v=1773287522785","js/vue-core-DJjvd5ZC.js?v=1773287522785","js/prismjs-BZPoR7_J.js?v=1773287522785","css/prismjs-D-3FhBe_.css?v=1773287522785","js/naive-ui--dJnpVcV.js?v=1773287522785","css/index-DEM1fxGq.css?v=1773287522785","js/backup-error-Cd4UtPJ4.js?v=1773287522785","js/index.vue_vue_type_script_setup_true_lang-BeO8Hyma.js?v=1773287522785","js/data-BVsViUMm.js?v=1773287522785","js/useTableData-BmkIKQ_R.js?v=1773287522785"])))=>i.map(i=>d[i]);
import{v as f,l as D,x as M,P as d,h as P,i as V,C as z}from"./index-BTglIPU2.js?v=1773287522785";import{_ as N}from"./index-lEMZglLp.js?v=1773287522785";import{J as U,K as A}from"./utils-fCmtiQ1f.js?v=1773287522785";import{k as O,R as F,e as L,o as S,b as T,$ as k,Z as $,ak as g,a0 as c,a9 as j,S as t,a8 as J,_ as K,a3 as h}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import{ab as Z,k as q}from"./naive-ui--dJnpVcV.js?v=1773287522785";import"./prismjs-BZPoR7_J.js?v=1773287522785";import"./useTableData-BmkIKQ_R.js?v=1773287522785";const G={class:"p-16px"},H={class:"h-250px"},se=O({__name:"index",props:{onRefresh:{},type:{default:"backup"}},emits:["close"],setup(b,{emit:x}){const{t:n}=F(),w=h(()=>d(()=>import("./backup-success-Nl3VMVXX.js?v=1773287522785"),__vite__mapDeps([0,1,2,3,4,5,6,7]))),C=h(()=>d(()=>import("./backup-error-Cd4UtPJ4.js?v=1773287522785"),__vite__mapDeps([8,9,2,3,4,5,6,7,10,11]))),v=x,s=b,a=f(s.type==="backup"?n("Config.Backup.index_80"):n("Config.Backup.index_81")),r=f(s.type==="backup"?n("Config.Backup.index_82"):n("Config.Backup.index_83")),i=L({}),y=()=>{const e=s.type==="backup"?n("Config.Backup.index_78"):n("Config.Backup.index_79");P({title:n("Config.Backup.index_14"),content:e,onConfirm:async()=>{o&&clearInterval(o),await U({timestamp:void 0}),p()}})},p=()=>{o&&clearInterval(o),v("close"),s.onRefresh()};let o=null;const u=async()=>{const{message:e}=await A({type:s.type});if(V(e)){if(i.task_msg=e.task_msg,i.exec_log=e.exec_log,i.progress=e.progress,(e.progress===100||e.task_status===2||e.task_status===3)&&o&&clearInterval(o),e.task_status===2||e.task_status===3){s.onRefresh(),a.data.type=s.type,a.data.backup_file_info={name:e.backup_file_info.backup_name,files_size:z(Number(e.backup_file_info.backup_file_size)),end_time:e.backup_file_info.done_time,time_count:s.type==="backup"?e.backup_file_info.total_time:e.backup_file_info.restore_total_time,backup_file_sha256:e.backup_file_info.backup_file_sha256},a.show=!0,o&&clearInterval(o);return}e.task_status===3&&(s.onRefresh(),r.data.errData=e.err_info,r.show=!0,o&&clearInterval(o))}};return S(()=>{u(),o=window.setInterval(()=>{u()},2e3)}),T(()=>{o&&clearInterval(o)}),(e,_)=>{const B=Z,I=D,R=q,E=N,m=M;return k(),$("div",G,[g("",!0),c(R,{class:"flex-nowrap! items-center my-10px",size:5},{default:j(()=>[c(B,{height:24,percentage:t(i).progress,"indicator-placement":"inside",processing:t(i).progress<100,status:"success"},null,8,["percentage","processing"]),t(i).progress<100?(k(),J(I,{key:0,name:"base-error",class:"text-error",size:20,onClick:y})):g("",!0)]),_:1}),K("div",H,[c(E,{log:t(i).exec_log},null,8,["log"])]),c(m,{show:t(a).show,"onUpdate:show":_[0]||(_[0]=l=>t(a).show=l),title:t(a).title,data:t(a).data,width:"600","min-height":350,component:t(w),onClose:p},null,8,["show","title","data","component"]),c(m,{show:t(r).show,"onUpdate:show":_[1]||(_[1]=l=>t(r).show=l),title:t(r).title,data:t(r).data,width:"600","min-height":350,component:t(C),onClose:p},null,8,["show","title","data","component"])])}}});export{se as default};
