1 line
9.0 KiB
JavaScript
1 line
9.0 KiB
JavaScript
![]() |
"use strict";exports.id=8485,exports.ids=[8485],exports.modules={30671:(e,t)=>{Object.defineProperty(t,"M",{enumerable:!0,get:function(){return function e(t,r){return r in t?t[r]:"then"in t&&"function"==typeof t.then?t.then(t=>e(t,r)):"function"==typeof t&&"default"===r?t:void 0}}})},73872:(e,t,r)=>{r.a(e,async(e,a)=>{try{r.d(t,{A:()=>l});var i=r(8732);r(82015);var n=r(96089),s=r(75979),d=e([s]);function l({slugText:e,justIcon:t,noIcon:r,title:a,outlined:d,extraClasses:l}){return(0,i.jsxs)("div",{className:(0,s.twMerge)("button small-text hover:!bg-transparent",d?" outlined gray bg-white":" ghost light-gray",l),onClick:t=>{navigator.clipboard.writeText(e).then(()=>{alert(`Copied: "${e}"`)})},style:d?void 0:{padding:0},children:[!r&&(0,i.jsx)(n.A,{size:d?15:20}),!t&&(0,i.jsx)("span",{className:"text-slate-500 dark:text-slate-300",children:a||"Copy Slug"})]})}s=(d.then?(await d)():d)[0],a()}catch(e){a(e)}})},57168:(e,t,r)=>{r.a(e,async(e,a)=>{try{r.d(t,{A:()=>o});var i=r(8732),n=r(73872),s=r(2459),d=r(75979),l=e([n,d]);function o({server:e,noLoadBalance:t}){return(0,i.jsxs)("div",{className:"stack w-full",children:[(0,i.jsxs)("div",{children:[(0,i.jsx)(s.A,{size:15,opacity:.5}),(0,i.jsxs)("div",{children:[(0,i.jsx)("span",{children:e.host}),t?(0,i.jsx)(i.Fragment,{}):e.loadBalanced?(0,i.jsx)("span",{className:"info green small",children:"Load Balanced"}):(0,i.jsx)("button",{children:"Add to Load Balancer"})]})]}),(0,i.jsx)("div",{className:(0,d.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,i.jsx)("ul",{className:"p-0 m-0 pl-4",children:e.users?.map((e,t)=>i.jsx(c,{user:e},t))})})]})}function c({user:e}){return(0,i.jsx)("li",{className:(0,d.twMerge)("w-full"),children:(0,i.jsxs)("div",{className:"stack gap-0",children:[(0,i.jsxs)("span",{children:["user: ",(0,i.jsx)("b",{children:e.name})]}),(0,i.jsxs)("span",{children:["pass:"," ",(0,i.jsx)("b",{children:(0,i.jsx)(n.A,{slugText:e.password,title:"********",extraClasses:"inline",noIcon:!0})})]})]})})}[n,d]=l.then?(await l)():l,a()}catch(e){a(e)}})},24934:(e,t,r)=>{r.d(t,{A:()=>o});var a=r(29021),i=r.n(a),n=r(60374),s=r(33873),d=r.n(s);function l(){let{userDirPath:e}=function(e){let t=process.env.DSQL_APP_DIR,r=process.env.DSQL_DB_SCHEMA_DIR,a=".tmp";if(!t)throw Error("Please provide the `DSQL_APP_DIR` env variable.");if(!r)throw Error("Please provide the `DSQL_DB_SCHEMA_DIR` env variable.");let i=d().join(t,"package-shared"),n=d().join(i,"types/dsql.ts"),s=d().join(r,"main.json"),l=d().join(i,"data/defaultFields.json"),o=d().join(r,"users"),c=e?.user?.id?d().join(o,`user-${e.user.id}`):e?.userId?d().join(o,`user-${e.userId}`):void 0,y=c?d().join(c,"main.json"):void 0,h=c?d().join(c,"media"):void 0,p=c?d().join(c,"export"):void 0,k=p?d().join(p,"sql"):void 0,A=k?d().join(k,a):void 0,x=A?d().join(A,"schema.json"):void 0,u="db-export.zip",v=k?d().join(k,u):void 0,f="db-export.zip",g=k?d().join(k,f):void 0;return{schemasDir:r,userDirPath:c,mainShemaJSONFilePath:s,mainDbTypeDefFile:n,tempDirName:a,defaultTableFieldsJSONFilePath:l,usersSchemaDir:o,userSchemaMainJSONFilePath:y,userPrivateMediaDir:h,userPrivateExportsDir:p,userPrivateSQLExportsDir:k,userPrivateTempSQLExportsDir:A,userPrivateTempJSONSchemaFilePath:x,userPrivateDbExportZipFileName:u,userPrivateDbExportZipFilePath:v,userPrivateDbImportZipFileName:f,userPrivateDbImportZipFilePath:g,dbNginxLoadBalancerConfigFile:d().join(t,"docker/mariadb/load-balancer/config/template/nginx.conf")}}({userId:process.env.DSQL_SU_USER_ID||"1"}),t=`${e}/servers.json`;return{dir:e,path:t}}function o(){try{!function(){try{let e=l();if(!i().existsSync(e.path)){let t={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.DSQL_MARIADB_ROOT_PASSWORD||"password"}]};i().writeFileSync(e.path,JSON.stringify([t]))}}catch(e){return console.log(`Error checking servers ${e.message}`),!1}}();let e=l();return n.A.parse(i().readFileSync(e.path,"utf-8"))}cat
|