2024-12-09 09:39:09 +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}}})},23133:(e,t,a)=>{a.a(e,async(e,r)=>{try{a.r(t),a.d(t,{config:()=>x,default:()=>u,getServerSideProps:()=>m,getStaticPaths:()=>p,getStaticProps:()=>h,reportWebVitals:()=>y,routeModule:()=>j,unstable_getServerProps:()=>A,unstable_getServerSideProps:()=>b,unstable_getStaticParams:()=>g,unstable_getStaticPaths:()=>v,unstable_getStaticProps:()=>f});var s=a(63865),n=a(9455),l=a(30671),i=a(49407),c=a(89600),d=a(74094),o=e([d]);d=(o.then?(await o)():o)[0];let u=(0,l.M)(d,"default"),h=(0,l.M)(d,"getStaticProps"),p=(0,l.M)(d,"getStaticPaths"),m=(0,l.M)(d,"getServerSideProps"),x=(0,l.M)(d,"config"),y=(0,l.M)(d,"reportWebVitals"),f=(0,l.M)(d,"unstable_getStaticProps"),v=(0,l.M)(d,"unstable_getStaticPaths"),g=(0,l.M)(d,"unstable_getStaticParams"),A=(0,l.M)(d,"unstable_getServerProps"),b=(0,l.M)(d,"unstable_getServerSideProps"),j=new s.PagesRouteModule({definition:{kind:n.A.PAGES,page:"/admin/[user_id]/schema",pathname:"/admin/[user_id]/schema",bundlePath:"",filename:""},components:{App:c.default,Document:i.default},userland:d});r()}catch(e){r(e)}})},74223:(e,t,a)=>{a.a(e,async(e,r)=>{try{a.d(t,{A:()=>x});var s=a(8732),n=a(82015),l=a.n(n),i=a(58548),c=a(51548),d=a(74094),o=a(40942);a(63715),a(34844);var u=a(89788),h=a(56248),p=a.n(h),m=e([d,o,u]);function x(e){let{dbSchemaData:t,user:a}=l().useContext(d.UserSchemaContext),[r,n]=l().useState(t),[o,h]=l().useState(null),[m,x]=l().useState(null),[y,f]=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)(i.A,{user:a})]}),(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)(c.A,{required:!0,selectOptions:[{title:"All Databases",payload:"none"},...t.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)}}),m&&m[0]&&(0,s.jsx)(c.A,{required:!0,selectOptions:[{title:"All Tables",payload:"none"},...m.map((e,t)=>({title:e.tableFullName,payload:e.tableName,name:e.tableName}))],name:"database_tables",onChangeHandler:e=>{e.target.value?.match(/^none$/)?f(null):f(e.target.value)}})]})]}),(0,s.jsx)(u.A,{content:p().stringify(r,null,4),readOnly:!0,options:{wrap:!0},wrapperProps:{className:"h-[60vh]"}})]})})]})}[d,o,u]=m.then?(await m)():m,r()}catch(e){r(e)}})},40942:(e,t,a)=>{a.a(e,async(e,t)=>{try{a(8732),a(82015);var r=a(74094),s=e([r]);r=(s.then?(await s)():s)[0],t()}catch(e){t(e)}})},84759:(e,t,a)=>{a.d(t,{A:()=>r});function r({editorHTMLElementRef:e,fieldObject:t,setRefresh:a,language:r="javascript",entry:s,jsonTextEditors:n,editorRef:l,readOnly:i,initialContent:c,options:d}){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:c||(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:i,...d}),l&&t?.fieldName&&(n?.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)}}},51548:(e,t,a)=>{a.d(t,{A:()=>n});var r=a(8732),s=a(58526);function n({selectOptions:e,name:t,onChangeHandler:a,required:n,setAlert:l,
|