harperdb
Version:
HarperDB is a distributed database, caching service, streaming broker, and application development platform focused on performance and ease of use.
1 lines • 3.28 kB
JavaScript
;(self.webpackChunkharperdb_studio=self.webpackChunkharperdb_studio||[]).push([[478],{52:(e,n,a)=>{a.r(n),a.d(n,{default:()=>m});var l=a(9950),s=a(5077),i=a(6713),r=a(4414);const t=(0,l.lazy)((()=>Promise.all([a.e(43),a.e(805),a.e(521)]).then(a.bind(a,958)))),c=(0,l.lazy)((()=>Promise.all([a.e(279),a.e(588)]).then(a.bind(a,1192)))),o=()=>[{element:(0,r.jsx)(t,{}),path:"users/:user_id?",link:"users",label:"users",icon:"users",iconCode:"f0c0"},{element:(0,r.jsx)(c,{}),path:"billing",link:"billing",label:"billing",icon:"credit-card-alt",iconCode:"f283"}];var d=a(8651),h=a(5553),u=a(4979);const m=function(){const e=(0,s.zy)(),{customer_id:n}=(0,s.g)(),a=o(),t=(0,i.O$)(h.A,(e=>{var a,l;return null===(a=e.auth)||void 0===a||null===(l=a.orgs)||void 0===l?void 0:l.find((e=>{var a;return(null===(a=e.customer_id)||void 0===a?void 0:a.toString())===n}))}),[n]),c="owner"===(null===t||void 0===t?void 0:t.status),m=(0,i.O$)(h.A,(e=>{var n;return e.auth&&(null===(n=e.auth)||void 0===n?void 0:n.orgs[0].customer_id)})),p="primary"===n&&"/o/".concat(m).concat(e.pathname.split("primary")[1]).concat(e.search);return c?(0,r.jsxs)("main",{id:"organization",children:[(0,r.jsx)(d.A,{}),(0,r.jsx)(l.Suspense,{fallback:(0,r.jsx)(u.A,{header:" ",spinner:!0}),children:(0,r.jsxs)(s.BV,{children:[a.map((e=>(0,r.jsx)(s.qh,{path:e.path,element:e.element},e.path))),(0,r.jsx)(s.qh,{path:"*",element:(0,r.jsx)(s.C5,{to:"users",replace:!0})})]})})]}):t?(0,r.jsx)(s.BV,{children:(0,r.jsx)(s.qh,{path:"*",element:(0,r.jsx)(s.C5,{to:"instances",replace:!0})})}):p?(0,r.jsx)(s.BV,{children:(0,r.jsx)(s.qh,{path:"*",element:(0,r.jsx)(s.C5,{to:p,replace:!0})})}):null}},8651:(e,n,a)=>{a.d(n,{A:()=>m});var l=a(9379),s=(a(9950),a(2072)),i=a(8125),r=a(5746),t=a(8547),c=a(5077),o=a(9435),d=a(3150),h=a(3628),u=a(4414);const m=function(e){let{routes:n=[]}=e;const a=(0,c.Zp)(),m=(0,c.zy)(),p=(null===n||void 0===n?void 0:n.find((e=>e.link===m.pathname)))||n[0];return(0,u.jsx)(o.tH,{onError:(e,n)=>(0,h.A)({error:{message:e.message,componentStack:n}}),FallbackComponent:d.A,children:(0,u.jsx)(s.A,{className:"app-subnav",children:p&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(i.A,{navbar:!0,className:"instance-nav d-none d-md-flex",children:n.map((e=>e.external?(0,u.jsx)("li",{className:"nav-item",children:(0,u.jsxs)("a",{className:"nav-link",href:e.url,target:"_blank",rel:"noreferrer",children:[(0,u.jsx)("i",{className:"d-none d-sm-inline-block fa me-1 fa-".concat(e.icon)}),e.label]})},e.path):(0,u.jsx)(r.A,{children:(0,u.jsxs)(c.k2,{title:e.link,className:"nav-link",to:e.link||e.path,children:[(0,u.jsx)("i",{className:"d-none d-sm-inline-block fa me-1 fa-".concat(e.icon)}),e.label]})},e.path)))}),(0,u.jsx)(i.A,{navbar:!0,className:"d-flex d-md-none",children:(0,u.jsx)(t.Ay,{className:"react-select-container",classNamePrefix:"react-select",width:"200px",onChange:e=>{let{value:n}=e;return a(n)},options:n.filter((e=>e.link!==p.link)).map((e=>({label:(0,u.jsxs)("span",{children:[(0,u.jsx)("i",{className:"d-none d-sm-inline-block fa me-1 fa-".concat(e.icon)}),e.label]}),value:e.link,iconCode:e.iconCode}))),value:(0,l.A)((0,l.A)({},p),{},{value:null===p||void 0===p?void 0:p.link}),defaultValue:null===p||void 0===p?void 0:p.link,isSearchable:!1,isClearable:!1})})]})})})}}}]);