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.
20 lines
17 KiB
20 lines
17 KiB
7 months ago
|
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[753],{41171:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/server",function(){return n(95319)}])},4845:function(e,t,n){"use strict";var l=n(85893),r=n(89262),o=n(67294),i=n(25934),s=n(99429),a=n(56903),c=n(25137);let u=(0,r.ZP)(a.Z)({justifyContent:"flex-end",width:"100%"});t.Z=e=>{let{actions:t=[],loading:n}=e,r=(0,o.useMemo)(()=>t.map(e=>(0,l.jsx)(s.Z,{...e,children:e.children},(0,i.Z)())),[t]);return n?(0,l.jsx)(c.Z,{mt:0}):(0,l.jsx)(u,{row:!0,spacing:".5em",children:r})}},77583:function(e,t,n){"use strict";var l=n(85893),r=n(14440),o=n(67294),i=n(33544),s=n(56903),a=n(87006),c=n(59278);let u=(0,o.forwardRef)((e,t)=>{let{actionCancelText:n="Cancel",actionProceedText:u,children:d,closeOnProceed:h=!1,contentContainerProps:p,dialogProps:f,disableProceed:m,loading:g,loadingAction:v=!1,onActionAppend:x,onCancelAppend:b,onProceedAppend:j,openInitially:_,preActionArea:w,proceedButtonProps:Z,proceedColour:y="blue",scrollContent:C=!1,scrollBoxProps:k,showActionArea:P=!0,showCancel:M,showClose:O,titleText:V,wide:z,content:N=d}=e,S=(0,o.useRef)(null),A=(0,o.useMemo)(()=>(0,a.Z)(N,c.Ac),[N]),E=(0,o.useMemo)(()=>(0,o.createElement)(C?i.VZ:r.Z,k,A),[A,k,C]),D=(0,o.useMemo)(()=>P&&(0,l.jsx)(i.ux,{cancelProps:{children:n,onClick:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];null==x||x.call(null,...t),null==b||b.call(null,...t)}},closeOnProceed:h,loading:v,proceedProps:{background:y,children:u,disabled:m,onClick:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];null==x||x.call(null,...t),null==j||j.call(null,...t)},...Z},showCancel:M}),[n,u,h,m,v,x,b,j,Z,y,P,M]);return(0,o.useImperativeHandle)(t,()=>({setOpen:e=>{var t;return null===(t=S.current)||void 0===t?void 0:t.setOpen(e)}}),[]),(0,l.jsx)(i.Js,{dialogProps:f,header:V,loading:g,openInitially:_,ref:S,showClose:O,wide:z,children:(0,l.jsxs)(s.Z,{...p,children:[E,w,D]})})});u.displayName="ConfirmDialog",t.Z=u},33544:function(e,t,n){"use strict";n.d(t,{ux:function(){return h},VZ:function(){return j},Js:function(){return w}});var l=n(85893),r=n(92309),o=n(67294),i=n(23930),s=n(25137);let a=(0,o.createContext)(void 0),c=(0,o.forwardRef)((e,t)=>{let{children:n,dialogProps:c={},loading:u,openInitially:d=!1,wide:h}=e,{open:p,PaperProps:f={},...m}=c,{sx:g,...v}=f,[x,b]=(0,o.useState)(d),j=(0,o.useMemo)(()=>null!=p?p:x,[x,p]),_=(0,o.useMemo)(()=>u?(0,l.jsx)(s.Z,{mt:0}):n,[n,u]),w=(0,o.useMemo)(()=>({minWidth:h?{xs:"calc(100%)",md:"50em"}:null,overflow:"visible",...g}),[g,h]);return(0,o.useImperativeHandle)(t,()=>({open:j,setOpen:b}),[j]),(0,l.jsx)(r.Z,{open:j,PaperComponent:i.s_,PaperProps:{...v,sx:w},...m,children:(0,l.jsx)(a.Provider,{value:{open:j,setOpen:b},children:_})})});c.displayName="Dialog";var u=n(4845);let d=function(e){let{handlers:{base:t,origin:n}}=e;for(var l=arguments.length,r=Array(l>1?l-1:0),o=1;o<l;o++)r[o-1]=arguments[o];null==t||t.call(null,...r),null==n||n.call(null,...r)};var h=e=>{let{cancelProps:t,closeOnProceed:n,loading:r=!1,onCancel:i=d,onProceed:s=d,proceedColour:c,proceedProps:h,showCancel:p=!0,cancelChildren:f=null==t?void 0:t.children,proceedChildren:m=null==h?void 0:h.children}=e,g=(0,o.useContext)(a),v=(0,o.useCallback)(function(){for(var e=arguments.length,n=Array(e),l=0;l<e;l++)n[l]=arguments[l];return i({handlers:{base:()=>{null==g||g.setOpen(!1)},origin:null==t?void 0:t.onClick}},...n)},[null==t?void 0:t.onClick,g,i]),x=(0,o.useCallback)(function(){for(var e=arguments.length,t=Array(e),l=0;l<e;l++)t[l]=arguments[l];return s({handlers:{base:()=>{n&&(null==g||g.setOpen(!1))},origin:null==h?void 0:h.onClick}},...t)},[n,g,s,null==h?void 0:h.onClick]);return(0,o.useMemo)(()=>{let e=[{background:c,...h,children:m,onClick:x}];return p&&e.unshift({...t,children:f,onClick:v}),(0,l.jsx)(u.Z,{actions:e,loading:r})},[f,v,t,r,m,c,x,h,p])},p=n(65895),f=n(87006),m=n(59278),g=e=>{let{children:t,showClose:n}=e,r=(0,o.useContext)(a),s=(0,o.useMemo)(()=>(0,f.Z)(t,m.z),[t]),c=(0,o.useMemo)(()=>n&&(0,l.jsx)(p.Z,{mapPreset:"close",onClick:()=
|
||
|
@copyright (c) 2017-present James Kyle <me@thejameskyle.com>
|
||
|
MIT License
|
||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||
|
a copy of this software and associated documentation files (the
|
||
|
"Software"), to deal in the Software without restriction, including
|
||
|
without limitation the rights to use, copy, modify, merge, publish,
|
||
|
distribute, sublicense, and/or sell copies of the Software, and to
|
||
|
permit persons to whom the Software is furnished to do so, subject to
|
||
|
the following conditions:
|
||
|
The above copyright notice and this permission notice shall be
|
||
|
included in all copies or substantial portions of the Software.
|
||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
|
||
|
*/Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return h}});let l=n(38754)._(n(67294)),r=n(60572),o=[],i=[],s=!1;function a(e){let t=e(),n={loading:!0,loaded:null,error:null};return n.promise=t.then(e=>(n.loading=!1,n.loaded=e,e)).catch(e=>{throw n.loading=!1,n.error=e,e}),n}class c{promise(){return this._res.promise}retry(){this._clearTimeouts(),this._res=this._loadFn(this._opts.loader),this._state={pastDelay:!1,timedOut:!1};let{_res:e,_opts:t}=this;e.loading&&("number"==typeof t.delay&&(0===t.delay?this._state.pastDelay=!0:this._delay=setTimeout(()=>{this._update({pastDelay:!0})},t.delay)),"number"==typeof t.timeout&&(this._timeout=setTimeout(()=>{this._update({timedOut:!0})},t.timeout))),this._res.promise.then(()=>{this._update({}),this._clearTimeouts()}).catch(e=>{this._update({}),this._clearTimeouts()}),this._update({})}_update(e){this._state={...this._state,error:this._res.error,loaded:this._res.loaded,loading:this._res.loading,...e},this._callbacks.forEach(e=>e())}_clearTimeouts(){clearTimeout(this._delay),clearTimeout(this._timeout)}getCurrentValue(){return this._state}subscribe(e){return this._callbacks.add(e),()=>{this._callbacks.delete(e)}}constructor(e,t){this._loadFn=e,this._opts=t,this._callbacks=new Set,this._delay=null,this._timeout=null,this.retry()}}function u(e){return function(e,t){let n=Object.assign({loader:null,loading:null,delay:200,timeout:null,webpack:null,modules:null},t),o=null;function a(){if(!o){let t=new c(e,n);o={getCurrentValue:t.getCurrentValue.bind(t),subscribe:t.subscribe.bind(t),retry:t.retry.bind(t),promise:t.promise.bind(t)}}return o.promise()}if(!s){let e=n.webpack?n.webpack():n.modules;e&&i.push(t=>{for(let n of e)if(t.includes(n))return a()})}function u(e,t){!function(){a();let e=l.default.useContext(r.LoadableContext);e&&Array.isArray(n.modules)&&n.modules.forEach(t=>{e(t)})}();let i=l.default.useSyncExternalStore(o.subscribe,o.getCurrentValue,o.getCurrentValue);return l.default.useImperativeHandle(t,()=>({retry:o.retry}),[]),l.default.useMemo(()=>{var t;return i.loading||i.error?l.default.createElement(n.loading,{isLoading:i.loading,pastDelay:i.pastDelay,timedOut:i.timedOut,error:i.error,retry:o.retry}):i.loaded?l.default.createElement((t=i.loaded)&&t.default?t.default:t,e):null},[e,i])}return u.preload=()=>a(),u.displayName="LoadableComponent",l.default.forwardRef(u)}(a,e)}function d(e,t){let n=[];for(;e.length;){let l=e.pop();n.push(l(t))}return Promise.all(n).then(()=>{if(e.length)return d(e,t)})}u.preloadAll=()=>new Promise((e,t)=>{d(o).then(e,t)}),u.preloadReady=e=>(void 0===e&&(e=[]),new Promise(t=>{let n=()=>(s=!0,t());d(i,e).then(n,n)})),window.__NEXT_PRELOADREADY=u.preloadReady;let h=u},95319:function(e,t,n){"use strict";n.r(t);var l=n(85893),r=n(89262),o=n(14440),i=n(9008),s=n.n(i),a=n(11163),c=n(67294),u=n(93016),d=n(39937);let h="Server",p={preview:"".concat(h,"-preview"),fullView:"".concat(h,"-fullView")},f=(0,r.ZP)("div")(e=>{let{theme:t}=e;return{["& .".concat(p.preview)]:{width:"25%",height:"100%",[t.breakpoints.down("md")]:{width:"100%"}},["& .".concat(p.fullView)]:{display:"flex",flexDirection:"row",width:"100%",justifyContent:"center"}}});t.default=()=>{let[e,t]=(0,c.useState)(!0),{server_name:n,server_state:r,uuid:i,vnc:h}=(0,a.useRouter)().query,m=((null==h?void 0:h.toString())||"").length>0,g=(null==n?void 0:n.toString())||"",v=(null==r?void 0:r.toString())||"",x=(null==i?void 0:i.toString())||"";return(0,c.useEffect)(()=>{m&&t(!1)},[m]),(0,l.jsxs)(f,{children:[(0,l.jsx)(s(),{children:(0,l.jsx)("title",{children:g})}),(0,l.jsx)(d.Z,{}),e?(0,l.jsx)(o.Z,{className:p.preview,children:(0,l.jsx)(u.M,{onClickPreview:()=>{t(!1)},serverName:g,serverState:v,serverUUID:x})}):(0,l.jsx)(o.Z,{className:p.fullView,children:(0,l.jsx)(u.S,{onClickCloseButton:()=>{t(!0)},serverUUID:x,serverName:g})})]})}},5152:function(e,t,n){e.exports=n(28864)},11163:function(e,t,n){e.exports=n(9090)}},function(e){e.O(0,[572,318,341,616,16,888,774,179],function(){return e(e.s=41171)}),_N_E=e.O()}]);
|