import{d as a,_ as e,p as s}from"./public.js?v=1764830988434";import{a8 as t,a7 as n,n as l,_ as o,T as i,d as r}from"./page_layout.js?v=1764830988434";import p from"./backup-info.js?v=1764830988434";import{u,G as c,H as d}from"./utils.js?v=1764830988434";import{k as f,P as _,r as m,e as x,a2 as b,V as k,a3 as g,W as C,U as j,j as y,a4 as v,an as B,S as h}from"./vue.js?v=1764830988434";import{da as w,_ as z,dk as H}from"./naive.js?v=1764830988434";import"./common.js?v=1764830988434";import"./__commonjsHelpers__.js?v=1764830988434";import"./soft.js?v=1764830988434";import"./site.js?v=1764830988434";const P={class:"text-error"},R=f({__name:"index",props:{onRefresh:{type:Function},data:{}},setup(f,{expose:R}){const{t:U}=_(),D=f,F=u(),G=m({}),L=x({auto_exit:!1,force_restore:!1}),{loading:N,setLoading:S}=a(),T=async()=>{try{S(!0);const{message:a}=await c({timestamp:D.data.timestamp,type:"backup"});r(a)&&(G.value=a,F.getData(a.data_status))}finally{S(!1)}};return T(),R({onConfirm:async()=>new Promise(a=>{s({title:U("Config.Backup.index_68"),content:()=>C(H,{type:"warning"},{default:()=>[C("span",{class:"color-warning font-bold"},[y(" "),U("Config.Backup.index_69"),y(" ")])]}),onConfirm:async()=>{await d({timestamp:D.data.timestamp,auto_exit:L.auto_exit?1:0,force_restore:L.force_restore?1:0}),D.onRefresh(),a(!0)}})})}),(a,s)=>{const r=n,u=t,c=z,d=w,f=o,_=e,m=i;return k(),b(m,{show:j(N),class:"p-16px"},{default:g(()=>[C(u,{class:"mb-16px",column:2,bordered:"","label-placement":"left","label-style":{width:"150px"}},{default:g(()=>[C(r,{label:j(U)("Config.Backup.index_59")},{default:g(()=>[y(v(D.data.backup_name),1)]),_:1},8,["label"]),C(r,{label:j(U)("Config.Backup.index_60")},{default:g(()=>{var a;return[y(v(null==(a=j(G))?void 0:a.done_time),1)]}),_:1},8,["label"]),C(r,{label:j(U)("Config.Backup.index_61")},{default:g(()=>{var a;return[y(v(j(l)(Number((null==(a=j(G))?void 0:a.backup_file_size)||0))),1)]}),_:1},8,["label"]),C(r,{label:j(U)("Config.Backup.index_62")},{default:g(()=>{var a;return[y(v(null==(a=j(G))?void 0:a.backup_file),1)]}),_:1},8,["label"]),C(r,{label:j(U)("Config.Backup.index_63")},{default:g(()=>{var a;return[y(v(null==(a=j(G))?void 0:a.backup_file_sha256),1)]}),_:1},8,["label"])]),_:1}),C(p),C(d,{class:"flex-col! my-20px gap-16px!"},{default:g(()=>[B("",!0),C(c,{checked:j(L).force_restore,"onUpdate:checked":s[1]||(s[1]=a=>j(L).force_restore=a)},{default:g(()=>[y(v(j(U)("Config.Backup.index_64")),1)]),_:1},8,["checked"]),B("",!0)]),_:1}),C(_,{class:"mt-16px"},{default:g(()=>[h("li",null,[C(f,{name:"base-warning",class:"text-warning mr-4px",size:"16"}),h("span",null,[h("text",null,v(j(U)("Config.Backup.index_65"))+" "+v(j(l)(j(G).disk_use))+" "+v(j(U)("Config.Backup.index_66"))+" "+v(j(l)(j(G).disk_free)),1),C(f,{name:"base-refresh",class:"text-primary ml-4px",onClick:T})])]),h("li",P,v(j(U)("Config.Backup.index_67")),1)]),_:1})]),_:1},8,["show"])}}});export{R as default};
