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

1 line
12 KiB
JavaScript
Raw Normal View History

2025-01-13 08:00:21 +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:()=>f,default:()=>u,getServerSideProps:()=>m,getStaticPaths:()=>p,getStaticProps:()=>h,reportWebVitals:()=>x,routeModule:()=>j,unstable_getServerProps:()=>A,unstable_getServerSideProps:()=>b,unstable_getStaticParams:()=>g,unstable_getStaticPaths:()=>v,unstable_getStaticProps:()=>y});var s=a(63865),n=a(9455),l=a(30671),i=a(5583),c=a(19796),d=a(2207),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"),f=(0,l.M)(d,"config"),x=(0,l.M)(d,"reportWebVitals"),y=(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)}})},61637:(e,t,a)=>{a.a(e,async(e,r)=>{try{a.d(t,{A:()=>p});var s=a(8732),n=a(82015),l=a.n(n),i=a(53926),c=a(80830),d=a(2207);a(46169);var o=a(84894),u=a(60374),h=e([d,o]);function p(){let{dbSchemaData:e,user:t}=l().useContext(d.UserSchemaContext),[a,r]=l().useState(e),[n,h]=l().useState(null),[p,m]=l().useState(null),[f,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)(i.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)(c.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)(c.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]"}})]})})]})}[d,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: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)}}},80830:(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,title:i,defaultValue:c,info:d,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