1 line
5.3 KiB
JavaScript
1 line
5.3 KiB
JavaScript
"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-16":" w-12 h-12")}),!s&&(0,r.jsxs)("h3",{className:"m-0 text-xl",children:[e.first_name," ",e.last_name," "]}),(0,r.jsxs)("div",{className:"ml-auto",children:[(0,r.jsx)("button",{className:"outlined gray small-text",onClick:e=>{c?d(!1):d(!0)},children:c?"More Details":"Collapse"}),!s&&(0,r.jsx)("a",{href:`/su/users/${e.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:t.map((s,a)=>(0,r.jsxs)(l().Fragment,{children:[(0,r.jsx)("div",{children:(0,r.jsxs)("span",{style:{wordBreak:"break-all"},children:[s,":"," ",(0,r.jsx)("b",{children:e[s]})]})}),a<t.length-1&&(0,r.jsx)("hr",{})]},a+1))}),(0,r.jsx)("button",{className:"outlined gray small-text w-full",onClick:e=>{d(!0)},children:"Collapse"})]})}},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")},81630:e=>{e.exports=require("http")},33873:e=>{e.exports=require("path")}};var s=require("../../webpack-runtime.js");s.C(e);var t=e=>s(s.s=e),r=s.X(0,[883,9821,9600,3932],()=>t(93446));module.exports=r})(); |