harperdb
Version:
HarperDB is a distributed database, caching service, streaming broker, and application development platform focused on performance and ease of use.
1 lines • 9.69 kB
JavaScript
;(self.webpackChunkharperdb_studio=self.webpackChunkharperdb_studio||[]).push([[83],{5928:(e,n,a)=>{a.r(n),a.d(n,{default:()=>x});var i=a(9379),t=a(9950),s=a(2072),l=a(8125),o=a(5746),r=a(3452),c=a(5077),d=a(6713),u=a(9435),g=a(5553),m=a(3628),v=a(3150),b=a(4319),f=a(5996),h=a(5283),p=a(4414);const x=function(e){var n;let{isMaintenance:a,loggedIn:x=!1}=e;const{pathname:j}=(0,c.zy)(),O=(0,c.Zp)(),y=(0,d.O$)(g.A,(e=>e.auth)),k=(0,d.O$)(g.A,(e=>e.customer)),N=(0,d.O$)(g.A,(e=>e.theme)),A=(0,d.O$)(g.A,(e=>e.themes)),[,_]=(0,b.A)({}),[w,z]=(0,h.A)({}),M=null===A||void 0===A?void 0:A.findIndex((e=>e===N)),P=N&&M!==A.length-1?A[M+1]:A[0],S=(0,t.useMemo)((()=>{var e;return null===y||void 0===y||null===(e=y.orgs)||void 0===e?void 0:e.filter((e=>"invited"===e.status)).length}),[y.orgs]),I=(0,t.useMemo)((()=>{var e,n;return"owner"===(null===y||void 0===y||null===(e=y.orgs)||void 0===e||null===(n=e.find((e=>{var n,a;return(null===(n=e.customer_id)||void 0===n?void 0:n.toString())===(null===k||void 0===k||null===(a=k.customer_id)||void 0===a?void 0:a.toString())})))||void 0===n?void 0:n.status)}),[y.orgs,k.customer_id]),T=e=>{z((0,i.A)((0,i.A)({},w),{},{theme:e})),g.A.update((n=>{n.theme=e}))},E=()=>{f.A.is_local_studio?_({local:!1}):(g.A.update((e=>{e.auth=!1})),z({theme:N}),_({})),O("/")};return(0,p.jsx)(u.tH,{onError:(e,n)=>(0,m.A)({error:{message:e.message,componentStack:n},customer_id:null===k||void 0===k?void 0:k.customer_id,compute_stack_id:null}),FallbackComponent:v.A,children:(0,p.jsxs)(s.A,{id:"app-nav",dark:!0,fixed:"top",expand:"xs",children:[(0,p.jsx)("div",{className:"navbar-brand",children:x?(0,p.jsx)(c.k2,{to:f.A.is_local_studio?"o/local/i/local/browse":"/organizations",children:(0,p.jsx)("div",{id:"logo",title:"Go to Organizations Home"})}):(0,p.jsx)(c.k2,{to:"/",children:(0,p.jsx)("div",{id:"logo",title:"Go to sign in page"})})}),(0,p.jsxs)(l.A,{className:"ms-auto",navbar:!0,children:[x&&!a&&!f.A.is_local_studio&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(o.A,{className:"ms-0",children:(0,p.jsxs)(c.k2,{id:"viewOrganizations",title:"View or Switch Organizations",to:"/organizations",children:[(0,p.jsx)("i",{className:"fa fa-building d-inline-block"}),(0,p.jsx)("span",{className:"d-none d-md-inline-block",children:"Organizations"}),S?(0,p.jsx)("span",{className:"badge",children:S}):null]})}),(0,p.jsxs)("div",{className:"active-org ".concat(k&&-1!==j.indexOf(null===k||void 0===k?void 0:k.customer_id)?"open":""),children:[(0,p.jsx)("div",{className:"text-white org-name",children:k.customer_name}),(0,p.jsxs)("div",{className:"org-actions",children:[(0,p.jsx)(o.A,{className:"ms-0",children:(0,p.jsxs)(c.k2,{id:"viewOrganizationInstances",title:"View Organization Instances",to:"/o/".concat(k.customer_id,"/instances"),children:[(0,p.jsx)("i",{className:"fa fa-th d-inline-block"}),(0,p.jsx)("span",{className:"d-none d-lg-inline-block",children:"Instances"})]})}),I&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(o.A,{children:(0,p.jsxs)(c.k2,{id:"manageOrganizationUsers",title:"Manage Organization Users",to:"/o/".concat(k.customer_id,"/users"),children:[(0,p.jsx)("i",{className:"fa fa-users d-inline-block"}),(0,p.jsx)("span",{className:"d-none d-lg-inline-block",children:"Users"})]})}),(0,p.jsx)(o.A,{children:(0,p.jsxs)(c.k2,{id:"manageOrganizationBilling",title:"Manage Organization Billing",to:"/o/".concat(k.customer_id,"/billing"),children:[(0,p.jsx)("i",{className:"fa fa-credit-card d-inline-block"}),(0,p.jsx)("span",{className:"d-none d-lg-inline-block",children:"Billing"}),"invoice.payment_failed"===(null===k||void 0===k||null===(n=k.current_payment_status)||void 0===n?void 0:n.status)?(0,p.jsx)("span",{className:"badge",children:"!"}):null]})})]})]})]}),(0,p.jsx)(o.A,{children:(0,p.jsxs)(c.k2,{id:"manageProfile",title:"Manage My Profile",to:"/profile",children:[(0,p.jsx)("i",{className:"fa fa-user"}),(0,p.jsx)("span",{className:"d-none d-xl-inline-block",children:"Profile"}),null!==y&&void 0!==y&&y.email_bounced?(0,p.jsx)("span",{className:"badge",children:"!"}):null]})})]}),!f.A.is_local_studio&&(0,p.jsx)("li",{className:"nav-item",children:(0,p.jsxs)("a",{target:"_blank",rel:"noreferrer",href:"https://harperdb.io/docs",id:"viewResources",title:"Harper Documentation",children:[(0,p.jsx)("i",{className:"fas fa-tools"}),(0,p.jsx)("span",{className:"d-none d-xl-inline-block",children:"Resources"})]})}),A.length>1&&(0,p.jsx)(o.A,{children:(0,p.jsxs)(r.A,{color:"link",id:"changeTheme",tabIndex:"0",title:"Switch to ".concat(P," theme"),onKeyDown:e=>13!==e.keyCode||T(P),onClick:()=>T(P),children:[(0,p.jsx)("i",{className:"fas fa-palette"}),(0,p.jsx)("span",{className:"d-none d-xl-inline-block",children:"Theme"})]})}),(0,p.jsx)(o.A,{children:x?(0,p.jsxs)(r.A,{id:"logOut",tabIndex:"0",color:"link",title:"Log Out",onKeyDown:e=>13!==e.keyCode||E(),onClick:E,children:[(0,p.jsx)("i",{className:"fa fa-sign-out-alt"}),(0,p.jsx)("span",{className:"d-none d-xl-inline-block login-text-label",children:"Sign Out"})]}):(0,p.jsxs)(c.k2,{id:"goToLogin",title:"Log In",to:"/",children:[(0,p.jsx)("i",{className:"fa fa-sign-in-alt"}),(0,p.jsx)("span",{className:"d-none d-xl-inline-block login-text-label",children:"Sign In"})]})})]})]})})}},4319:(e,n,a)=>{a.d(n,{A:()=>i});const i=(0,a(6997).A)("instanceAuths")},8125:(e,n,a)=>{a.d(n,{A:()=>v});var i=a(9950),t=a(1942),s=a.n(t),l=a(8738),o=a.n(l),r=a(1497),c=["className","cssModule","tabs","pills","vertical","horizontal","justified","fill","navbar","card","tag"];function d(){return d=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var a=arguments[n];for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(e[i]=a[i])}return e},d.apply(this,arguments)}function u(e,n){if(null==e)return{};var a,i,t=function(e,n){if(null==e)return{};var a,i,t={},s=Object.keys(e);for(i=0;i<s.length;i++)a=s[i],n.indexOf(a)>=0||(t[a]=e[a]);return t}(e,n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)a=s[i],n.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(t[a]=e[a])}return t}var g={card:s().bool,className:s().string,cssModule:s().object,fill:s().bool,horizontal:s().oneOf(["center","end"]),justified:s().bool,navbar:s().bool,pills:s().bool,tabs:s().bool,tag:r.Wx,vertical:s().oneOfType([s().bool,s().string])};function m(e){var n=e.className,a=e.cssModule,t=e.tabs,s=e.pills,l=e.vertical,g=void 0!==l&&l,m=e.horizontal,v=e.justified,b=e.fill,f=e.navbar,h=e.card,p=e.tag,x=void 0===p?"ul":p,j=u(e,c),O=(0,r.qO)(o()(n,f?"navbar-nav":"nav",!!m&&"justify-content-".concat(m),function(e){return!1!==e&&(!0===e||"xs"===e?"flex-column":"flex-".concat(e,"-column"))}(g),{"nav-tabs":t,"card-header-tabs":h&&t,"nav-pills":s,"card-header-pills":h&&s,"nav-justified":v,"nav-fill":b}),a);return i.createElement(x,d({},j,{className:O}))}m.propTypes=g;const v=m},5746:(e,n,a)=>{a.d(n,{A:()=>v});var i=a(9950),t=a(1942),s=a.n(t),l=a(8738),o=a.n(l),r=a(1497),c=["className","cssModule","active","tag"];function d(){return d=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var a=arguments[n];for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(e[i]=a[i])}return e},d.apply(this,arguments)}function u(e,n){if(null==e)return{};var a,i,t=function(e,n){if(null==e)return{};var a,i,t={},s=Object.keys(e);for(i=0;i<s.length;i++)a=s[i],n.indexOf(a)>=0||(t[a]=e[a]);return t}(e,n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)a=s[i],n.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(t[a]=e[a])}return t}var g={active:s().bool,className:s().string,cssModule:s().object,tag:r.Wx};function m(e){var n=e.className,a=e.cssModule,t=e.active,s=e.tag,l=void 0===s?"li":s,g=u(e,c),m=(0,r.qO)(o()(n,"nav-item",!!t&&"active"),a);return i.createElement(l,d({},g,{className:m}))}m.propTypes=g;const v=m},2072:(e,n,a)=>{a.d(n,{A:()=>b});var i=a(9950),t=a(1942),s=a.n(t),l=a(8738),o=a.n(l),r=a(1497),c=["expand","className","cssModule","light","dark","fixed","sticky","color","container","tag","children"];function d(){return d=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var a=arguments[n];for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(e[i]=a[i])}return e},d.apply(this,arguments)}function u(e,n,a){return n in e?Object.defineProperty(e,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[n]=a,e}function g(e,n){if(null==e)return{};var a,i,t=function(e,n){if(null==e)return{};var a,i,t={},s=Object.keys(e);for(i=0;i<s.length;i++)a=s[i],n.indexOf(a)>=0||(t[a]=e[a]);return t}(e,n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)a=s[i],n.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(t[a]=e[a])}return t}var m={children:s().node,className:s().string,color:s().string,container:s().oneOfType([s().bool,s().string]),cssModule:s().object,dark:s().bool,expand:s().oneOfType([s().bool,s().string]),fixed:s().string,light:s().bool,role:s().string,sticky:s().string,tag:r.Wx};function v(e){var n,a=e.expand,t=void 0!==a&&a,s=e.className,l=e.cssModule,m=e.light,v=e.dark,b=e.fixed,f=e.sticky,h=e.color,p=e.container,x=void 0===p?"fluid":p,j=e.tag,O=void 0===j?"nav":j,y=e.children,k=g(e,c),N=(0,r.qO)(o()(s,"navbar",function(e){return!1!==e&&(!0===e||"xs"===e?"navbar-expand":"navbar-expand-".concat(e))}(t),(u(n={"navbar-light":m,"navbar-dark":v},"bg-".concat(h),h),u(n,"fixed-".concat(b),b),u(n,"sticky-".concat(f),f),n)),l),A=x&&!0===x?"container":"container-".concat(x);return i.createElement(O,d({},k,{className:N}),x?i.createElement("div",{className:A},y):y)}v.propTypes=m;const b=v}}]);