dsql-admin/dsql-app/.local_dist/static/chunks/8135-acf650078aafbbbc.js

1 line
6.0 KiB
JavaScript
Raw Normal View History

2024-12-08 19:56:57 +00:00
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8135],{43502:(e,t,a)=>{a.d(t,{A:()=>h});var s=a(74848),l=a(96540),i=a(57457),c=a(23698),d=a(620),n=a(46466);function r(e){let{docPageObject:t}=e,[a,r]=l.useState(!1),[o,h]=l.useState([]);return l.useEffect(()=>{(0,c.A)("/api/admin/docs/get-child-pages",{method:"post",body:{pageId:t.id}}).then(e=>{e.success&&h(e.result)})},[]),(0,s.jsxs)("div",{className:"card col relative cursor-pointer",onClick:e=>{var a;(null===(a=e.target)||void 0===a?void 0:a.closest(".cancel-link"))?e.preventDefault():window.location.pathname="/su/docs/pages/".concat(t.id)},children:[a&&(0,s.jsx)(d.A,{width:"20px"}),(0,s.jsxs)("div",{className:"w-full items-start",children:[(0,s.jsx)(i.A,{color:"inherit",className:"opacity-40 text-gray-600"}),(0,s.jsxs)("div",{className:"flex-col items-start gap-0 relative z-10",children:[(0,s.jsx)("span",{className:"title",children:t.title}),(0,s.jsx)("span",{className:"-my-3",dangerouslySetInnerHTML:{__html:t.description||""}})]}),(0,s.jsxs)("div",{className:"ml-auto cancel-link",children:[(0,s.jsx)("button",{onClick:()=>{window.location.href="/su/docs/edit-page?id=".concat(t.id)},className:"outlined small-text light-gray",children:"Edit Page"}),(0,s.jsx)("button",{onClick:()=>{window.confirm("Delete this page?")&&(r(!0),(0,c.A)("/api/admin/docs/delete-page",{method:"post",body:t}).then(e=>{e.success&&window.location.reload(),setTimeout(()=>{r(!1)},1e3)}))},className:"outlined small-text light-gray",children:"Delete Page"})]})]}),o&&(0,s.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,s.jsxs)("div",{children:[(0,s.jsx)(n.A,{className:"opacity-20",fontSize:"small"}),(0,s.jsx)("span",{className:"text-slate-300 font-semibold",children:"Children Pages"})]}),o.map((e,t)=>(0,s.jsxs)("div",{className:"card w-full",onClick:()=>{window.location.pathname="/su/docs/pages/".concat(e.id)},children:[(0,s.jsx)(i.A,{color:"inherit",className:"opacity-40 text-gray-500"}),(0,s.jsx)("span",{children:e.title})]},t))]})]})}var o=a(60557);function h(e){let{data:t}=e,{env:a}=t,i=t.docPages,[n,h]=l.useState(!1);function p(e){window.confirm(e?"Update Docs DB from JSON file?":"Update docs json file?")&&(h(!0),(0,c.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(()=>{h(!1)},1e3)}).catch(e=>{setTimeout(()=>{h(!1)},1e3)}))}return(0,s.jsxs)(l.Fragment,{children:[n&&(0,s.jsx)(d.A,{}),(0,s.jsxs)("section",{className:"items-start justify-start p-6",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between w-full mb-6",children:[(0,s.jsx)("h2",{className:"text-xl m-0",children:"Documentation Pages"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("a",{href:"/su/docs/create-page",className:"button",children:"Create Page"}),(0,s.jsxs)(o.A,{children:[(0,s.jsx)("button",{className:"outlined gray",onClick:()=>{p(!1)},children:"Push"}),(0,s.jsx)("button",{className:"outlined gray",onClick:()=>{p(!0)},children:"Pull"})]})]})]}),(0,s.jsx)("div",{className:"paper flex-col items-stretch gap-10 w-full",children:i.map((e,t)=>(0,s.jsx)(r,{docPageObject:e},t))})]})]})}},46466:(e,t,a)=>{var s=a(24994);t.A=void 0;var l=s(a(44888)),i=a(74848);t.A=(0,l.default)([(0,i.jsx)("path",{d:"M22 11V3h-7v3H9V3H2v8h7V8h2v10h4v3h7v-8h-7v3h-2V8h2v3zM7 9H4V5h3zm10 6h3v4h-3zm0-10h3v4h-3z"},"0"),(0,i.jsx)("path",{d:"M7 5v4H4V5zm13 0v4h-3V5zm0 10v4h-3v-4z",opacity:".3"},"1")],"AccountTreeTwoTone")},57457:(e,t,a)=>{var s=a(24994);t.A=void 0;var l=s(a(44888)),i=a(74848);t.A=(0,l.default)([(0,i.jsx)("path",{d:"M5 5v14h14V5zm9 12H7v-2h7zm3-4H7v-2h10zm0-4H7V7h10z",opacity:".3"},"0"),(0,i.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")},87296:(e,t,a)=>{a.d(t,{A:()=>s});let s=(0,a(95737).A)("CloudUpload",[["pat