dsql-admin/dsql-app/.local_dist/static/chunks/pages/su-953c49bfd46c3c67.js

1 line
5.6 KiB
JavaScript
Raw Normal View History

2024-12-05 07:03:33 +00:00
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5516],{86273:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/su",function(){return s(66197)}])},86286:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});var a=s(74848),l=s(96540),r=s(23698),i=s(620),c=s(30861);function n(e){let{data:t}=e;Object.keys(t.users[0]);let[s,n]=l.useState(null),[d,h]=l.useState(0),[o,u]=l.useState(!1);function y(){(0,r.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(/./))){n("No Logs Yet");return}(null==e?void 0:e.log)&&n("No Logs"),n(e.log.replace(/\n|\r|\n\r|\\n/gm,"<br/>"))})}return console.log(typeof s),l.useEffect(()=>{y(),0===d&&setInterval(()=>{y()},1e4)},[d]),(0,a.jsx)(l.Fragment,{children:(0,a.jsxs)("div",{className:"items-stretch gap-10 w-full",children:[(0,a.jsxs)("section",{className:"paper w-full",children:[(0,a.jsx)("h2",{className:"text-xl m-0 mb-6",children:"Users"}),(0,a.jsx)("div",{className:"flex-col items-stretch gap-10",children:t.users.map((e,t)=>(0,a.jsx)(c.A,{userObject:e},t+1))})]}),(0,a.jsxs)("section",{className:"paper",children:[(0,a.jsxs)("div",{className:"w-full justify-between",children:[(0,a.jsx)("h2",{className:"text-xl m-0",children:"Error Logs"}),(0,a.jsx)("div",{children:(0,a.jsxs)("button",{onClick:e=>{window.confirm("Clear Error Logs?")&&(u(!0),(0,r.A)("/api/admin/clearErrorLogs","post").then(e=>{h(e=>e+1)}),setTimeout(()=>{u(!1)},2e3))},className:"outlined gray relative",children:[o&&(0,a.jsx)(i.A,{width:"20px"}),"Clear Error Log"]})})]}),s&&(0,a.jsx)("p",{dangerouslySetInnerHTML:{__html:s||"No Log"}}),"string"!=typeof s&&(0,a.jsx)(i.A,{position:"relative",width:"25px"})]})]})})}},30861:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});var a=s(74848),l=s(96540);function r(e){let{userObject:t,userPage:s}=e,r=Object.keys(t),[i,c]=l.useState(!1),[n,d]=l.useState(0),[h,o]=l.useState(!s);return(0,a.jsxs)("div",{className:"card col green w-full overflow-hidden"+(h?s?" h-[100px]":" h-[85px]":" "),children:[(0,a.jsxs)("div",{className:"items-center w-full",children:[(0,a.jsx)("img",{src:t.image_thumbnail,alt:"",className:"rounded-full object-cover"+(s?" w-16 h-16":" w-12 h-12")}),!s&&(0,a.jsxs)("h3",{className:"m-0 text-xl",children:[t.first_name," ",t.last_name," "]}),(0,a.jsxs)("div",{className:"ml-auto",children:[(0,a.jsx)("button",{className:"outlined gray small-text",onClick:e=>{h?o(!1):o(!0)},children:h?"More Details":"Collapse"}),!s&&(0,a.jsx)("a",{href:"/su/users/".concat(t.id),className:"button outlined gray small-text",children:"View User"})]})]}),(0,a.jsx)("div",{className:"card no-hover col w-full light-gray-bg",children:r.map((e,s)=>(0,a.jsxs)(l.Fragment,{children:[(0,a.jsx)("div",{children:(0,a.jsxs)("span",{style:{wordBreak:"break-all"},children:[e,":"," ",(0,a.jsx)("b",{children:t[e]})]})}),s<r.length-1&&(0,a.jsx)("hr",{})]},s+1))}),(0,a.jsx)("button",{className:"outlined gray small-text w-full",onClick:e=>{o(!0)},children:"Collapse"})]})}},87296:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(95737).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:()=>a});let a=(0,s(95737).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"}]])},68622:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(95737).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"}]])},97206:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(95737).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",{po