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
8.3 KiB
1 line
8.3 KiB
1 year 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 F}});var r=t(5893),o=t(1113),i=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),b=[{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"}],x={width:"40em",height:"40em"},j=t(4390),w=t(582),y=t(4690),Z=t(1770),k=t(7750),O=t(1081);function C(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 S(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,o,i=[],c=!0,a=!1;try{for(t=t.call(n);!(c=(r=t.next()).done)&&(i.push(r.value),!e||i.length!==e);c=!0);}catch(l){a=!0,o=l}finally{try{c||null==t.return||t.return()}finally{if(a)throw o}}return i}}(n,e)||function(n,e){if(!n)return;if("string"===typeof n)return C(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 C(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 _=function(){var n=(0,O.Z)(),e=(0,u.useState)({}),t=e[0],r=e[1],o=(0,u.useCallback)((function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"suiapi.";return t["".concat(e).concat(n)]}),[t]),i=(0,u.useCallback)((function(){return o("user")}),[o]);return(0,u.useEffect)((function(){if(n){var e=document.cookie.split(/\s*;\s*/);r(e.reduce((function(n,e){var t,r=S(e.split("=",2),2),o=r[0],i=r[1],c=decodeURIComponent(i);if(c.startsWith("j:"))try{t=JSON.parse(c.substring(2))}catch(a){t=i}else t=i;return n[o]=t,n}),{}))}}),[n]),{cookieJar:t,getCookie:o,getSessionUser:i}};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 A(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 N="AnvilDrawer",E={actionIcon:"".concat(N,"-actionIcon"),list:"".concat(N,"-list")},B=(0,i.ZP)(h.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,_().getSessionUser)();return(0,r.jsx)(B,{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:E.list,children:[(0,r.jsx)(m.ZP,{children:(0,r.jsx)(k.Ac,{children:o?(0,r.jsxs)(r.Fragment,{children:["Welcome, ",o.name]}):"Unregistered"})}),(0,r.jsx)(w.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:E.actionIcon}),(0,r.jsx)(k.Ac,{children:"Dashboard"})]})}),b.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",A({alt:n.text,src:n.image},x)),(0,r.jsx)(k.Ac,{children:n.text})]})},"anvil-drawer-".concat(n.image))})),(0,r.jsx)(v.Z,{onClick:function(){j.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
|