1 line
6.7 KiB
JavaScript
1 line
6.7 KiB
JavaScript
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6257],{7646:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/su/error-logs",function(){return s(9059)}])},6286:(e,t,s)=>{"use strict";s.d(t,{A:()=>c});var r=s(4848),l=s(6540),a=s(3698),i=s(620),n=s(861);function c(e){let{data:t}=e;Object.keys(t.users[0]);let[s,c]=l.useState(null),[o,d]=l.useState(0),[h,u]=l.useState(!1);function x(){(0,a.A)("/api/admin/grabErrorLogs").then(e=>{var t;if((null==e?void 0:e.log)&&"string"==typeof e.log&&!(null===(t=e.log)||void 0===t?void 0:t.match(/./))){c("No Logs Yet");return}(null==e?void 0:e.log)&&c("No Logs"),c(e.log.replace(/\n|\r|\n\r|\\n/gm,"<br/>"))})}return console.log(typeof s),l.useEffect(()=>{x(),0===o&&setInterval(()=>{x()},1e4)},[o]),(0,r.jsx)(l.Fragment,{children:(0,r.jsxs)("div",{className:"items-stretch gap-10 w-full",children:[(0,r.jsxs)("section",{className:"paper w-full",children:[(0,r.jsx)("h2",{className:"text-xl m-0 mb-6",children:"Users"}),(0,r.jsx)("div",{className:"flex-col items-stretch gap-10",children:t.users.map((e,t)=>(0,r.jsx)(n.A,{userObject:e},t+1))})]}),(0,r.jsxs)("section",{className:"paper",children:[(0,r.jsxs)("div",{className:"w-full justify-between",children:[(0,r.jsx)("h2",{className:"text-xl m-0",children:"Error Logs"}),(0,r.jsx)("div",{children:(0,r.jsxs)("button",{onClick:e=>{window.confirm("Clear Error Logs?")&&(u(!0),(0,a.A)("/api/admin/clearErrorLogs","post").then(e=>{d(e=>e+1)}),setTimeout(()=>{u(!1)},2e3))},className:"outlined gray relative",children:[h&&(0,r.jsx)(i.A,{width:"20px"}),"Clear Error Log"]})})]}),s&&(0,r.jsx)("p",{dangerouslySetInnerHTML:{__html:s||"No Log"}}),"string"!=typeof s&&(0,r.jsx)(i.A,{position:"relative",width:"25px"})]})]})})}},1975:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});var r=s(4848),l=s(6540),a=s(3698),i=s(620);function n(e){let[t,s]=l.useState(null),[n,c]=l.useState(!1),[o,d]=l.useState(0);function h(){(0,a.A)("/api/admin/grabErrorLogs").then(e=>{var t;if("string"!=typeof e.log||(null===(t=e.log)||void 0===t?void 0:t.match(/./)))s("");else{s("No Logs Yet");return}s(e.log.replace(/\n|\r|\n\r|\\n/gm,"<br/>"))})}return l.useEffect(()=>{h(),0===o&&setInterval(()=>{h()},1e4)},[o]),(0,r.jsxs)(l.Fragment,{children:[(0,r.jsxs)("div",{className:"w-full justify-between",children:[(0,r.jsx)("h2",{className:"text-xl m-0",children:"Error Logs"}),(0,r.jsx)("div",{children:(0,r.jsxs)("button",{onClick:e=>{window.confirm("Clear Error Logs?")&&(c(!0),(0,a.A)("/api/admin/clearErrorLogs","post").then(e=>{console.log(e),d(e=>e+1)}),setTimeout(()=>{c(!1)},2e3))},className:"outlined gray relative",children:[n&&(0,r.jsx)(i.A,{width:"20px"}),"Clear Error Log"]})})]}),(0,r.jsxs)("section",{className:"paper",children:[t&&(0,r.jsx)("p",{dangerouslySetInnerHTML:{__html:t||"No Log"}}),!t&&(0,r.jsx)(i.A,{position:"relative",width:"25px"})]})]})}},861:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});var r=s(4848),l=s(6540);function a(e){let{userObject:t,userPage:s}=e,a=Object.keys(t),[i,n]=l.useState(!1),[c,o]=l.useState(0),[d,h]=l.useState(!s);return(0,r.jsxs)("div",{className:"card col green w-full overflow-hidden"+(d?s?" h-[100px]":" h-[85px]":" "),children:[(0,r.jsxs)("div",{className:"items-center w-full",children:[(0,r.jsx)("img",{src:t.image_thumbnail,alt:"",className:"rounded-full object-cover"+(s?" w-16 h-16":" w-12 h-12")}),!s&&(0,r.jsxs)("h3",{className:"m-0 text-xl",children:[t.first_name," ",t.last_name," "]}),(0,r.jsxs)("div",{className:"ml-auto",children:[(0,r.jsx)("button",{className:"outlined gray small-text",onClick:e=>{d?h(!1):h(!0)},children:d?"More Details":"Collapse"}),!s&&(0,r.jsx)("a",{href:"/su/users/".concat(t.id),className:"button outlined gray small-text",children:"View User"})]})]}),(0,r.jsx)("div",{className:"card no-hover col w-full light-gray-bg",children:a.map((e,s)=>(0,r.jsxs)(l.Fragment,{children:[(0,r.jsx)("div",{children:(0,r.jsxs)("span",{style:{wordBreak:"break-all"},children:[e,":"," ",(0,r.jsx)("b",{children:t[e]})]})}),s<a.length-1&&(0,r.jsx)("hr",{})]},s+1))}),(0,r.jsx)("button",{className:"outlined gray small-text w-full",onClick:e=>{h(!0)},children:"Collapse"})]})}},7296:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(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,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(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,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(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"}]])},7206:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(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,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(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,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(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,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(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,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(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"}]])},9059:(e,t,s)=>{"use strict";s.r(t),s.d(t,{__N_SSP:()=>i,default:()=>n});var r=s(4848);s(6540);var l=s(2016);s(6286);var a=s(1975),i=!0;function n(e){let{user:t,data:s}=e,i=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("title",{children:"User Dashboard | Datasquirel"}),(0,r.jsx)("meta",{name:"description",content:"Welcome to your data app"})]});return(0,r.jsx)(l.A,{head:i,user:t,children:(0,r.jsx)(a.A,{})})}}},e=>{var t=t=>e(e.s=t);e.O(0,[2016,636,6593,8792],()=>t(7646)),_N_E=e.O()}]); |