"use strict";(()=>{var e={};e.id=1984,e.ids=[1984],e.modules={81811:(e,t,r)=>{r.r(t),r.d(t,{config:()=>M,default:()=>f,getServerSideProps:()=>P,getStaticPaths:()=>v,getStaticProps:()=>k,reportWebVitals:()=>q,routeModule:()=>B,unstable_getServerProps:()=>y,unstable_getServerSideProps:()=>N,unstable_getStaticParams:()=>A,unstable_getStaticPaths:()=>_,unstable_getStaticProps:()=>w});var a={};r.r(a),r.d(a,{default:()=>b,getServerSideProps:()=>j});var s=r(63865),n=r(9455),i=r(30671),u=r(5583),c=r(19796),l=r(8732),p=r(82015),d=r.n(p),o=r(61197),h=r(40778),x=r(46169),m=r(16757),g=r(47338);function S(){let[e,t]=d().useState(!1),[r,a]=d().useState([]),[s,n]=d().useState(0);return(0,l.jsxs)(d().Fragment,{children:[e&&(0,l.jsx)(m.A,{}),(0,l.jsxs)("div",{className:"w-full justify-between",children:[(0,l.jsx)("h2",{className:"text-xl m-0",children:"Backups"}),(0,l.jsx)("div",{children:(0,l.jsx)("button",{onClick:e=>{window.confirm("Create new backup?")&&(t(!0),(0,x.A)("/api/admin/createNewBackup").then(e=>{n(e=>e+1),setTimeout(()=>{t(!1)},2e3)}))},className:"relative",children:"Create New Backup"})})]}),(0,l.jsxs)("section",{className:r&&r[0]?"p-0 gap-4":"paper",children:[!r&&(0,l.jsx)(m.A,{}),r&&r[0]&&r.sort((e,t)=>parseInt(e)>parseInt(t)?-1:1).map((e,t)=>{let r=new Date(parseInt(e));return(0,l.jsxs)("a",{href:`/su/backups/${e}`,className:"card w-full items-center",children:[(0,l.jsx)(g.A,{}),(0,l.jsx)("b",{children:"Backup:"}),(0,l.jsx)("span",{children:r.toString()})]},e)}),r&&!r[0]&&(0,l.jsx)("span",{children:"No Backups Yet"})]})]})}function b({user:e,data:t}){let r=(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("title",{children:"Backups | Datasquirel"}),(0,l.jsx)("meta",{name:"description",content:"Databases backups"})]});return(0,l.jsx)(h.A,{head:r,user:e,children:(0,l.jsx)(S,{})})}async function j({req:e,res:t,query:r}){let a=await (0,o.A)(e);return a?.logged_in_status?{props:{user:a}}:{redirect:{destination:"/su/login",permanent:!1}}}let f=(0,i.M)(a,"default"),k=(0,i.M)(a,"getStaticProps"),v=(0,i.M)(a,"getStaticPaths"),P=(0,i.M)(a,"getServerSideProps"),M=(0,i.M)(a,"config"),q=(0,i.M)(a,"reportWebVitals"),w=(0,i.M)(a,"unstable_getStaticProps"),_=(0,i.M)(a,"unstable_getStaticPaths"),A=(0,i.M)(a,"unstable_getStaticParams"),y=(0,i.M)(a,"unstable_getServerProps"),N=(0,i.M)(a,"unstable_getServerSideProps"),B=new s.PagesRouteModule({definition:{kind:n.A.PAGES,page:"/su/backups",pathname:"/su/backups",bundlePath:"",filename:""},components:{App:c.default,Document:u.default},userland:a})},47338:(e,t,r)=>{r.d(t,{A:()=>a});let a=(0,r(82544).A)("FolderSync",[["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v.5",key:"1dkoa9"}],["path",{d:"M12 10v4h4",key:"1czhmt"}],["path",{d:"m12 14 1.535-1.605a5 5 0 0 1 8 1.5",key:"lvuxfi"}],["path",{d:"M22 22v-4h-4",key:"1ewp4q"}],["path",{d:"m22 18-1.535 1.605a5 5 0 0 1-8-1.5",key:"14ync0"}]])},13893:e=>{e.exports=require("@moduletrace/datasquirel/dist/client/fetch")},40361:e=>{e.exports=require("next/dist/compiled/next-server/pages.runtime.prod.js")},27912:e=>{e.exports=require("next/head")},82015:e=>{e.exports=require("react")},22326:e=>{e.exports=require("react-dom")},8732:e=>{e.exports=require("react/jsx-runtime")},79428:e=>{e.exports=require("buffer")},55511:e=>{e.exports=require("crypto")},33873:e=>{e.exports=require("path")}};var t=require("../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),a=t.X(0,[883,9821,9796,6622],()=>r(81811));module.exports=a})();