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

1 line
7.9 KiB
JavaScript
Raw Normal View History

2025-01-14 15:27:08 +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:()=>v,default:()=>u,getServerSideProps:()=>h,getStaticPaths:()=>S,getStaticProps:()=>p,reportWebVitals:()=>_,routeModule:()=>y,unstable_getServerProps:()=>m,unstable_getServerSideProps:()=>D,unstable_getStaticParams:()=>f,unstable_getStaticPaths:()=>x,unstable_getStaticProps:()=>g});var a=s(63865),n=s(9455),i=s(30671),o=s(5583),c=s(19796),l=s(49690),d=e([l]);l=(d.then?(await d)():d)[0];let u=(0,i.M)(l,"default"),p=(0,i.M)(l,"getStaticProps"),S=(0,i.M)(l,"getStaticPaths"),h=(0,i.M)(l,"getServerSideProps"),v=(0,i.M)(l,"config"),_=(0,i.M)(l,"reportWebVitals"),g=(0,i.M)(l,"unstable_getStaticProps"),x=(0,i.M)(l,"unstable_getStaticPaths"),f=(0,i.M)(l,"unstable_getStaticParams"),m=(0,i.M)(l,"unstable_getServerProps"),D=(0,i.M)(l,"unstable_getServerSideProps"),y=new a.PagesRouteModule({definition:{kind:n.A.PAGES,page:"/su/servers",pathname:"/su/servers",bundlePath:"",filename:""},components:{App:c.default,Document:o.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),i=s(75979),o=e([i]);function c({slugText:e,justIcon:r,noIcon:s,title:t,outlined:o,extraClasses:c}){return(0,a.jsxs)("div",{className:(0,i.twMerge)("button small-text hover:!bg-transparent",o?" outlined gray bg-white":" ghost light-gray",c),onClick:r=>{navigator.clipboard.writeText(e).then(()=>{alert(`Copied: "${e}"`)})},style:o?void 0:{padding:0},children:[!s&&(0,a.jsx)(n.A,{size:o?15:20}),!r&&(0,a.jsx)("span",{className:"text-slate-500 dark:text-slate-300",children:t||"Copy Slug"})]})}i=(o.then?(await o)():o)[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),i=s(2459),o=s(75979),c=e([n,o]);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,o.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,o.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,o]=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),i=s(82015),o=s.n(i),c=s(57168),l=e([c]);function d(){let e=o().useContext(n.AppContext).pageProps;e.user;let r=e.servers;return(0,a.jsxs)(o().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),i=s(33873),o=s.n(i);function c(){let e=process.env.DSQL_SU_USER_ID||"1",r=o().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(