2025-02-17 05:55:49 +00:00
|
|
|
"use strict";(()=>{var e={};e.id=8591,e.ids=[8591],e.modules={30671:(e,t)=>{Object.defineProperty(t,"M",{enumerable:!0,get:function(){return function e(t,a){return a in t?t[a]:"then"in t&&"function"==typeof t.then?t.then(t=>e(t,a)):"function"==typeof t&&"default"===a?t:void 0}}})},25355:(e,t,a)=>{a.a(e,async(e,r)=>{try{a.r(t),a.d(t,{config:()=>y,default:()=>u,getServerSideProps:()=>m,getStaticPaths:()=>p,getStaticProps:()=>h,reportWebVitals:()=>x,routeModule:()=>j,unstable_getServerProps:()=>A,unstable_getServerSideProps:()=>k,unstable_getStaticParams:()=>v,unstable_getStaticPaths:()=>g,unstable_getStaticProps:()=>f});var s=a(63865),i=a(9455),l=a(30671),n=a(5583),d=a(53881),c=a(2207),o=e([c]);c=(o.then?(await o)():o)[0];let u=(0,l.M)(c,"default"),h=(0,l.M)(c,"getStaticProps"),p=(0,l.M)(c,"getStaticPaths"),m=(0,l.M)(c,"getServerSideProps"),y=(0,l.M)(c,"config"),x=(0,l.M)(c,"reportWebVitals"),f=(0,l.M)(c,"unstable_getStaticProps"),g=(0,l.M)(c,"unstable_getStaticPaths"),v=(0,l.M)(c,"unstable_getStaticParams"),A=(0,l.M)(c,"unstable_getServerProps"),k=(0,l.M)(c,"unstable_getServerSideProps"),j=new s.PagesRouteModule({definition:{kind:i.A.PAGES,page:"/admin/[user_id]/schema",pathname:"/admin/[user_id]/schema",bundlePath:"",filename:""},components:{App:d.default,Document:n.default},userland:c});r()}catch(e){r(e)}})},61637:(e,t,a)=>{a.a(e,async(e,r)=>{try{a.d(t,{A:()=>p});var s=a(8732),i=a(82015),l=a.n(i),n=a(53926),d=a(80830),c=a(2207);a(46169);var o=a(84894),u=a(60374),h=e([c,o]);function p(){let{dbSchemaData:e,user:t}=l().useContext(c.UserSchemaContext),[a,r]=l().useState(e),[i,h]=l().useState(null),[p,m]=l().useState(null),[y,x]=l().useState(null);return(0,s.jsxs)(l().Fragment,{children:[(0,s.jsxs)("div",{className:"flex-col items-start gap-0 w-full",children:[(0,s.jsx)("div",{className:"",children:(0,s.jsx)("h1",{className:"text-3xl m-0",children:"User Schema"})}),(0,s.jsx)(n.A,{user:t})]}),(0,s.jsx)("section",{className:"paper",children:(0,s.jsxs)("div",{className:"flex-col items-start w-full",children:[(0,s.jsxs)("div",{className:"w-full justify-between",children:[(0,s.jsx)("h2",{className:"text-xl m-0",children:"Database SCHEMA JSON"}),(0,s.jsxs)("div",{children:[(0,s.jsx)(d.A,{required:!0,selectOptions:[{title:"All Databases",payload:"none"},...e.map((e,t)=>({title:e.dbName,payload:e.dbFullName,name:e.dbFullName}))],name:"databases",onChangeHandler:e=>{e.target.value?.match(/^none$/)?h(null):h(e.target.value)}}),p&&p[0]&&(0,s.jsx)(d.A,{required:!0,selectOptions:[{title:"All Tables",payload:"none"},...p.map((e,t)=>({title:e.tableFullName,payload:e.tableName,name:e.tableName}))],name:"database_tables",onChangeHandler:e=>{e.target.value?.match(/^none$/)?x(null):x(e.target.value)}})]})]}),(0,s.jsx)(o.A,{content:u.A.stringify(a,null,4),readOnly:!0,options:{wrap:!0},wrapperProps:{className:"h-[60vh]"}})]})})]})}[c,o]=h.then?(await h)():h,r()}catch(e){r(e)}})},6789:(e,t,a)=>{a.d(t,{A:()=>r});function r({editorHTMLElementRef:e,fieldObject:t,setRefresh:a,language:r="javascript",entry:s,jsonTextEditors:i,editorRef:l,readOnly:n,initialContent:d,options:c}){try{if(!ace?.edit||!e.current){console.log("Ace Editor not found!"),setTimeout(()=>{a?.(e=>e+1)},1e3);return}let o=ace.edit(e.current);o.setOptions({mode:"ace/mode/"+r,value:d||(t?.defaultValue?t.defaultValue:t?.fieldName&&s?.[t.fieldName]?(()=>{if("json"!==r)return s[t.fieldName];try{return JSON.stringify(JSON.parse(s[t.fieldName]),null,4)}catch(e){return s[t.fieldName]}})():""),placeholder:"json"==r?"{}":"",enableBasicAutocompletion:!0,enableLiveAutocompletion:!0,readOnly:n,...c}),l&&t?.fieldName&&(i?.current.push({fieldName:t.fieldName,ref:l}),l.current=o);try{ace.require("ace/ext/beautify").beautify(o.session)}catch(e){}}catch(e){console.log("JSON Editor ERROR =>",e.message)}}},80830:(e,t,a)=>{a.d(t,{A:()=>i});var r=a(8732),s=a(58526);function i({selectOptions:e,name:t,onChangeHandler:a,required:i,setAlert:l,title:n,defaultValue:d,info:c,id:o}){try{function u(e){if(e.type.match(/enter/i)&&window.innerWidth<1200)return;let t=e.target.closest(".info-wrapper"),a=t.querySelecto
|