2024-12-09 09:39:09 +00:00
|
|
|
"use strict";(()=>{var e={};e.id=6257,e.ids=[6257],e.modules={93446:(e,s,t)=>{t.r(s),t.d(s,{config:()=>S,default:()=>g,getServerSideProps:()=>f,getStaticPaths:()=>v,getStaticProps:()=>j,reportWebVitals:()=>b,routeModule:()=>M,unstable_getServerProps:()=>_,unstable_getServerSideProps:()=>y,unstable_getStaticParams:()=>P,unstable_getStaticPaths:()=>N,unstable_getStaticProps:()=>w});var r={};t.r(r),t.d(r,{default:()=>m,getServerSideProps:()=>h});var a=t(63865),l=t(9455),i=t(30671),n=t(49407),o=t(89600),c=t(8732);t(82015);var d=t(93615),u=t.n(d),x=t(49888);t(36299);var p=t(19262);function m({user:e,data:s}){let t=(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("title",{children:"User Dashboard | Datasquirel"}),(0,c.jsx)("meta",{name:"description",content:"Welcome to your data app"})]});return(0,c.jsx)(x.A,{head:t,user:e,children:(0,c.jsx)(p.A,{})})}async function h({req:e,res:s,query:t}){let r=await u()(e);return r?.logged_in_status?{props:{user:r}}:{redirect:{destination:"/su/login",permanent:!1}}}let g=(0,i.M)(r,"default"),j=(0,i.M)(r,"getStaticProps"),v=(0,i.M)(r,"getStaticPaths"),f=(0,i.M)(r,"getServerSideProps"),S=(0,i.M)(r,"config"),b=(0,i.M)(r,"reportWebVitals"),w=(0,i.M)(r,"unstable_getStaticProps"),N=(0,i.M)(r,"unstable_getStaticPaths"),P=(0,i.M)(r,"unstable_getStaticParams"),_=(0,i.M)(r,"unstable_getServerProps"),y=(0,i.M)(r,"unstable_getServerSideProps"),M=new a.PagesRouteModule({definition:{kind:l.A.PAGES,page:"/su/error-logs",pathname:"/su/error-logs",bundlePath:"",filename:""},components:{App:o.default,Document:n.default},userland:r})},36299:(e,s,t)=>{t.d(s,{A:()=>c});var r=t(8732),a=t(82015),l=t.n(a),i=t(63715),n=t(32415),o=t(21498);function c({data:e}){Object.keys(e.users[0]);let[s,t]=l().useState(null),[a,c]=l().useState(0),[d,u]=l().useState(!1);return console.log(typeof s),(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:e.users.map((e,s)=>(0,r.jsx)(o.A,{userObject:e},s+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,i.A)("/api/admin/clearErrorLogs","post").then(e=>{c(e=>e+1)}),setTimeout(()=>{u(!1)},2e3))},className:"outlined gray relative",children:[d&&(0,r.jsx)(n.A,{width:"20px"}),"Clear Error Log"]})})]}),s&&(0,r.jsx)("p",{dangerouslySetInnerHTML:{__html:s||"No Log"}}),"string"!=typeof s&&(0,r.jsx)(n.A,{position:"relative",width:"25px"})]})]})})}},19262:(e,s,t)=>{t.d(s,{A:()=>o});var r=t(8732),a=t(82015),l=t.n(a),i=t(63715),n=t(32415);function o(e){let[s,t]=l().useState(null),[a,o]=l().useState(!1),[c,d]=l().useState(0);return(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?")&&(o(!0),(0,i.A)("/api/admin/clearErrorLogs","post").then(e=>{console.log(e),d(e=>e+1)}),setTimeout(()=>{o(!1)},2e3))},className:"outlined gray relative",children:[a&&(0,r.jsx)(n.A,{width:"20px"}),"Clear Error Log"]})})]}),(0,r.jsxs)("section",{className:"paper",children:[s&&(0,r.jsx)("p",{dangerouslySetInnerHTML:{__html:s||"No Log"}}),!s&&(0,r.jsx)(n.A,{position:"relative",width:"25px"})]})]})}},21498:(e,s,t)=>{t.d(s,{A:()=>i});var r=t(8732),a=t(82015),l=t.n(a);function i({userObject:e,userPage:s}){let t=Object.keys(e),[a,i]=l().useState(!1),[n,o]=l().useState(0),[c,d]=l().useState(!s);return(0,r.jsxs)("div",{className:"card col green w-full overflow-hidden"+(c?s?" h-[100px]":" h-[85px]":" "),children:[(0,r.jsxs)("div",{className:"items-center w-full",children:[(0,r.jsx)("img",{src:e.image_thumbnail,alt:"",className:"rounded-full object-cover"+(s?" w-16 h-1
|