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

1 line
8.2 KiB
JavaScript
Raw Normal View History

2025-01-28 18:43:16 +00:00
"use strict";(()=>{var e={};e.id=3821,e.ids=[3821],e.modules={95755:(e,r,s)=>{s.a(e,async(e,t)=>{try{s.r(r),s.d(r,{config:()=>h,default:()=>u,getServerSideProps:()=>_,getStaticPaths:()=>S,getStaticProps:()=>p,reportWebVitals:()=>v,routeModule:()=>A,unstable_getServerProps:()=>f,unstable_getServerSideProps:()=>m,unstable_getStaticParams:()=>x,unstable_getStaticPaths:()=>g,unstable_getStaticProps:()=>D});var a=s(63865),n=s(9455),o=s(30671),i=s(5583),c=s(19796),l=s(49690),d=e([l]);l=(d.then?(await d)():d)[0];let u=(0,o.M)(l,"default"),p=(0,o.M)(l,"getStaticProps"),S=(0,o.M)(l,"getStaticPaths"),_=(0,o.M)(l,"getServerSideProps"),h=(0,o.M)(l,"config"),v=(0,o.M)(l,"reportWebVitals"),D=(0,o.M)(l,"unstable_getStaticProps"),g=(0,o.M)(l,"unstable_getStaticPaths"),x=(0,o.M)(l,"unstable_getStaticParams"),f=(0,o.M)(l,"unstable_getServerProps"),m=(0,o.M)(l,"unstable_getServerSideProps"),A=new a.PagesRouteModule({definition:{kind:n.A.PAGES,page:"/su/servers",pathname:"/su/servers",bundlePath:"",filename:""},components:{App:c.default,Document:i.default},userland:l});t()}catch(e){t(e)}})},73872:(e,r,s)=>{s.a(e,async(e,t)=>{try{s.d(r,{A:()=>c});var a=s(8732);s(82015);var n=s(96089),o=s(75979),i=e([o]);function c({slugText:e,justIcon:r,noIcon:s,title:t,outlined:i,extraClasses:c}){return(0,a.jsxs)("div",{className:(0,o.twMerge)("button small-text hover:!bg-transparent",i?" outlined gray bg-white":" ghost light-gray",c),onClick:r=>{navigator.clipboard.writeText(e).then(()=>{alert(`Copied: "${e}"`)})},style:i?void 0:{padding:0},children:[!s&&(0,a.jsx)(n.A,{size:i?15:20}),!r&&(0,a.jsx)("span",{className:"text-slate-500 dark:text-slate-300",children:t||"Copy Slug"})]})}o=(i.then?(await i)():i)[0],t()}catch(e){t(e)}})},57168:(e,r,s)=>{s.a(e,async(e,t)=>{try{s.d(r,{A:()=>l});var a=s(8732),n=s(73872),o=s(2459),i=s(75979),c=e([n,i]);function l({server:e,noLoadBalance:r}){return(0,a.jsxs)("div",{className:"stack w-full",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(o.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,i.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,i.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,i]=c.then?(await c)():c,t()}catch(e){t(e)}})},66097:(e,r,s)=>{s.a(e,async(e,t)=>{try{s.d(r,{A:()=>d});var a=s(8732),n=s(19796),o=s(82015),i=s.n(o),c=s(57168),l=e([c]);function d(){let e=i().useContext(n.AppContext).pageProps;e.user;let r=e.servers;return(0,a.jsxs)(i().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)(c.A,{server:e,noLoadBalance:!0},r))}),(0,a.jsx)("button",{className:"w-full outlined dashed gray",children:"Add Server"})]})]})}c=(l.then?(await l)():l)[0],t()}catch(e){t(e)}})},77489:(e,r,s)=>{s.d(r,{A:()=>l});var t=s(29021),a=s.n(t),n=s(60374),o=s(33873),i=s.n(o);function c(){let e=process.env.DSQL_SU_USER_ID||"1",r=i().resolve(process.cwd(),`./jsonData/dbSchemas/users/user-${e}`),s=`${r}/servers.json`;return{dir:r,path:s}}function l(){try{!function(){try{let e=c();if(!a(