17 lines
45 KiB
JavaScript
17 lines
45 KiB
JavaScript
![]() |
"use strict";exports.id=5408,exports.ids=[5408],exports.modules={60149:(e,t,a)=>{a.d(t,{On:()=>n.a,Yv:()=>i.a,_n:()=>d}),a(76102);var l=a(65967),n=a.n(l),s=a(30889),i=a.n(s),r=a(93726);let d=a.n(r)()},29615:(e,t,a)=>{a.d(t,{A:()=>c});var l=a(8732),n=a(82015),s=a.n(n),i=a(42960),r=a(93763),d=a(46169),o=a(19796);function c({field:e,database:t,currentTable:a,isDelegated:n,setLoading:c}){let u=s().useContext(o.AppContext),[m,p]=s().useState(e),[x,h]=s().useState(!1);return(0,l.jsxs)("div",{className:"flex-col w-full table-field-wrapper"+(x?" shadow-2xl shadow-slate-700/40 relative z-50":""),children:[(0,l.jsxs)("div",{className:"card no-hover items-center w-full py-4"+(x?" rounded-t":" rounded")+(m.fieldName?.match(i.A)?" text-slate-400 pointer-events-none border-slate-200 border":" light-gray"),children:[(0,l.jsx)("span",{className:"font-bold"+(m.fieldName?.match(i.A)?" dark:text-slate-500":" dark:text-white"),children:m.fieldName}),(0,l.jsx)("span",{className:"text-xs py-1 px-2 bg-slate-100 dark:bg-slate-700 dark:text-slate-200 rounded ",children:m.dataType}),m?.foreignKey&&(0,l.jsxs)("div",{className:"text-xs bg-primary text-white px-2 py-0.5 rounded-full",children:[(0,l.jsx)("span",{children:"Foreign Key: "}),(0,l.jsxs)("span",{children:[m.foreignKey.destinationTableName," ("," ",(0,l.jsx)("b",{children:m.foreignKey.destinationTableColumnName})," ",")"]})]}),m.fieldName?.match(i.A)&&(0,l.jsx)("span",{className:"text-slate-300 text-sm font-semibold ml-0 md:ml-auto",children:"Default Field"}),!(!n&&!m.fieldName?.match(i.A)&&m.dataType?.match(/INT/))||m.foreignKey||t?.active_clone?.toString()?.match(/1/)?!n&&!m.fieldName?.match(i.A)&&m.dataType?.match(/INT/)&&!t?.active_clone?.toString()?.match(/1/)?(0,l.jsx)("div",{className:"ml-0 md:ml-auto flex-wrap",children:(0,l.jsx)("div",{className:"button py-1 text-xs light-gray",onClick:l=>{window.confirm("Delete this foreign Key?")&&(delete e.foreignKey,c(!0),(0,d.A)("/api/updateClonedTableForeignKeys",{method:"post",body:{tableData:a,database:t.db_full_name,dbSlug:t.db_slug,delegated:!!window.location?.search?.match(/delegated=true/i)}},!0).then(e=>{e.success?window.location.reload():window.alert("Update Failed, Please Try again.")}))},style:{color:"var(--slate-500)"},children:"Delete Foreign Key"})}):(0,l.jsx)(s().Fragment,{}):(0,l.jsx)("div",{className:"ml-0 md:ml-auto flex-wrap",children:(0,l.jsx)("div",{className:"button outlined py-1 text-xs gray",onClick:e=>{x?h(!1):h(!0)},style:{color:"var(--slate-500)"},children:"Add Foreign Key"})})]}),x&&!n&&(0,l.jsx)("div",{className:"card col w-full -mt-5 pt-0 no-hover",children:(0,l.jsx)(r.A,{fieldObject:e,setFieldObject:p,setActiveEdit:h,activeClonedTable:!0,appContextObject:u})})]})}},75486:(e,t,a)=>{a.a(e,async(e,l)=>{try{a.d(t,{A:()=>v});var n=a(8732),s=a(82015),i=a.n(s),r=a(32016),d=a(92485),o=a(93763),c=a(70908),u=a(38931),m=a(27825),p=a.n(m),x=a(84483),h=a(70647),f=a(19796),g=a(7056),y=e([g]);function v(){let e=i().useContext(f.AppContext),t=i().useContext(g.U),{fieldObject:a,setFieldObject:l,setActiveEdit:s}=t,m=e.pageProps.table,[y,v]=i().useState(!1),w=i().useRef(p().cloneDeep(a));return(0,n.jsxs)(i().Fragment,{children:[(0,n.jsx)("span",{className:"button outlined gray w-full xl:w-auto",onClick:()=>{v(!0)},children:"More"}),(0,n.jsx)(x.A,{open:y,onClose:()=>{if(w.current){let e=p().cloneDeep(w.current);l(e)}v(!1)},maxWidth:"600px",children:(0,n.jsxs)("div",{className:"m-auto flex flex-col max-w-xl w-full max-h-[90vh] overflow-y-auto",children:[(0,n.jsx)("div",{className:"w-full justify-between",children:(0,n.jsx)("span",{className:"text-xl",children:"More Options"})}),(0,n.jsx)(r.A,{singelFieldFormContextObject:t}),(0,n.jsx)(h.A,{singelFieldFormContextObject:t}),(0,n.jsx)(d.A,{singelFieldFormContextObject:t}),m&&(0,n.jsx)(o.A,{fieldObject:a,setFieldObject:l,appContextObject:e,setActiveEdit:s}),(0,n.jsx)(c.A,{singelFieldFormContextObject:t}),(0,n.jsx)(u.A,{singelFieldFormContextObject:t}),(0,n.jsx)("button",{className:"w-full outlined more-padding",onClick:()=>{v(!1)},children:"Done"})]})})]})}g=(y.then?(await y)():y)[0],l
|
||
|
* @typedef {object} ${n}`),r.forEach(e=>{let t=e.nullValue?"?":e.fieldName?.match(l.A)?"?":"";d.push(` ${e.fieldName}${t}: ${i(e.dataType||"")};`),o.push(` * @property {${i(e.dataType||"")}${t}} ${e.fieldName}`)}),d.push("}"),o.push(" */"),e?.match(/javascript/i)&&(s=o.join("\n")),e?.match(/typescript/i)&&(s=d.join("\n"))}catch(e){console.log(e.message),s=null}return s}},2913:(e,t,a)=>{a.d(t,{A:()=>n});var l=a(8732);function n({name:e,checkBoxValues:t,setAlert:a,labelColor:n,flexRow:s,baseText:i,smallText:r,className:d}){return(0,l.jsx)("div",{className:"flex items-start gap-x-4"+(s?" flex-row flex-wrap gap-y-2 ":" flex-col gap-y-4 ")+(d||""),children:t.map((t,s)=>{let{payload:d,title:o,onChangeHandler:c,fixed:u,jsx:m}=t,p=t.name?`${e}-${t.name}`:d?e+"-"+d:e;return(0,l.jsxs)("div",{className:"flex items-center"+(t.default&&u?" pointer-events-none":"")+(r?" gap-1 ":" gap-2 ")+(t?.className?t.className:""),children:[(0,l.jsx)("input",{className:"m-0"+(r?" w-4 h-4":" w-5 h-5"),type:"checkbox",defaultChecked:!!t.default,name:p,id:p,onChange:e=>{a&&a(null),c&&c(e,t)},value:d,style:{minWidth:"20px"},...t.props}),m||(0,l.jsx)("label",{htmlFor:p,className:"m-0 "+(n||"text-slate-800 dark:text-white/80")+(i||r?" text-base":" text-lg"),children:o})]},s+1)})})}a(82015)},51339:(e,t,a)=>{a.d(t,{A:()=>n});var l=a(8732);function n({collapse:e,setCollapse:t}){return(0,l.jsxs)("div",{className:"collapse-block"+(e?" -mt-16 -mb-6 pt-10":" mt-0 mb-0 p-0"),onClick:a=>{e?t(!1):t(!0)},children:[(0,l.jsx)("span",{children:e?"Expand":"Collapse"}),(0,l.jsx)("img",{src:"/images/down-arrow-dark.svg",alt:"Down Arrow",width:16,className:"dark:hidden opacity-30 "+(e?"":"rotate-180")}),(0,l.jsx)("img",{src:"/images/down-arrow-white.svg",alt:"Down Arrow",width:16,className:"opacity-30 hidden dark:flex "+(e?"":"rotate-180")})]})}a(82015)},84483:(e,t,a)=>{a.d(t,{A:()=>n});var l=a(8732);function n({children:e,open:t,setOpen:a,onClose:n,maxWidth:s}){return(0,l.jsx)(l.Fragment,{})}a(82015),a(1976),a(58150)},48893:(e,t,a)=>{a.a(e,async(e,l)=>{try{a.d(t,{A:()=>r});var n=a(8732),s=a(75979),i=e([s]);function r({spacing:e,...t}){return(0,n.jsx)("div",{...t,className:(0,s.twMerge)("relative flex items-center gap-2 border border-solid rounded","border-slate-300 dark:border-white/10",e?"normal"==e?"px-3 py-2":"tight"==e?"px-2 py-1":"":"px-3 py-2","twui-border",t.className),children:t.children})}s=(i.then?(await i)():i)[0],l()}catch(e){l(e)}})},35630:(e,t,a)=>{a.a(e,async(e,l)=>{try{a.d(t,{A:()=>c});var n=a(8732),s=a(82015),i=a.n(s),r=a(75979),d=a(78848),o=e([r,d]);function c({label:e,variant:t,prefix:a,suffix:l,componentRef:s,labelProps:o,wrapperProps:c,showLabel:u,istextarea:m,debounce:p,invalidMessage:x,autoComplete:h,validationFunction:f,validationRegex:g,...y}){let[v,w]=i().useState(!1),[N,b]=i().useState(y.defaultValue?String(y.defaultValue):"");delete y.defaultValue;let[j,A]=i().useState(!0),T=m?(0,n.jsx)("textarea",{...y,className:(0,r.twMerge)("w-full outline-none bg-transparent","twui-textarea",y.className),ref:s,onFocus:e=>{w(!0),y?.onFocus?.(e)},onBlur:e=>{w(!1),y?.onBlur?.(e)},value:N,onChange:e=>b(e.target.value),autoComplete:h,rows:y.height?Number(y.height):4}):(0,n.jsx)("input",{...y,className:(0,r.twMerge)("w-full outline-none bg-transparent border-none","hover:border-none hover:outline-none focus:border-none focus:outline-none","dark:bg-transparent dark:outline-none dark:border-none","p-0","twui-input",y.className),ref:s,onFocus:e=>{w(!0),y?.onFocus?.(e)},onBlur:e=>{w(!1),y?.onBlur?.(e)},value:N,onChange:e=>{b(e.target.value),y?.onChange?.(e)}});return(0,n.jsxs)("div",{...c,className:(0,r.twMerge)("relative flex items-center gap-2 border rounded-md px-3 py-2 outline outline-1",v&&j?"border-slate-700 dark:border-white/50":"border-slate-300 dark:border-white/20",v&&j?"outline-slate-700 dark:outline-white/50":"outline-slate-300 dark:outline-white/20","warning"==t&&j&&"border-yellow-500 dark:border-yellow-300 outline-yellow-500 dark:outline-yellow-300","error"==t&&j&&"border-red-500 dark:border-red-300 outline-red-500 dark:outline-red-300","inactive
|
||
|
Error Message: ${t}
|
||
|
Component: ${a}`;e?.id&&e?.first_name&&e?.last_name&&e?.email&&(l+=`
|
||
|
User Id: ${e?.id}
|
||
|
User Name: ${e?.first_name} ${e?.last_name}
|
||
|
User Email: ${e?.email}`),s?.url&&(l+=`
|
||
|
URL: ${s.url}`),s?.body&&(l+=`
|
||
|
Request Body: ${JSON.stringify(s.body,null,4)}`),r&&(l+=`
|
||
|
IP: ${r}`),l+=`
|
||
|
Date: ${i.toDateString()}
|
||
|
========================================`,n().existsSync("./.tmp/error.log")||n().writeFileSync("./.tmp/error.log","","utf-8");let d=n().readFileSync("./.tmp/error.log","utf-8");n().writeFileSync("./.tmp/error.log",l),n().appendFileSync("./.tmp/error.log",`
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
${d}`)}catch(e){console.log("Server Error Reporting Error:",e.message)}}},29375:(e,t,a)=>{a.d(t,{UB:()=>l});let l=[{title:"Plain Text",value:"plain"},{title:"Rich Text",value:"richText"},{title:"JSON",value:"json"},{title:"YAML",value:"yaml"},{title:"HTML",value:"html"},{title:"CSS",value:"css"},{title:"Javascript",value:"javascript"}]},94327:e=>{e.exports=JSON.parse('[{"title":"VARCHAR","name":"VARCHAR","value":"0-255","argument":true,"description":"Varchar is simply letters and numbers within the range 0 - 255","maxValue":255},{"title":"TINYINT","name":"TINYINT","value":"0-100","description":"TINYINT means Integers: 0 to 100","maxValue":127},{"title":"SMALLINT","name":"SMALLINT","value":"0-255","description":"SMALLINT means Integers: 0 to 240933","maxValue":32767},{"title":"MEDIUMINT","name":"MEDIUMINT","value":"0-255","description":"MEDIUMINT means Integers: 0 to 1245568545560","maxValue":8388607},{"title":"INT","name":"INT","value":"0-255","description":"INT means Integers: 0 to 12560","maxValue":2147483647},{"title":"BIGINT","name":"BIGINT","value":"0-255","description":"BIGINT means Integers: 0 to 1245569056767568545560","maxValue":2e+63},{"title":"TINYTEXT","name":"TINYTEXT","value":"0-255","description":"Text with 255 max characters","maxValue":127},{"title":"TEXT","name":"TEXT","value":"0-100","description":"MEDIUMTEXT is just text with max length 16,777,215"},{"title":"MEDIUMTEXT","name":"MEDIUMTEXT","value":"0-255","description":"MEDIUMTEXT is just text with max length 16,777,215"},{"title":"LONGTEXT","name":"LONGTEXT","value":"0-255","description":"LONGTEXT is just text with max length 4,294,967,295"},{"title":"DECIMAL","name":"DECIMAL","description":"Numbers with decimals","integer":"1-100","decimals":"1-4"},{"title":"FLOAT","name":"FLOAT","description":"Numbers with decimals","integer":"1-100","decimals":"1-4"},{"title":"DOUBLE","name":"DOUBLE","description":"Numbers with decimals","integer":"1-100","decimals":"1-4"},{"title":"UUID","name":"UUID","valueLiteral":"UUID()","description":"A Unique ID"}]')}};
|