dsql-admin/dsql-app/.local_dist/static/chunks/pages/su/backups-515e155cc25fc6e2.js
Benjamin Toby a7dfd48284 Updates
2024-12-09 10:39:09 +01:00

1 line
5.3 KiB
JavaScript

(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1984],{594:(e,t,a)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/su/backups",function(){return a(1977)}])},1975:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});var s=a(4848),r=a(6540),i=a(3698),n=a(620);function c(e){let[t,a]=r.useState(null),[c,l]=r.useState(!1),[d,h]=r.useState(0);function u(){(0,i.A)("/api/admin/grabErrorLogs").then(e=>{var t;if("string"!=typeof e.log||(null===(t=e.log)||void 0===t?void 0:t.match(/./)))a("");else{a("No Logs Yet");return}a(e.log.replace(/\n|\r|\n\r|\\n/gm,"<br/>"))})}return r.useEffect(()=>{u(),0===d&&setInterval(()=>{u()},1e4)},[d]),(0,s.jsxs)(r.Fragment,{children:[(0,s.jsxs)("div",{className:"w-full justify-between",children:[(0,s.jsx)("h2",{className:"text-xl m-0",children:"Error Logs"}),(0,s.jsx)("div",{children:(0,s.jsxs)("button",{onClick:e=>{window.confirm("Clear Error Logs?")&&(l(!0),(0,i.A)("/api/admin/clearErrorLogs","post").then(e=>{console.log(e),h(e=>e+1)}),setTimeout(()=>{l(!1)},2e3))},className:"outlined gray relative",children:[c&&(0,s.jsx)(n.A,{width:"20px"}),"Clear Error Log"]})})]}),(0,s.jsxs)("section",{className:"paper",children:[t&&(0,s.jsx)("p",{dangerouslySetInnerHTML:{__html:t||"No Log"}}),!t&&(0,s.jsx)(n.A,{position:"relative",width:"25px"})]})]})}},7296:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(5737).A)("CloudUpload",[["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"M12 12v9",key:"192myk"}],["path",{d:"m16 16-4-4-4 4",key:"119tzi"}]])},6831:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(5737).A)("DatabaseBackup",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 12a9 3 0 0 0 5 2.69",key:"1ui2ym"}],["path",{d:"M21 9.3V5",key:"6k6cib"}],["path",{d:"M3 5v14a9 3 0 0 0 6.47 2.88",key:"i62tjy"}],["path",{d:"M12 12v4h4",key:"1bxaet"}],["path",{d:"M13 20a5 5 0 0 0 9-3 4.5 4.5 0 0 0-4.5-4.5c-1.33 0-2.54.54-3.41 1.41L12 16",key:"1f4ei9"}]])},8622:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(5737).A)("FileWarning",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},5501:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(5737).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"}]])},7206:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(5737).A)("Home",[["path",{d:"m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"y5dka4"}],["polyline",{points:"9 22 9 12 15 12 15 22",key:"e2us08"}]])},4858:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(5737).A)("LockKeyhole",[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]])},2750:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(5737).A)("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]])},2595:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(5737).A)("SquareChevronRight",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"m10 8 4 4-4 4",key:"1wy4r4"}]])},4909:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(5737).A)("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]])},1977:(e,t,a)=>{"use strict";a.r(t),a.d(t,{__N_SSP:()=>h,default:()=>u});var s=a(4848),r=a(6540),i=a(2016);a(1975);var n=a(3698),c=a(620),l=a(5501);function d(e){let[t,a]=r.useState(!1),[i,d]=r.useState([]),[h,u]=r.useState(0);return r.useEffect(()=>{(0,n.A)("/api/admin/grabBackups").then(e=>{d(e.backups)})},[h]),(0,s.jsxs)(r.Fragment,{children:[t&&(0,s.jsx)(c.A,{}),(0,s.jsxs)("div",{className:"w-full justify-between",children:[(0,s.jsx)("h2",{className:"text-xl m-0",children:"Backups"}),(0,s.jsx)("div",{children:(0,s.jsx)("button",{onClick:e=>{window.confirm("Create new backup?")&&(a(!0),(0,n.A)("/api/admin/createNewBackup").then(e=>{u(e=>e+1),setTimeout(()=>{a(!1)},2e3)}))},className:"relative",children:"Create New Backup"})})]}),(0,s.jsxs)("section",{className:i&&i[0]?"p-0 gap-4":"paper",children:[!i&&(0,s.jsx)(c.A,{}),i&&i[0]&&i.sort((e,t)=>parseInt(e)>parseInt(t)?-1:1).map((e,t)=>{let a=new Date(parseInt(e));return(0,s.jsxs)("a",{href:"/su/backups/".concat(e),className:"card w-full items-center",children:[(0,s.jsx)(l.A,{}),(0,s.jsx)("b",{children:"Backup:"}),(0,s.jsx)("span",{children:a.toString()})]},e)}),i&&!i[0]&&(0,s.jsx)("span",{children:"No Backups Yet"})]})]})}var h=!0;function u(e){let{user:t,data:a}=e,r=(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("title",{children:"Backups | Datasquirel"}),(0,s.jsx)("meta",{name:"description",content:"Databases backups"})]});return(0,s.jsx)(i.A,{head:r,user:t,children:(0,s.jsx)(d,{})})}}},e=>{var t=t=>e(e.s=t);e.O(0,[2016,636,6593,8792],()=>t(594)),_N_E=e.O()}]);