dsql-admin/dsql-app/.local_dist/static/chunks/pages/su/load-balancing-ada5fc7dba043021.js
Benjamin Toby 3ffd2d6777 Updates
2024-12-05 08:03:33 +01:00

1 line
8.7 KiB
JavaScript

(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9157],{34606:(e,s,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/su/load-balancing",function(){return t(38545)}])},77121:(e,s,t)=>{"use strict";t.d(s,{A:()=>i});var l=t(74848);t(96540);var r=t(87220),a=t(50856);function i(e){let{slugText:s,justIcon:t,noIcon:i,title:n,outlined:c,extraClasses:d}=e;return(0,l.jsxs)("div",{className:(0,a.QP)("button small-text",c?" outlined gray bg-white":" ghost light-gray",d),onClick:e=>{navigator.clipboard.writeText(s).then(()=>{alert('Copied: "'.concat(s,'"'))})},style:c?void 0:{padding:0},children:[!i&&(0,l.jsx)(r.A,{size:c?15:20}),!t&&(0,l.jsx)("span",{className:"text-slate-500 dark:text-slate-300",children:n||"Copy Slug"})]})}},86286:(e,s,t)=>{"use strict";t.d(s,{A:()=>c});var l=t(74848),r=t(96540),a=t(23698),i=t(620),n=t(30861);function c(e){let{data:s}=e;Object.keys(s.users[0]);let[t,c]=r.useState(null),[d,o]=r.useState(0),[h,x]=r.useState(!1);function u(){(0,a.A)("/api/admin/grabErrorLogs").then(e=>{var s;if((null==e?void 0:e.log)&&"string"==typeof e.log&&!(null===(s=e.log)||void 0===s?void 0:s.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 t),r.useEffect(()=>{u(),0===d&&setInterval(()=>{u()},1e4)},[d]),(0,l.jsx)(r.Fragment,{children:(0,l.jsxs)("div",{className:"items-stretch gap-10 w-full",children:[(0,l.jsxs)("section",{className:"paper w-full",children:[(0,l.jsx)("h2",{className:"text-xl m-0 mb-6",children:"Users"}),(0,l.jsx)("div",{className:"flex-col items-stretch gap-10",children:s.users.map((e,s)=>(0,l.jsx)(n.A,{userObject:e},s+1))})]}),(0,l.jsxs)("section",{className:"paper",children:[(0,l.jsxs)("div",{className:"w-full justify-between",children:[(0,l.jsx)("h2",{className:"text-xl m-0",children:"Error Logs"}),(0,l.jsx)("div",{children:(0,l.jsxs)("button",{onClick:e=>{window.confirm("Clear Error Logs?")&&(x(!0),(0,a.A)("/api/admin/clearErrorLogs","post").then(e=>{o(e=>e+1)}),setTimeout(()=>{x(!1)},2e3))},className:"outlined gray relative",children:[h&&(0,l.jsx)(i.A,{width:"20px"}),"Clear Error Log"]})})]}),t&&(0,l.jsx)("p",{dangerouslySetInnerHTML:{__html:t||"No Log"}}),"string"!=typeof t&&(0,l.jsx)(i.A,{position:"relative",width:"25px"})]})]})})}},61975:(e,s,t)=>{"use strict";t.d(s,{A:()=>n});var l=t(74848),r=t(96540),a=t(23698),i=t(620);function n(e){let[s,t]=r.useState(null),[n,c]=r.useState(!1),[d,o]=r.useState(0);function h(){(0,a.A)("/api/admin/grabErrorLogs").then(e=>{var s;if("string"!=typeof e.log||(null===(s=e.log)||void 0===s?void 0:s.match(/./)))t("");else{t("No Logs Yet");return}t(e.log.replace(/\n|\r|\n\r|\\n/gm,"<br/>"))})}return r.useEffect(()=>{h(),0===d&&setInterval(()=>{h()},1e4)},[d]),(0,l.jsxs)(r.Fragment,{children:[(0,l.jsxs)("div",{className:"w-full justify-between",children:[(0,l.jsx)("h2",{className:"text-xl m-0",children:"Error Logs"}),(0,l.jsx)("div",{children:(0,l.jsxs)("button",{onClick:e=>{window.confirm("Clear Error Logs?")&&(c(!0),(0,a.A)("/api/admin/clearErrorLogs","post").then(e=>{console.log(e),o(e=>e+1)}),setTimeout(()=>{c(!1)},2e3))},className:"outlined gray relative",children:[n&&(0,l.jsx)(i.A,{width:"20px"}),"Clear Error Log"]})})]}),(0,l.jsxs)("section",{className:"paper",children:[s&&(0,l.jsx)("p",{dangerouslySetInnerHTML:{__html:s||"No Log"}}),!s&&(0,l.jsx)(i.A,{position:"relative",width:"25px"})]})]})}},30861:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});var l=t(74848),r=t(96540);function a(e){let{userObject:s,userPage:t}=e,a=Object.keys(s),[i,n]=r.useState(!1),[c,d]=r.useState(0),[o,h]=r.useState(!t);return(0,l.jsxs)("div",{className:"card col green w-full overflow-hidden"+(o?t?" h-[100px]":" h-[85px]":" "),children:[(0,l.jsxs)("div",{className:"items-center w-full",children:[(0,l.jsx)("img",{src:s.image_thumbnail,alt:"",className:"rounded-full object-cover"+(t?" w-16 h-16":" w-12 h-12")}),!t&&(0,l.jsxs)("h3",{className:"m-0 text-xl",children:[s.first_name," ",s.last_name," "]}),(0,l.jsxs)("div",{className:"ml-auto",children:[(0,l.jsx)("button",{className:"outlined gray small-text",onClick:e=>{o?h(!1):h(!0)},children:o?"More Details":"Collapse"}),!t&&(0,l.jsx)("a",{href:"/su/users/".concat(s.id),className:"button outlined gray small-text",children:"View User"})]})]}),(0,l.jsx)("div",{className:"card no-hover col w-full light-gray-bg",children:a.map((e,t)=>(0,l.jsxs)(r.Fragment,{children:[(0,l.jsx)("div",{children:(0,l.jsxs)("span",{style:{wordBreak:"break-all"},children:[e,":"," ",(0,l.jsx)("b",{children:s[e]})]})}),t<a.length-1&&(0,l.jsx)("hr",{})]},t+1))}),(0,l.jsx)("button",{className:"outlined gray small-text w-full",onClick:e=>{h(!0)},children:"Collapse"})]})}},69663:(e,s,t)=>{"use strict";t.d(s,{A:()=>n});var l=t(74848),r=t(77121),a=t(2750),i=t(50856);function n(e){var s;let{server:t,noLoadBalance:r}=e;return(0,l.jsxs)("div",{className:"stack w-full",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(a.A,{size:15,opacity:.5}),(0,l.jsxs)("div",{children:[(0,l.jsx)("span",{children:t.host}),r?(0,l.jsx)(l.Fragment,{}):t.loadBalanced?(0,l.jsx)("span",{className:"info green small",children:"Load Balanced"}):(0,l.jsx)("button",{children:"Add to Load Balancer"})]})]}),(0,l.jsx)("div",{className:(0,i.QP)("stack border-0 border-l border-solid border-s-slate-200 dark:border-white/20","pl-6 ml-2 -mt-4 pt-2 w-full gap-0"),children:(0,l.jsx)("ul",{className:"p-0 m-0 pl-4",children:null===(s=t.users)||void 0===s?void 0:s.map((e,s)=>(0,l.jsx)(c,{user:e},s))})})]})}function c(e){let{user:s}=e;return(0,l.jsx)("li",{className:(0,i.QP)("w-full"),children:(0,l.jsxs)("div",{className:"stack gap-0",children:[(0,l.jsxs)("span",{children:["user: ",(0,l.jsx)("b",{children:s.name})]}),(0,l.jsxs)("span",{children:["pass:"," ",(0,l.jsx)("b",{children:(0,l.jsx)(r.A,{slugText:s.password,title:"********",extraClasses:"inline",noIcon:!0})})]})]})})}},87296:(e,s,t)=>{"use strict";t.d(s,{A:()=>l});let l=(0,t(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,s,t)=>{"use strict";t.d(s,{A:()=>l});let l=(0,t(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,s,t)=>{"use strict";t.d(s,{A:()=>l});let l=(0,t(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,s,t)=>{"use strict";t.d(s,{A:()=>l});let l=(0,t(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",{points:"9 22 9 12 15 12 15 22",key:"e2us08"}]])},14858:(e,s,t)=>{"use strict";t.d(s,{A:()=>l});let l=(0,t(95737).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,s,t)=>{"use strict";t.d(s,{A:()=>l});let l=(0,t(95737).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"}]])},42595:(e,s,t)=>{"use strict";t.d(s,{A:()=>l});let l=(0,t(95737).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"}]])},38545:(e,s,t)=>{"use strict";t.r(s),t.d(s,{__N_SSP:()=>d,default:()=>o});var l=t(74848),r=t(96540),a=t(2016);t(86286),t(61975);var i=t(6272),n=t(69663);function c(){let e=r.useContext(i.AppContext).pageProps;e.user;let s=e.servers;return(0,l.jsxs)(r.Fragment,{children:[(0,l.jsxs)("div",{className:"w-full justify-between",children:[(0,l.jsxs)("div",{className:"flex-col items-start gap-2",children:[(0,l.jsx)("h2",{className:"text-xl m-0",children:"Load Balancing"}),(0,l.jsx)("span",{children:"Distribute database load accross servers"})]}),(0,l.jsx)("div",{})]}),(0,l.jsxs)("section",{className:"paper",children:[(0,l.jsx)("h2",{className:"text-base m-0",children:"Servers"}),(0,l.jsx)("div",{className:"flex flex-col gap-2 w-full",children:s.map((e,s)=>(0,l.jsx)(n.A,{server:e},s))})]})]})}var d=!0;function o(e){let{user:s,data:t}=e,r=(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("title",{children:"Load Balancing"}),(0,l.jsx)("meta",{name:"description",content:"Distribute db load accross servers"})]});return(0,l.jsx)(a.A,{head:r,user:s,children:(0,l.jsx)(c,{})})}}},e=>{var s=s=>e(e.s=s);e.O(0,[8717,2016,636,6593,8792],()=>s(34606)),_N_E=e.O()}]);