1 line
2.0 KiB
JavaScript
1 line
2.0 KiB
JavaScript
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3753],{31893:function(n,e,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/su/error-logs",function(){return r(31300)}])},96251:function(n,e,r){"use strict";r.d(e,{Z:function(){return u}});var t=r(828),o=r(85893),s=r(67294),i=r(86729),a=r(95264);function u(n){var e=function(){(0,i.Z)("/api/admin/grabErrorLogs").then((function(n){var e;"string"!==typeof n.log||(null===(e=n.log)||void 0===e?void 0:e.match(/./))?c(n.log.replace(/\n|\r|\n\r|\\n/gm,"<br/>")):c("No Logs Yet")}))},r=(0,t.Z)(s.useState(null),2),u=r[0],c=r[1],l=(0,t.Z)(s.useState(!1),2),d=l[0],f=l[1],h=(0,t.Z)(s.useState(0),2),g=h[0],p=h[1];return s.useEffect((function(){e(),0===g&&setInterval((function(){e()}),1e4)}),[g]),(0,o.jsxs)(s.Fragment,{children:[(0,o.jsxs)("div",{className:"w-full justify-between",children:[(0,o.jsx)("h2",{className:"text-xl m-0",children:"Error Logs"}),(0,o.jsx)("div",{children:(0,o.jsxs)("button",{onClick:function(n){window.confirm("Clear Error Logs?")&&(f(!0),(0,i.Z)("/api/admin/clearErrorLogs","post").then((function(n){console.log(n),p((function(n){return n+1}))})),setTimeout((function(){f(!1)}),2e3))},className:"outlined gray relative",children:[d&&(0,o.jsx)(a.Z,{width:"20px"}),"Clear Error Log"]})})]}),(0,o.jsxs)("section",{className:"paper",children:[u&&(0,o.jsx)("p",{dangerouslySetInnerHTML:{__html:u||"No Log"}}),!u&&(0,o.jsx)(a.Z,{position:"relative",width:"25px"})]})]})}},31300:function(n,e,r){"use strict";r.r(e),r.d(e,{__N_SSP:function(){return i},default:function(){return a}});var t=r(85893),o=(r(67294),r(85313)),s=(r(44187),r(96251)),i=!0;function a(n){var e=n.user,r=(n.data,(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("title",{children:"User Dashboard | Datasquirel"}),(0,t.jsx)("meta",{name:"description",content:"Welcome to your data app"})]}));return(0,t.jsx)(o.Z,{head:r,user:e,children:(0,t.jsx)(s.Z,{})})}}},function(n){n.O(0,[5313,3695,9774,2888,179],(function(){return e=31893,n(n.s=e);var e}));var e=n.O();_N_E=e}]); |