dsql-admin/dsql-app/.local_dist/server/chunks/9205.js
Benjamin Toby 7a06e83a46 Updates
2024-12-08 20:56:57 +01:00

1 line
6.9 KiB
JavaScript

"use strict";exports.id=9205,exports.ids=[9205],exports.modules={30671:(e,t)=>{Object.defineProperty(t,"M",{enumerable:!0,get:function(){return function e(t,s){return s in t?t[s]:"then"in t&&"function"==typeof t.then?t.then(t=>e(t,s)):"function"==typeof t&&"default"===s?t:void 0}}})},4545:(e,t,s)=>{s.d(t,{A:()=>p});var a=s(8732),i=s(82015),c=s.n(i),l=s(97780),r=s(63715),n=s(32415),o=s(42583);function d({docPageObject:e}){let[t,s]=c().useState(!1),[i,d]=c().useState([]);return(0,a.jsxs)("div",{className:"card col relative cursor-pointer",onClick:t=>{t.target?.closest(".cancel-link")?t.preventDefault():window.location.pathname=`/su/docs/pages/${e.id}`},children:[t&&(0,a.jsx)(n.A,{width:"20px"}),(0,a.jsxs)("div",{className:"w-full items-start",children:[(0,a.jsx)(l.A,{color:"inherit",className:"opacity-40 text-gray-600"}),(0,a.jsxs)("div",{className:"flex-col items-start gap-0 relative z-10",children:[(0,a.jsx)("span",{className:"title",children:e.title}),(0,a.jsx)("span",{className:"-my-3",dangerouslySetInnerHTML:{__html:e.description||""}})]}),(0,a.jsxs)("div",{className:"ml-auto cancel-link",children:[(0,a.jsx)("button",{onClick:()=>{window.location.href=`/su/docs/edit-page?id=${e.id}`},className:"outlined small-text light-gray",children:"Edit Page"}),(0,a.jsx)("button",{onClick:()=>{window.confirm("Delete this page?")&&(s(!0),(0,r.A)("/api/admin/docs/delete-page",{method:"post",body:e}).then(e=>{e.success&&window.location.reload(),setTimeout(()=>{s(!1)},1e3)}))},className:"outlined small-text light-gray",children:"Delete Page"})]})]}),i&&(0,a.jsxs)("div",{className:"-mt-[40px] pt-[40px] ml-[10px] pl-[20px] border-0 border-l border-slate-200 border-solid w-full flex-col items-start cancel-link",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(o.A,{className:"opacity-20",fontSize:"small"}),(0,a.jsx)("span",{className:"text-slate-300 font-semibold",children:"Children Pages"})]}),i.map((e,t)=>(0,a.jsxs)("div",{className:"card w-full",onClick:()=>{window.location.pathname=`/su/docs/pages/${e.id}`},children:[(0,a.jsx)(l.A,{color:"inherit",className:"opacity-40 text-gray-500"}),(0,a.jsx)("span",{children:e.title})]},t))]})]})}var h=s(62506);function p({data:e}){let{env:t}=e,s=e.docPages,[i,l]=c().useState(!1);function o(e){window.confirm(e?"Update Docs DB from JSON file?":"Update docs json file?")&&(l(!0),(0,r.A)("/api/admin/docs/persist",{method:"post",body:{pull:e}}).then(t=>{t.success?window.alert(e?"Docs database table Updated Sucessfully!":"JSON data written Successfully!"):window.alert("Operation failed!"),setTimeout(()=>{l(!1)},1e3)}).catch(e=>{setTimeout(()=>{l(!1)},1e3)}))}return(0,a.jsxs)(c().Fragment,{children:[i&&(0,a.jsx)(n.A,{}),(0,a.jsxs)("section",{className:"items-start justify-start p-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between w-full mb-6",children:[(0,a.jsx)("h2",{className:"text-xl m-0",children:"Documentation Pages"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("a",{href:"/su/docs/create-page",className:"button",children:"Create Page"}),(0,a.jsxs)(h.A,{children:[(0,a.jsx)("button",{className:"outlined gray",onClick:()=>{o(!1)},children:"Push"}),(0,a.jsx)("button",{className:"outlined gray",onClick:()=>{o(!0)},children:"Pull"})]})]})]}),(0,a.jsx)("div",{className:"paper flex-col items-stretch gap-10 w-full",children:s.map((e,t)=>(0,a.jsx)(d,{docPageObject:e},t))})]})]})}},42583:(e,t,s)=>{var a=s(24994);t.A=void 0;var i=a(s(30887)),c=s(8732);t.A=(0,i.default)([(0,c.jsx)("path",{d:"M22 11V3h-7v3H9V3H2v8h7V8h2v10h4v3h7v-8h-7v3h-2V8h2v3zM7 9H4V5h3zm10 6h3v4h-3zm0-10h3v4h-3z"},"0"),(0,c.jsx)("path",{d:"M7 5v4H4V5zm13 0v4h-3V5zm0 10v4h-3v-4z",opacity:".3"},"1")],"AccountTreeTwoTone")},97780:(e,t,s)=>{var a=s(24994);t.A=void 0;var i=a(s(30887)),c=s(8732);t.A=(0,i.default)([(0,c.jsx)("path",{d:"M5 5v14h14V5zm9 12H7v-2h7zm3-4H7v-2h10zm0-4H7V7h10z",opacity:".3"},"0"),(0,c.jsx)("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 16H5V5h14zm-2-6H7v-2h10zm0-4H7V7h10zm-3 8H7v-2h7z"},"1")],"ArticleTwoTone")},67105:(e,t,s)=>{s.d(t,{A:()=>a});let a=(0,s(82544).A)("CloudUpload",[["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"M12 12v9",key:"192myk"}],["path",{d:"m16 16-4-4-4 4",key:"119tzi"}]])},26628:(e,t,s)=>{s.d(t,{A:()=>a});let a=(0,s(82544).A)("DatabaseBackup",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 12a9 3 0 0 0 5 2.69",key:"1ui2ym"}],["path",{d:"M21 9.3V5",key:"6k6cib"}],["path",{d:"M3 5v14a9 3 0 0 0 6.47 2.88",key:"i62tjy"}],["path",{d:"M12 12v4h4",key:"1bxaet"}],["path",{d:"M13 20a5 5 0 0 0 9-3 4.5 4.5 0 0 0-4.5-4.5c-1.33 0-2.54.54-3.41 1.41L12 16",key:"1f4ei9"}]])},34479:(e,t,s)=>{s.d(t,{A:()=>a});let a=(0,s(82544).A)("FileWarning",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},20427:(e,t,s)=>{s.d(t,{A:()=>a});let a=(0,s(82544).A)("Home",[["path",{d:"m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"y5dka4"}],["polyline",{points:"9 22 9 12 15 12 15 22",key:"e2us08"}]])},62011:(e,t,s)=>{s.d(t,{A:()=>a});let a=(0,s(82544).A)("LockKeyhole",[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]])},2459:(e,t,s)=>{s.d(t,{A:()=>a});let a=(0,s(82544).A)("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]])},80006:(e,t,s)=>{s.d(t,{A:()=>a});let a=(0,s(82544).A)("SquareChevronRight",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"m10 8 4 4-4 4",key:"1wy4r4"}]])},25294:(e,t,s)=>{s.d(t,{A:()=>a});let a=(0,s(82544).A)("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]])},67216:(e,t,s)=>{let a=s(9973),i=s(31976),c=a({config:{host:process.env.DSQL_DB_HOST,user:process.env.DSQL_DB_USERNAME,password:process.env.DSQL_DB_PASSWORD,database:process.env.DSQL_DB_NAME,port:process.env.DSQL_DB_PORT?Number(process.env.DSQL_DB_PORT):void 0,charset:"utf8mb4",ssl:i()}});async function l(...e){try{let t=await c.query(...e);return await c.end(),JSON.parse(JSON.stringify(t))}catch(e){return console.log("DB Error =>",e),{success:!1,error:e.message}}}e.exports=l},31976:(e,t,s)=>{let a=s(29021);e.exports=function(){let e=process.env.DSQL_SSL_DIR;if(!e?.match(/./))return;let t=`${e}/ca-cert.pem`;if(!a.existsSync(t)){console.log(`${t} does not exist`);return}return{ca:a.readFileSync(`${e}/ca-cert.pem`)}}},9455:(e,t)=>{var s;Object.defineProperty(t,"A",{enumerable:!0,get:function(){return s}}),function(e){e.PAGES="PAGES",e.PAGES_API="PAGES_API",e.APP_PAGE="APP_PAGE",e.APP_ROUTE="APP_ROUTE",e.IMAGE="IMAGE"}(s||(s={}))}};