dsql-admin/dsql-app/.local_dist/server/pages/su/servers.js

1 line
7.5 KiB
JavaScript
Raw Normal View History

2024-12-09 09:39:09 +00:00
"use strict";(()=>{var e={};e.id=3821,e.ids=[3821],e.modules={17021:(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:()=>S,routeModule:()=>_,unstable_getServerProps:()=>y,unstable_getServerSideProps:()=>j,unstable_getStaticParams:()=>f,unstable_getStaticPaths:()=>v,unstable_getStaticProps:()=>m});var a=t(63865),n=t(9455),i=t(30671),c=t(49407),o=t(89600),l=t(95376),d=e([l]);l=(d.then?(await d)():d)[0];let u=(0,i.M)(l,"default"),p=(0,i.M)(l,"getStaticProps"),h=(0,i.M)(l,"getStaticPaths"),x=(0,i.M)(l,"getServerSideProps"),g=(0,i.M)(l,"config"),S=(0,i.M)(l,"reportWebVitals"),m=(0,i.M)(l,"unstable_getStaticProps"),v=(0,i.M)(l,"unstable_getStaticPaths"),f=(0,i.M)(l,"unstable_getStaticParams"),y=(0,i.M)(l,"unstable_getServerProps"),j=(0,i.M)(l,"unstable_getServerSideProps"),_=new a.PagesRouteModule({definition:{kind:n.A.PAGES,page:"/su/servers",pathname:"/su/servers",bundlePath:"",filename:""},components:{App:o.default,Document:c.default},userland:l});s()}catch(e){s(e)}})},94010:(e,r,t)=>{t.a(e,async(e,s)=>{try{t.d(r,{A:()=>o});var a=t(8732);t(82015);var n=t(96089),i=t(75979),c=e([i]);function o({slugText:e,justIcon:r,noIcon:t,title:s,outlined:c,extraClasses:o}){return(0,a.jsxs)("div",{className:(0,i.twMerge)("button small-text hover:!bg-transparent",c?" outlined gray bg-white":" ghost light-gray",o),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)}})},77306:(e,r,t)=>{t.a(e,async(e,s)=>{try{t.d(r,{A:()=>l});var a=t(8732),n=t(94010),i=t(2459),c=t(75979),o=e([n,c]);function l({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]=o.then?(await o)():o,s()}catch(e){s(e)}})},2419:(e,r,t)=>{t.a(e,async(e,s)=>{try{t.d(r,{A:()=>d});var a=t(8732),n=t(89600),i=t(82015),c=t.n(i),o=t(77306),l=e([o]);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:"Servers"}),(0,a.jsx)("span",{children:"All Servers"})]}),(0,a.jsx)("div",{children:(0,a.jsx)("button",{children:"Add Server"})})]}),(0,a.jsxs)("section",{className:"paper",children:[(0,a.jsx)("div",{className:"flex flex-col gap-2 w-full",children:r.map((e,r)=>(0,a.jsx)(o.A,{server:e,noLoadBalance:!0},r))}),(0,a.jsx)("button",{className:"w-full outlined dashed gray",children:"Add Server"})]})]})}o=(l.then?(await l)():l)[0],s()}catch(e){s(e)}})},92127:(e,r,t)=>{t(33873);let s=t(29021);t(56248);let a=t(70956);e.exports=function(){try{let e=a();if(!s.existsSync(e.path)){let r={host:String(process.env.DSQL_DB_TARGET_IP_ADDRESS),port:3306,primary:!0,loadBalanced:!0,users:[{host:String(process.env.DSQL_DB_HOST),name:"root",password:process.env.D