1 line
9.2 KiB
JavaScript
1 line
9.2 KiB
JavaScript
|
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[761],{82777:function(e,n,t){var r=t(85893),l=t(67294),i=t(99514),o=t(14440);n.Z=e=>{let{calculateItemBreakpoints:n=()=>({xs:1}),layout:t,wrapperBoxProps:s,...c}=e,a=(0,l.useMemo)(()=>Object.entries(t).map((e,t)=>{let[r,o]=e;return o?(0,l.createElement)(i.ZP,{...n(t,r),key:r,item:!0,...o}):void 0}),[n,t]);return(0,r.jsx)(o.Z,{...s,children:(0,r.jsx)(i.ZP,{container:!0,...c,children:a})})}},39937:function(e,n,t){t.d(n,{Z:function(){return P}});var r=t(85893),l=t(19338),i=t(89262),o=t(32653),s=t(14440),c=t(34815),a=t(80594),u=t(67294),d=t(77831),h=t(55278),g=t(26076),p=t(8489),f=t(37969),x=t(54965),m=t(49520);let v=[{text:"Anvil",image:"/pngs/anvil_icon_on.png",uri:"/manage-element"},{text:"Files",image:"/pngs/files_on.png",uri:"/file-manager"},{text:"Configure",image:"/pngs/configure_icon_on.png",uri:"/config"},{text:"Mail",image:"/pngs/email_on.png",uri:"/mail-config"},{text:"Help",image:"/pngs/help_icon_on.png",uri:"https://alteeve.com/w/Support"}],j={width:"40em",height:"40em"};var b=t(98484),Z=t(29535),w=t(56903),k=t(97607),y=t(59278),C=t(6946);let F="AnvilDrawer",A={actionIcon:"".concat(F,"-actionIcon"),list:"".concat(F,"-list")},_=(0,i.ZP)(p.ZP)(()=>({["& .".concat(A.list)]:{width:"200px"},["& .".concat(A.actionIcon)]:{fontSize:"2.3em",color:d.of}}));var B=e=>{let{open:n,setOpen:t}=e,{getSessionUser:l}=(0,C.Z)(),i=l();return(0,r.jsx)(_,{BackdropProps:{invisible:!0},anchor:"left",open:n,onClose:()=>t(!n),children:(0,r.jsx)("div",{role:"presentation",children:(0,r.jsxs)(f.Z,{className:A.list,children:[(0,r.jsx)(x.ZP,{children:(0,r.jsx)(y.Ac,{children:i?(0,r.jsxs)(r.Fragment,{children:["Welcome, ",i.name]}):"Unregistered"})}),(0,r.jsx)(Z.Z,{}),(0,r.jsx)(m.Z,{component:"a",href:"/index.html",children:(0,r.jsxs)(w.Z,{fullWidth:!0,row:!0,spacing:"2em",children:[(0,r.jsx)(h.Z,{className:A.actionIcon}),(0,r.jsx)(y.Ac,{children:"Dashboard"})]})}),v.map(e=>(0,r.jsx)(m.Z,{component:"a",href:e.uri,children:(0,r.jsxs)(w.Z,{fullWidth:!0,row:!0,spacing:"2em",children:[(0,r.jsx)("img",{alt:e.text,src:e.image,...j}),(0,r.jsx)(y.Ac,{children:e.text})]})},"anvil-drawer-".concat(e.image))),(0,r.jsx)(m.Z,{onClick:()=>{b.Z.put("/auth/logout").then(()=>{window.location.replace("/login")}).catch(e=>{(0,k.Z)(e)})},children:(0,r.jsxs)(w.Z,{fullWidth:!0,row:!0,spacing:"2em",children:[(0,r.jsx)(g.Z,{className:A.actionIcon}),(0,r.jsx)(y.Ac,{children:"Logout"})]})})]})})})},I=t(85838),S=t(39333);let O="Header",E={input:"".concat(O,"-input"),barElement:"".concat(O,"-barElement"),iconBox:"".concat(O,"-iconBox"),searchBar:"".concat(O,"-searchBar"),icons:"".concat(O,"-icons")},N=(0,i.ZP)(o.Z)(e=>{let{theme:n}=e;return{paddingTop:n.spacing(.5),paddingBottom:n.spacing(.5),paddingLeft:n.spacing(3),paddingRight:n.spacing(3),borderBottom:"solid 1px",borderBottomColor:d.hM,position:"static",["& .".concat(E.input)]:{height:"2.8em",width:"30vw",backgroundColor:n.palette.secondary.main,borderRadius:d.n_},["& .".concat(E.barElement)]:{padding:0},["& .".concat(E.iconBox)]:{[n.breakpoints.down("sm")]:{display:"none"}},["& .".concat(E.searchBar)]:{[n.breakpoints.down("sm")]:{flexGrow:1,paddingLeft:"15vw"}},["& .".concat(E.icons)]:{paddingLeft:".1em",paddingRight:".1em"}}});var P=()=>{let e=(0,u.useRef)({}),n=(0,u.useRef)({}),[t,i]=(0,u.useState)(!1);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(N,{children:(0,r.jsxs)(s.Z,{display:"flex",justifyContent:"space-between",flexDirection:"row",children:[(0,r.jsx)(w.Z,{row:!0,children:(0,r.jsx)(c.Z,{onClick:()=>i(!t),children:(0,r.jsx)("img",{alt:"",src:"/pngs/logo.png",width:"160",height:"40"})})}),(0,r.jsx)(w.Z,{className:E.iconBox,row:!0,spacing:0,children:(0,r.jsx)(s.Z,{children:(0,r.jsx)(a.Z,{onClick:e=>{var t,r;let{currentTarget:l}=e;null===(t=n.current.setAnchor)||void 0===t||t.call(null,l),null===(r=n.current.setOpen)||void 0===r||r.call(null,!0)},sx:{color:d.of,padding:"0 .1rem"},children:(0,r.jsx)(I.Z,{icon:l.Z,ref:e})})})})]})}),(0,r.jsx)(B,{open:t,setOpen:i}),(0,r.jsx)(S.Z,{onFetchSuccessAppend:n=>{var t;null===(t=e.current.indicate)||v
|