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
7.6 KiB
1 line
7.6 KiB
2 years ago
|
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[753],{8954:function(n,e,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/server",function(){return t(1142)}])},5521:function(n,e,t){"use strict";t.d(e,{Z:function(){return L}});var r=t(5893),i=t(1113),o=t(1496),c=t(2293),a=t(7357),l=t(2992),s=t(4799),u=t(7294),f=t(7169),d=t(4433),p=t(9029),h=t(7533),g=t(8462),m=t(7212),v=t(8619),x=[{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"}],j={width:"40em",height:"40em"},w=t(4390),b=t(582),y=t(4690),Z=t(1770),S=t(7750),k=t(1081);function _(n,e){(null==e||e>n.length)&&(e=n.length);for(var t=0,r=new Array(e);t<e;t++)r[t]=n[t];return r}function C(n,e){return function(n){if(Array.isArray(n))return n}(n)||function(n,e){var t=null==n?null:"undefined"!==typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(null!=t){var r,i,o=[],c=!0,a=!1;try{for(t=t.call(n);!(c=(r=t.next()).done)&&(o.push(r.value),!e||o.length!==e);c=!0);}catch(l){a=!0,i=l}finally{try{c||null==t.return||t.return()}finally{if(a)throw i}}return o}}(n,e)||function(n,e){if(!n)return;if("string"===typeof n)return _(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);"Object"===t&&n.constructor&&(t=n.constructor.name);if("Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return _(n,e)}(n,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var O=function(){var n=(0,k.Z)(),e=(0,u.useState)({}),t=e[0],r=e[1],i=(0,u.useCallback)((function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"suiapi.";return t["".concat(e).concat(n)]}),[t]),o=(0,u.useCallback)((function(){return i("user")}),[i]);return(0,u.useEffect)((function(){if(n){var e=document.cookie.split(/\s*;\s*/);r(e.reduce((function(n,e){var t,r=C(e.split("=",2),2),i=r[0],o=r[1],c=decodeURIComponent(o);if(c.startsWith("j:"))try{t=JSON.parse(c.substring(2))}catch(a){t=o}else t=o;return n[i]=t,n}),{}))}}),[n]),{cookieJar:t,getCookie:i,getSessionUser:o}};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 N(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",B={actionIcon:"".concat(A,"-actionIcon"),list:"".concat(A,"-list")},E=(0,o.ZP)(h.ZP)((function(){var n;return P(n={},"& .".concat(B.list),{width:"200px"}),P(n,"& .".concat(B.actionIcon),{fontSize:"2.3em",color:f.of}),n})),I=function(n){var e=n.open,t=n.setOpen,i=(0,O().getSessionUser)();return(0,r.jsx)(E,{BackdropProps:{invisible:!0},anchor:"left",open:e,onClose:function(){return t(!e)},children:(0,r.jsx)("div",{role:"presentation",children:(0,r.jsxs)(g.Z,{className:B.list,children:[(0,r.jsx)(m.ZP,{children:(0,r.jsx)(S.Ac,{children:i?(0,r.jsxs)(r.Fragment,{children:["Welcome, ",i.name]}):"Unregistered"})}),(0,r.jsx)(b.Z,{}),(0,r.jsx)(v.Z,{component:"a",href:"/index.html",children:(0,r.jsxs)(y.Z,{fullWidth:!0,row:!0,spacing:"2em",children:[(0,r.jsx)(d.Z,{className:B.actionIcon}),(0,r.jsx)(S.Ac,{children:"Dashboard"})]})}),x.map((function(n){return(0,r.jsx)(v.Z,{component:"a",href:n.uri,children:(0,r.jsxs)(y.Z,{fullWidth:!0,row:!0,spacing:"2em",children:[(0,r.jsx)("img",N({alt:n.text,src:n.image},j)),(0,r.jsx)(S.Ac,{children:n.text})]})},"anvil-drawer-".concat(n.image))})),(0,r.jsx)(v.Z,{onClick:function(){w.Z.put("/auth/logout").then((function(){window.location.replace("/login")})).catch((function(n){(0,Z.Z)(n)}))},children:(0,r.jsxs)(y.Z,{fullWidth:!0,row:!0,spacing:"2em",child
|