You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
11 KiB
1 line
11 KiB
1 year ago
|
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[48],{8750:function(n,e,t){t.d(e,{Z:function(){return D}});var r=t(5893),o=t(1113),i=t(1496),c=t(2293),a=t(7357),l=t(2992),u=t(4799),s=t(7294),f=t(7169),d=t(4433),p=t(9029),g=t(7533),m=t(8462),b=t(7212),h=t(8619),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:"Help",image:"/pngs/help_icon_on.png",uri:"https://alteeve.com/w/Support"}],y={width:"40em",height:"40em"},j=t(4390),x=t(582),w=t(4690),O=t(1770),S=t(7750),Z=t(1883);function P(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function k(n){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})))),r.forEach((function(e){P(n,e,t[e])}))}return n}var A="AnvilDrawer",E={actionIcon:"".concat(A,"-actionIcon"),list:"".concat(A,"-list")},C=(0,i.ZP)(g.ZP)((function(){var n;return P(n={},"& .".concat(E.list),{width:"200px"}),P(n,"& .".concat(E.actionIcon),{fontSize:"2.3em",color:f.of}),n})),I=function(n){var e=n.open,t=n.setOpen,o=(0,(0,Z.Z)().getSessionUser)();return(0,r.jsx)(C,{BackdropProps:{invisible:!0},anchor:"left",open:e,onClose:function(){return t(!e)},children:(0,r.jsx)("div",{role:"presentation",children:(0,r.jsxs)(m.Z,{className:E.list,children:[(0,r.jsx)(b.ZP,{children:(0,r.jsx)(S.Ac,{children:o?(0,r.jsxs)(r.Fragment,{children:["Welcome, ",o.name]}):"Unregistered"})}),(0,r.jsx)(x.Z,{}),(0,r.jsx)(h.Z,{component:"a",href:"/index.html",children:(0,r.jsxs)(w.Z,{fullWidth:!0,row:!0,spacing:"2em",children:[(0,r.jsx)(d.Z,{className:E.actionIcon}),(0,r.jsx)(S.Ac,{children:"Dashboard"})]})}),v.map((function(n){return(0,r.jsx)(h.Z,{component:"a",href:n.uri,children:(0,r.jsxs)(w.Z,{fullWidth:!0,row:!0,spacing:"2em",children:[(0,r.jsx)("img",k({alt:n.text,src:n.image},y)),(0,r.jsx)(S.Ac,{children:n.text})]})},"anvil-drawer-".concat(n.image))})),(0,r.jsx)(h.Z,{onClick:function(){j.Z.put("/auth/logout").then((function(){window.location.replace("/login")})).catch((function(n){(0,O.Z)(n)}))},children:(0,r.jsxs)(w.Z,{fullWidth:!0,row:!0,spacing:"2em",children:[(0,r.jsx)(p.Z,{className:E.actionIcon}),(0,r.jsx)(S.Ac,{children:"Logout"})]})})]})})})},B=t(3377),_=t(2444);function M(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}var N="Header",T={input:"".concat(N,"-input"),barElement:"".concat(N,"-barElement"),iconBox:"".concat(N,"-iconBox"),searchBar:"".concat(N,"-searchBar"),icons:"".concat(N,"-icons")},R=(0,i.ZP)(c.Z)((function(n){var e,t=n.theme;return M(e={paddingTop:t.spacing(.5),paddingBottom:t.spacing(.5),paddingLeft:t.spacing(3),paddingRight:t.spacing(3),borderBottom:"solid 1px",borderBottomColor:f.hM,position:"static"},"& .".concat(T.input),{height:"2.8em",width:"30vw",backgroundColor:t.palette.secondary.main,borderRadius:f.n_}),M(e,"& .".concat(T.barElement),{padding:0}),M(e,"& .".concat(T.iconBox),M({},t.breakpoints.down("sm"),{display:"none"})),M(e,"& .".concat(T.searchBar),M({},t.breakpoints.down("sm"),{flexGrow:1,paddingLeft:"15vw"})),M(e,"& .".concat(T.icons),{paddingLeft:".1em",paddingRight:".1em"}),e})),D=function(){var n=(0,s.useRef)({}),e=(0,s.useRef)({}),t=(0,s.useState)(!1),i=t[0],c=t[1];return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(R,{children:(0,r.jsxs)(a.Z,{display:"flex",justifyContent:"space-between",flexDirection:"row",children:[(0,r.jsx)(w.Z,{row:!0,children:(0,r.jsx)(l.Z,{onClick:function(){return c(!i)},children:(0,r.jsx)("img",{alt:"",src:"/pngs/logo.png",width:"160",height:"40"})})}),(0,r.jsx)(w.Z,{className:T.iconBox,row:!0,spacing:0,children:(0,r.jsx)(a.Z,{children:(0,r.jsx)(u.Z,{onClick:function(n){var t,r,o=n.currentTarget;null===(t=e.current.setAnchor)||void 0===t||t.call(null,o),null===(r=e
|