import{_ as S}from"./index-DIKmrNCq.js?v=1773287522785";import{C as m,l as j,ar as R,i as T}from"./index-BTglIPU2.js?v=1773287522785";import{u as U}from"./useLoading-CZ2gSAW7.js?v=1773287522785";import z from"./backup-info-oSTuIzgU.js?v=1773287522785";import{u as I,G as L,H as O}from"./utils-fCmtiQ1f.js?v=1773287522785";import{k as P,R as A,r as F,e as G,$ as H,a8 as q,a9 as s,a0 as t,S as e,j as c,aa as o,ak as g,_ as u}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import{ak as E,aj as J,k as K,al as M,ad as Q,a9 as W}from"./naive-ui--dJnpVcV.js?v=1773287522785";import"./prismjs-BZPoR7_J.js?v=1773287522785";import"./index.vue_vue_type_script_setup_true_lang-BeO8Hyma.js?v=1773287522785";import"./data-BVsViUMm.js?v=1773287522785";import"./useTableData-BmkIKQ_R.js?v=1773287522785";const X={class:"text-error"},re=P({__name:"index",props:{onRefresh:{type:Function},data:{}},setup(b,{expose:h}){const{t:n}=A(),l=b,B=I(),_=F({}),p=G({auto_exit:!1,force_restore:!1}),C=()=>({timestamp:l.data.timestamp,auto_exit:p.auto_exit?1:0,force_restore:p.force_restore?1:0}),w=async()=>new Promise(i=>{R({title:n("Config.Backup.index_68"),content:()=>t(Q,{type:"warning"},{default:()=>[t("span",{class:"color-warning font-bold"},[c(" "),n("Config.Backup.index_69"),c(" ")])]}),onConfirm:async()=>{await O(C()),l.onRefresh(),i(!0)}})}),{loading:y,setLoading:f}=U(),d=async()=>{try{f(!0);const{message:i}=await L({timestamp:l.data.timestamp,type:"backup"});T(i)&&(_.value=i,B.getData(i.data_status))}finally{f(!1)}};return d(),h({onConfirm:w}),(i,k)=>{const r=J,N=E,$=M,V=K,x=j,v=S,D=W;return H(),q(D,{show:e(y),class:"p-16px"},{default:s(()=>[t(N,{class:"mb-16px",column:2,bordered:"","label-placement":"left","label-style":{width:"150px"}},{default:s(()=>[t(r,{label:e(n)("Config.Backup.index_59")},{default:s(()=>[c(o(l.data.backup_name),1)]),_:1},8,["label"]),t(r,{label:e(n)("Config.Backup.index_60")},{default:s(()=>{var a;return[c(o((a=e(_))==null?void 0:a.done_time),1)]}),_:1},8,["label"]),t(r,{label:e(n)("Config.Backup.index_61")},{default:s(()=>{var a;return[c(o(e(m)(Number(((a=e(_))==null?void 0:a.backup_file_size)||0))),1)]}),_:1},8,["label"]),t(r,{label:e(n)("Config.Backup.index_62")},{default:s(()=>{var a;return[c(o((a=e(_))==null?void 0:a.backup_file),1)]}),_:1},8,["label"]),t(r,{label:e(n)("Config.Backup.index_63")},{default:s(()=>{var a;return[c(o((a=e(_))==null?void 0:a.backup_file_sha256),1)]}),_:1},8,["label"])]),_:1}),t(z),t(V,{class:"flex-col! my-20px gap-16px!"},{default:s(()=>[g("",!0),t($,{checked:e(p).force_restore,"onUpdate:checked":k[1]||(k[1]=a=>e(p).force_restore=a)},{default:s(()=>[c(o(e(n)("Config.Backup.index_64")),1)]),_:1},8,["checked"]),g("",!0)]),_:1}),t(v,{class:"mt-16px"},{default:s(()=>[u("li",null,[t(x,{name:"base-warning",class:"text-warning mr-4px",size:"16"}),u("span",null,[u("text",null,o(e(n)("Config.Backup.index_65"))+" "+o(e(m)(e(_).disk_use))+" "+o(e(n)("Config.Backup.index_66"))+" "+o(e(m)(e(_).disk_free)),1),t(x,{name:"base-refresh",class:"text-primary ml-4px",onClick:d})])]),u("li",X,o(e(n)("Config.Backup.index_67")),1)]),_:1})]),_:1},8,["show"])}}});export{re as default};
