1 line
7.9 KiB
JavaScript
1 line
7.9 KiB
JavaScript
![]() |
"use strict";exports.id=7585,exports.ids=[7585],exports.modules={30671:(e,s)=>{Object.defineProperty(s,"M",{enumerable:!0,get:function(){return function e(s,t){return t in s?s[t]:"then"in s&&"function"==typeof s.then?s.then(s=>e(s,t)):"function"==typeof s&&"default"===t?s:void 0}}})},55904:(e,s,t)=>{t.d(s,{A:()=>i});var a=t(8732),r=t(82015),n=t.n(r);function i({children:e,column:s,className:t}){let r=n().useRef();return(0,a.jsx)("div",{className:"items-stretch gap-0"+(s?" flex-col":" flex-wrap xl:flex-nowrap")+(t?" "+t:""),ref:r,children:e})}},93035:(e,s,t)=>{t.d(s,{A:()=>m});var a=t(8732),r=t(82015),n=t.n(r),i=t(46169),o=t(16757),l=t(82544);let c=(0,l.A)("Newspaper",[["path",{d:"M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-2 2Zm0 0a2 2 0 0 1-2-2v-9c0-1.1.9-2 2-2h2",key:"7pis2x"}],["path",{d:"M18 14h-8",key:"sponae"}],["path",{d:"M15 18h-5",key:"95g1m2"}],["path",{d:"M10 6h8v4h-8V6Z",key:"smlsk5"}]]),d=(0,l.A)("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);var p=t(53881);function h({docPageObject:e}){let s=n().useContext(p.AppContext).user,[t,r]=n().useState(!1),[l,h]=n().useState([]);return(0,a.jsxs)("div",{className:"card col relative cursor-pointer",onClick:t=>{t.target?.closest(".cancel-link")?t.preventDefault():window.location.pathname=`/admin/${s?.id}/su/docs/pages/${e.id}`},children:[t&&(0,a.jsx)(o.A,{width:"20px"}),(0,a.jsxs)("div",{className:"w-full items-start",children:[(0,a.jsx)(c,{}),(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=`/admin/${s?.id}/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?")&&(r(!0),(0,i.A)("/api/admin/docs/delete-page",{method:"post",body:e}).then(e=>{e.success&&window.location.reload(),setTimeout(()=>{r(!1)},1e3)}))},className:"outlined small-text light-gray",children:"Delete Page"})]})]}),l&&(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)(d,{}),(0,a.jsx)("span",{className:"text-slate-300 font-semibold",children:"Children Pages"})]}),l.map((e,t)=>(0,a.jsxs)("div",{className:"card w-full",onClick:()=>{window.location.pathname=`/admin/${s?.id}/docs/pages/${e.id}`},children:[(0,a.jsx)(c,{}),(0,a.jsx)("span",{children:e.title})]},t))]})]})}var u=t(55904);function m({data:e}){let s=n().useContext(p.AppContext).user,t=e.docPages,[r,l]=n().useState(!1);function c(e){window.confirm(e?"Update Docs DB from JSON file?":"Update docs json file?")&&(l(!0),(0,i.A)("/api/admin/docs/persist",{method:"post",body:{pull:e}}).then(s=>{s.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)(n().Fragment,{children:[r&&(0,a.jsx)(o.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:`/admin/${s?.id}/docs/create-page`,className:"button",children:"Create Page"}),(0,a.jsxs)(u.A,{children:[(0,a.jsx)("button",{className:"outlined gray",onClick:()=>{c(!1)},children:"Push"}),(0,a.jsx)("button",{className:"outlined gray",onClick:()=>{c(!0)},children:"Pull"})]})]})]}),(0,a.jsx)("div",{className:"pape
|