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
5.4 KiB
1 lines
5.4 KiB
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[405],{5301:function(e,r,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/",function(){return n(5075)}])},5741:function(e,r,n){"use strict";var t=n(5893),o=n(1714),c=n(122),i=n(7169),u=n(4690);function s(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function a(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{},t=Object.keys(n);"function"===typeof Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),t.forEach((function(r){s(e,r,n[r])}))}return e}function l(e,r){if(null==e)return{};var n,t,o=function(e,r){if(null==e)return{};var n,t,o={},c=Object.keys(e);for(t=0;t<c.length;t++)n=c[t],r.indexOf(n)>=0||(o[n]=e[n]);return o}(e,r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(t=0;t<c.length;t++)n=c[t],r.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}r.Z=function(e){var r=e.children,n=e.sx,s=l(e,["children","sx"]);return(0,t.jsx)(c.Z,a({underline:"hover",variant:"subtitle1"},s,{sx:a({color:i.lD,textDecorationColor:i.s7},n),children:(0,t.jsxs)(u.Z,{row:!0,children:[r,(0,t.jsx)(o.Z,{sx:{marginLeft:".3em"}})]})}))}},5075:function(e,r,n){"use strict";n.r(r);var t=n(5893),o=n(9008),c=n(1163),i=n(7294),u=n(7357),s=n(7720),a=n(2428),l=n(2029),f=n(7169),v=n(7906),d=n(1200),h=n(5521),p=n(1706),b=n(5741),y=n(9),m=n(3679),x=n(1905),j=n(4968),g=n(2152);function w(e,r){(null==r||r>e.length)&&(r=e.length);for(var n=0,t=new Array(r);n<r;n++)t[n]=e[n];return t}function O(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function S(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{},t=Object.keys(n);"function"===typeof Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),t.forEach((function(r){O(e,r,n[r])}))}return e}function _(e){return function(e){if(Array.isArray(e))return w(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,r){if(!e)return;if("string"===typeof e)return w(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return w(e,r)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Z=function(e,r){return(0,t.jsx)(u.Z,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap","& > *":{width:{xs:"20em",md:"24em"}},"& > :not(:last-child)":{marginRight:"2em"}},children:e.map((function(e){var n=e.anvilName,o=e.anvilUUID,c=e.isScreenshotStale,i=e.screenshot,u=e.serverName,s=e.serverUUID;return(0,t.jsx)(v.M,{externalPreview:i,headerEndAdornment:[(0,t.jsx)(b.Z,{href:"/server?uuid=".concat(s,"&server_name=").concat(u),children:u},"server_list_to_server_".concat(s)),(0,t.jsx)(b.Z,{href:"/anvil?anvil_uuid=".concat(o),sx:{opacity:.7},children:n},"server_list_server_".concat(s,"_to_anvil_").concat(o))],isExternalPreviewStale:c,isFetchPreview:!1,isShowControls:!1,isUseInnerPanel:!0,onClickPreview:function(){r.push("/server?uuid=".concat(s,"&server_name=").concat(u,"&vnc=1"))},serverUUID:s},"server-preview-".concat(s))}))})},P=function(e,r){return""===r?{exclude:e,include:[]}:e.reduce((function(e,n){return n.serverName.includes(r)?e.include.push(n):e.exclude.push(n),e}),{exclude:[],include:[]})};r.default=function(){var e=(0,i.useRef)(!0),r=(0,c.useRouter)(),n=(0,i.useState)([]),v=n[0],b=n[1],w=(0,i.useState)([]),O=w[0],E=w[1],U=(0,i.useState)([]),D=U[0],I=U[1],k=(0,i.useState)(""),C=k[0],A=k[1],N=(0,i.useState)(!1),R=N[0],T=N[1],F=function(){for(var r=arguments.length,n=new Array(r),t=0;t<r;t++)n[t]=arguments[t];var o=P.apply(void 0,_(n)),c=o.exclude,i=o.include;e.current&&(E(c),I(i))},L=(0,x.Z)("".concat(l.Z,"/server"),{onSuccess:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=r.map((function(r){var t,o=r.serverUUID,c=S({},r,{screenshot:(null===(t=v.find((function(e){return e.serverUUID===o})))||void 0===t?void 0:t.screenshot)||""});return(0,d.Z)("".concat(l.Z,"/server/").concat(o,"?ss")).then((function(r){var t=r.screenshot;c.screenshot=t,c.isScreenshotStale=!1;var o=_(n);e.current&&b(o)})).catch((function(){c.isScreenshotStale=!0})),c}));b(n),F(n,C)},refreshInterval:6e4}).isLoading;return(0,i.useEffect)((function(){return function(){e.current=!1}}),[]),(0,t.jsxs)(u.Z,{children:[(0,t.jsx)(o.default,{children:(0,t.jsx)("title",{children:"Dashboard"})}),(0,t.jsx)(h.Z,{}),(0,t.jsx)(m.s_,{children:L?(0,t.jsx)(g.Z,{}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(m.V9,{children:[(0,t.jsx)(y.Z,{placeholder:"Search by server name",onChange:function(e){var r=e.target.value;A(r),F(v,r)},sx:{marginRight:".6em"},value:C}),(0,t.jsx)(p.Z,{onClick:function(){return T(!0)},children:(0,t.jsx)(a.Z,{})})]}),Z(D,r),D.length>0&&(0,t.jsx)(s.Z,{sx:{backgroundColor:f.d}}),Z(O,r)]})}),(0,t.jsx)(j.Z,{dialogProps:{open:R},onClose:function(){T(!1)}})]})}}},function(e){e.O(0,[382,483,894,182,614,485,717,746,203,899,140,116,906,774,888,179],(function(){return r=5301,e(e.s=r);var r}));var r=e.O();_N_E=r}]); |