dsql-admin/dsql-app/.local_dist/server/pages/admin/[user_id]/schema.js

1 line
16 KiB
JavaScript
Raw Normal View History

2024-12-08 19:56:57 +00:00
"use strict";(()=>{var e={};e.id=8591,e.ids=[636,8591],e.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}}})},23133:(e,t,r)=>{r.a(e,async(e,s)=>{try{r.r(t),r.d(t,{config:()=>x,default:()=>d,getServerSideProps:()=>h,getStaticPaths:()=>m,getStaticProps:()=>p,reportWebVitals:()=>y,routeModule:()=>A,unstable_getServerProps:()=>b,unstable_getServerSideProps:()=>j,unstable_getStaticParams:()=>v,unstable_getStaticPaths:()=>g,unstable_getStaticProps:()=>f});var a=r(63865),i=r(9455),l=r(30671),n=r(49407),o=r(68268),u=r(74094),c=e([u]);u=(c.then?(await c)():c)[0];let d=(0,l.M)(u,"default"),p=(0,l.M)(u,"getStaticProps"),m=(0,l.M)(u,"getStaticPaths"),h=(0,l.M)(u,"getServerSideProps"),x=(0,l.M)(u,"config"),y=(0,l.M)(u,"reportWebVitals"),f=(0,l.M)(u,"unstable_getStaticProps"),g=(0,l.M)(u,"unstable_getStaticPaths"),v=(0,l.M)(u,"unstable_getStaticParams"),b=(0,l.M)(u,"unstable_getServerProps"),j=(0,l.M)(u,"unstable_getServerSideProps"),A=new a.PagesRouteModule({definition:{kind:i.A.PAGES,page:"/admin/[user_id]/schema",pathname:"/admin/[user_id]/schema",bundlePath:"",filename:""},components:{App:o.default,Document:n.default},userland:u});s()}catch(e){s(e)}})},74223:(e,t,r)=>{r.a(e,async(e,s)=>{try{r.d(t,{A:()=>x});var a=r(8732),i=r(82015),l=r.n(i),n=r(58548),o=r(51548),u=r(74094),c=r(40942);r(63715),r(34844);var d=r(89788),p=r(56248),m=r.n(p),h=e([u,c,d]);function x(e){let{dbSchemaData:t,user:r}=l().useContext(u.UserSchemaContext),[s,i]=l().useState(t),[c,p]=l().useState(null),[h,x]=l().useState(null),[y,f]=l().useState(null);return(0,a.jsxs)(l().Fragment,{children:[(0,a.jsxs)("div",{className:"flex-col items-start gap-0 w-full",children:[(0,a.jsx)("div",{className:"",children:(0,a.jsx)("h1",{className:"text-3xl m-0",children:"User Schema"})}),(0,a.jsx)(n.A,{user:r})]}),(0,a.jsx)("section",{className:"paper",children:(0,a.jsxs)("div",{className:"flex-col items-start w-full",children:[(0,a.jsxs)("div",{className:"w-full justify-between",children:[(0,a.jsx)("h2",{className:"text-xl m-0",children:"Database SCHEMA JSON"}),(0,a.jsxs)("div",{children:[(0,a.jsx)(o.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$/)?p(null):p(e.target.value)}}),h&&h[0]&&(0,a.jsx)(o.A,{required:!0,selectOptions:[{title:"All Tables",payload:"none"},...h.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,a.jsx)(d.A,{content:m().stringify(s,null,4),readOnly:!0,options:{wrap:!0},wrapperProps:{className:"h-[60vh]"}})]})})]})}[u,c,d]=h.then?(await h)():h,s()}catch(e){s(e)}})},40942:(e,t,r)=>{r.a(e,async(e,t)=>{try{r(8732),r(82015);var s=r(74094),a=e([s]);s=(a.then?(await a)():a)[0],t()}catch(e){t(e)}})},84759:(e,t,r)=>{r.d(t,{A:()=>s});function s({editorHTMLElementRef:e,fieldObject:t,setRefresh:r,language:s="javascript",entry:a,jsonTextEditors:i,editorRef:l,readOnly:n,initialContent:o,options:u}){try{if(!ace?.edit||!e.current){console.log("Ace Editor not found!"),setTimeout(()=>{r?.(e=>e+1)},1e3);return}let c=ace.edit(e.current);c.setOptions({mode:"ace/mode/"+s,value:o||(t?.defaultValue?t.defaultValue:t?.fieldName&&a?.[t.fieldName]?(()=>{if("json"!==s)return a[t.fieldName];try{return JSON.stringify(JSON.parse(a[t.fieldName]),null,4)}catch(e){return a[t.fieldName]}})():""),placeholder:"json"==s?"{}":"",enableBasicAutocompletion:!0,enableLiveAutocompletion:!0,readOnly:n,...u}),l&&t?.fieldName&&(i?.current.push({fieldName:t.fieldName,ref:l}),l.current=c);try{ace.require("ace/ext/beautify").beautify(c.session)}catch(e){}}catch(e){console.log("JSON Editor ERROR =>",e.message)}}},51548:(e,t,r)=>{r.d(t,{A:()=>i});var s=r(8732),a=r(58526);function i({selectOptions:e,name:t,onChangeHandler:r,required:i,setAler