2025-01-13 08:00:21 +00:00
|
|
|
"use strict";(()=>{var e={};e.id=9157,e.ids=[9157],e.modules={45035:(e,r,t)=>{t.a(e,async(e,s)=>{try{t.r(r),t.d(r,{config:()=>g,default:()=>u,getServerSideProps:()=>x,getStaticPaths:()=>h,getStaticProps:()=>p,reportWebVitals:()=>m,routeModule:()=>b,unstable_getServerProps:()=>j,unstable_getServerSideProps:()=>y,unstable_getStaticParams:()=>S,unstable_getStaticPaths:()=>v,unstable_getStaticProps:()=>f});var a=t(63865),n=t(9455),i=t(30671),c=t(5583),l=t(19796),o=t(21922),d=e([o]);o=(d.then?(await d)():d)[0];let u=(0,i.M)(o,"default"),p=(0,i.M)(o,"getStaticProps"),h=(0,i.M)(o,"getStaticPaths"),x=(0,i.M)(o,"getServerSideProps"),g=(0,i.M)(o,"config"),m=(0,i.M)(o,"reportWebVitals"),f=(0,i.M)(o,"unstable_getStaticProps"),v=(0,i.M)(o,"unstable_getStaticPaths"),S=(0,i.M)(o,"unstable_getStaticParams"),j=(0,i.M)(o,"unstable_getServerProps"),y=(0,i.M)(o,"unstable_getServerSideProps"),b=new a.PagesRouteModule({definition:{kind:n.A.PAGES,page:"/su/load-balancing",pathname:"/su/load-balancing",bundlePath:"",filename:""},components:{App:l.default,Document:c.default},userland:o});s()}catch(e){s(e)}})},73872:(e,r,t)=>{t.a(e,async(e,s)=>{try{t.d(r,{A:()=>l});var a=t(8732);t(82015);var n=t(96089),i=t(75979),c=e([i]);function l({slugText:e,justIcon:r,noIcon:t,title:s,outlined:c,extraClasses:l}){return(0,a.jsxs)("div",{className:(0,i.twMerge)("button small-text hover:!bg-transparent",c?" outlined gray bg-white":" ghost light-gray",l),onClick:r=>{navigator.clipboard.writeText(e).then(()=>{alert(`Copied: "${e}"`)})},style:c?void 0:{padding:0},children:[!t&&(0,a.jsx)(n.A,{size:c?15:20}),!r&&(0,a.jsx)("span",{className:"text-slate-500 dark:text-slate-300",children:s||"Copy Slug"})]})}i=(c.then?(await c)():c)[0],s()}catch(e){s(e)}})},57168:(e,r,t)=>{t.a(e,async(e,s)=>{try{t.d(r,{A:()=>o});var a=t(8732),n=t(73872),i=t(2459),c=t(75979),l=e([n,c]);function o({server:e,noLoadBalance:r}){return(0,a.jsxs)("div",{className:"stack w-full",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(i.A,{size:15,opacity:.5}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{children:e.host}),r?(0,a.jsx)(a.Fragment,{}):e.loadBalanced?(0,a.jsx)("span",{className:"info green small",children:"Load Balanced"}):(0,a.jsx)("button",{children:"Add to Load Balancer"})]})]}),(0,a.jsx)("div",{className:(0,c.twMerge)("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,a.jsx)("ul",{className:"p-0 m-0 pl-4",children:e.users?.map((e,r)=>a.jsx(d,{user:e},r))})})]})}function d({user:e}){return(0,a.jsx)("li",{className:(0,c.twMerge)("w-full"),children:(0,a.jsxs)("div",{className:"stack gap-0",children:[(0,a.jsxs)("span",{children:["user: ",(0,a.jsx)("b",{children:e.name})]}),(0,a.jsxs)("span",{children:["pass:"," ",(0,a.jsx)("b",{children:(0,a.jsx)(n.A,{slugText:e.password,title:"********",extraClasses:"inline",noIcon:!0})})]})]})})}[n,c]=l.then?(await l)():l,s()}catch(e){s(e)}})},53265:(e,r,t)=>{t.a(e,async(e,s)=>{try{t.d(r,{A:()=>d});var a=t(8732),n=t(19796),i=t(82015),c=t.n(i),l=t(57168),o=e([l]);function d(){let e=c().useContext(n.AppContext).pageProps;e.user;let r=e.servers;return(0,a.jsxs)(c().Fragment,{children:[(0,a.jsxs)("div",{className:"w-full justify-between",children:[(0,a.jsxs)("div",{className:"flex-col items-start gap-2",children:[(0,a.jsx)("h2",{className:"text-xl m-0",children:"Load Balancing"}),(0,a.jsx)("span",{children:"Distribute database load accross servers"})]}),(0,a.jsx)("div",{})]}),(0,a.jsxs)("section",{className:"paper",children:[(0,a.jsx)("h2",{className:"text-base m-0",children:"Servers"}),(0,a.jsx)("div",{className:"flex flex-col gap-2 w-full",children:r.map((e,r)=>(0,a.jsx)(l.A,{server:e},r))})]})]})}l=(o.then?(await o)():o)[0],s()}catch(e){s(e)}})},77489:(e,r,t)=>{t.d(r,{A:()=>o});var s=t(29021),a=t.n(s),n=t(60374),i=t(33873),c=t.n(i);function l(){let e=process.env.DSQL_SU_USER_ID||"1",r=c().resolve(process.cwd(),`./jsonData/dbSchemas/users/user-${e}`),t=`${r}/servers.json`;return{dir:r,path:t}}function o(){try{!function(){try{let e=l();if(!a().existsSync(e.path)){let r={host:String
|