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 lines
9.2 KiB
1 lines
9.2 KiB
"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)||void 0===t||t.call(null,Object.keys(n).length>0)},ref:n})]})}},52675:function(e,n,t){t.d(n,{_:function(){return s},dg:function(){return c},qY:function(){return d},Gn:function(){return h},LT:function(){return j},BD:function(){return v},X7:function(){return b},HJ:function(){return o},SQ:function(){return a}});var r=t(85893),l=t(38189),i=t(59278),o=e=>{let{value:n}=e;return!!n&&String(n).length>0},s=function(e,n){let{isRequired:t,onFinishBatch:i,...s}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},c=arguments.length>3?arguments[3]:void 0;return{defaults:{...s,onSuccess:n},isRequired:t,onFinishBatch:i,tests:[{test:o},{onFailure:function(){for(var n=arguments.length,t=Array(n),l=0;l<n;l++)t[l]=arguments[l];c((0,r.jsxs)(r.Fragment,{children:[e," should be a valid IPv4 address."]}),...t)},test:e=>{let{value:n}=e;return l.tf.test(n)}}]}},c=function(e,n){let{isRequired:t,onFinishBatch:i,...s}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},c=arguments.length>3?arguments[3]:void 0;return{defaults:{...s,onSuccess:n},isRequired:t,onFinishBatch:i,tests:[{test:o},{onFailure:function(){for(var n=arguments.length,t=Array(n),l=0;l<n;l++)t[l]=arguments[l];c((0,r.jsxs)(r.Fragment,{children:[e," must be one or more valid IPv4 addresses separated by comma(s); without trailing comma."]}),...t)},test:e=>{let{value:n}=e;return l.ah.test(n)}}]}},a=e=>{let{max:n,min:t,value:r}=e;return!!r&&r>=t&&r<=n},u=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"parseInt";return"number"==typeof e?e:Number[n](String(e))},d=function(e,n){let{isRequired:t,onFinishBatch:l,...i}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0,s=arguments.length>4?arguments[4]:void 0,c=arguments.length>5?arguments[5]:void 0,d=[];return o?d.push({onFailure:function(){for(var n=arguments.length,t=Array(n),l=0;l<n;l++)t[l]=arguments[l];o((0,r.jsxs)(r.Fragment,{children:[e," must be a valid integer."]}),...t)},test:e=>{let{value:n}=e;return Number.isSafeInteger(u(n))}}):s&&d.push({onFailure:function(){for(var n=arguments.length,t=Array(n),l=0;l<n;l++)t[l]=arguments[l];s((0,r.jsxs)(r.Fragment,{children:[e," must be a valid floating-point number."]}),...t)},test:e=>{let{value:n}=e;return Number.isFinite(u(n,"parseFloat"))}}),c&&d.push({onFailure:function(){for(var n=arguments.length,t=Array(n),l=0;l<n;l++)t[l]=arguments[l];let{displayMax:i,displayMin:o}=t[0];c((0,r.jsxs)(r.Fragment,{children:[e," is expected to be between ",o," and ",i,"."]}),...t)},test:a}),{defaults:{...i,onSuccess:n},isRequired:t,onFinishBatch:l,tests:d}},h=function(e,n){let{isRequired:t,onFinishBatch:s,...c}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=arguments.length>3?arguments[3]:void 0;return{defaults:{...c,onSuccess:n},isRequired:t,onFinishBatch:s,tests:[{test:o},{onFailure:function(){for(var n=arguments.length,t=Array(n),l=0;l<n;l++)t[l]=arguments[l];a((0,r.jsxs)(r.Fragment,{children:[e," cannot contain single-quote (",(0,r.jsx)(i.Q0,{inheritColour:!0,text:"'"}),"), double-quote (",(0,r.jsx)(i.Q0,{inheritColour:!0,text:'"'}),"), slash (",(0,r.jsx)(i.Q0,{inheritColour:!0,text:"/"}),"), backslash (",(0,r.jsx)(i.Q0,{inheritColour:!0,text:"\\"}),"), angle brackets (",(0,r.jsx)(i.Q0,{inheritColour:!0,text:"<>"}),"), curly brackets (",(0,r.jsx)(i.Q0,{inheritColour:!0,text:"{}"}),")."]}),...t)},test:e=>{let{value:n}=e;return l.OU.test(n)}}]}};let g=()=>({}),p=e=>{let{onFailure:n,onSuccess:t}=e;return{cbFailure:n,cbSuccess:t}},f=e=>{let{isIgnoreOnCallbacks:n,onFinishBatch:t}=e;return n?{setTestCallbacks:g}:{cbFinishBatch:t,setTestCallbacks:p}},x=(e,n)=>null!=e?e:n,m=(e,n)=>e||n;var v=function(){let{excludeTestIds:e=[],excludeTestIdsRe:n,inputs:t={},isContinueOnFailure:r,isIgnoreOnCallbacks:l,isTestAll:i=0===Object.keys(t).length,tests:o={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=[...e],c={},a=!0;return i&&Object.keys(o).forEach(e=>{c[e]={}}),c={...c,...t},n&&Object.keys(c).forEach(e=>{n.test(e)&&s.push(e)}),s.forEach(e=>{delete c[e]}),Object.keys(c).every(e=>{let{defaults:{compare:n=[],displayMax:t,displayMin:i,getCompare:s,getValue:u,isIgnoreOnCallbacks:d=l,max:h=0,min:g=0,onSuccess:p,value:v=null}={},isRequired:j=!1,onFinishBatch:b,optionalTests:Z,tests:w}=o[e],{getCompare:k=s,getValue:y=u,isIgnoreOnCallbacks:C=d,max:F=h,min:A=g,compare:_=x(null==k?void 0:k.call(null),n),value:B=x(null==y?void 0:y.call(null),v),displayMax:I=m(t,String(F)),displayMin:S=m(i,String(A))}=c[e],{cbFinishBatch:O,setTestCallbacks:E}=f({isIgnoreOnCallbacks:C,onFinishBatch:b});if(!B&&!j)return null==O||O.call(null,!0,e),!0;let N=e=>{let{onFailure:n,onSuccess:t=p,test:r}=e,l={},i=r({append:l,compare:_,max:F,min:A,value:B}),{cbFailure:o,cbSuccess:s}=E({onFailure:n,onSuccess:t});return i?null==s||s.call(null,{append:l}):(a=i,null==o||o.call(null,{append:l,compare:_,displayMax:I,displayMin:S,max:F,min:A,value:B})),i};null==Z||Z.forEach(N);let P=w.every(N);return null==O||O.call(null,P,e),P||r}),a},j=function(e){let{excludeTestIds:n=[],...t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(){let{excludeTestIds:r=[],...l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return v({tests:e,excludeTestIds:[...n,...r],...t,...l})}},b=e=>{let{max:n,min:t}=e;return n>=t}}}]); |