1 line
13 KiB
JavaScript
1 line
13 KiB
JavaScript
"use strict";exports.id=824,exports.ids=[824],exports.modules={1568:(e,t,a)=>{a.d(t,{Z:()=>r});let r=(0,a(8427).Z)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},7840:(e,t,a)=>{a.a(e,async(e,r)=>{try{a.d(t,{Z:()=>w});var s=a(997),n=a(2863),l=a(7348),c=a(3563),i=a(975),o=a(8006),u=a(1048),d=a(9705),h=a(5743),m=a(3216),x=a(6689),p=a(8097),g=e([n,l,o,u,d,h,m,p]);function w({url:e,wrapperProps:t,title:a,...r}){let{loading:g,setLoading:w}=(0,i.Z)();return s.jsx(n.Z,{...t,className:(0,p.twMerge)("p-0",t?.className),children:(0,s.jsxs)(m.Z,{className:"gap-0",children:[(0,s.jsxs)(d.Z,{className:"p-4 w-full justify-between",children:[s.jsx(d.Z,{children:a?s.jsx(x.Fragment,{children:s.jsx(h.Z,{size:"small",variant:"faded",children:a})}):null}),(0,s.jsxs)(d.Z,{children:[s.jsx(o.Z,{title:"Open Full Screen",variant:"ghost",className:"p-1!",onClick:()=>{window.open(e,"__blank")},children:s.jsx(c.Z,{name:"ArrowUpRight",size:20})}),s.jsx(o.Z,{title:"Refresh Iframe",variant:"ghost",className:"p-1!",loading:g,onClick:()=>{w(!0),setTimeout(()=>{w(!1)},2e3)},loadingProps:{size:"smaller"},children:s.jsx(c.Z,{name:"RotateCcw",size:18})})]})]}),s.jsx("hr",{}),g?s.jsx(u.Z,{className:"w-full p-10 h-[400px]",children:s.jsx(l.Z,{})}):s.jsx("iframe",{...r,src:e,className:(0,p.twMerge)("w-full h-[400px]",r.className)})]})})}[n,l,o,u,d,h,m,p]=g.then?(await g)():g,r()}catch(e){r(e)}})},5590:(e,t,a)=>{a.a(e,async(e,r)=>{try{a.d(t,{Z:()=>m});var s=a(997),n=a(6689),l=a(5031),c=a(9705),i=a(8006),o=a(5743),u=a(2863),d=a(8154),h=e([l,c,i,o,u]);function m({service:e,setLog:t,log:a}){let r=e.logs,h=r?.map(e=>"string"==typeof e?e:e.cmd),m=a?.match(/./)&&!h?.find(e=>e==a);return s.jsx(n.Fragment,{children:m?s.jsx(c.Z,{className:"grow",children:s.jsx(u.Z,{className:"w-full py-1 h-[42px]",children:(0,s.jsxs)(c.Z,{className:"w-full justify-between",children:[s.jsx(o.Z,{children:a}),s.jsx(i.Z,{title:"Clear Custom Log",variant:"ghost",className:"p-1",onClick:()=>{t(void 0)},children:s.jsx(d.Z,{size:17})})]})})}):s.jsx(l.Z,{options:[...h?.map(e=>({value:e,title:e}))||[]],changeHandler:e=>{t(e)}})})}[l,c,i,o,u]=h.then?(await h)():h,r()}catch(e){r(e)}})},1392:(e,t,a)=>{a.a(e,async(e,r)=>{try{a.d(t,{Z:()=>p});var s=a(997),n=a(3216),l=a(6689),c=a(8006),i=a(2177),o=a(4956),u=a(5743),d=a(975),h=a(5204),m=a(3563),x=e([n,c,i,o,u,h]);function p({setLog:e}){let{open:t,setOpen:a}=(0,d.Z)(),r=(0,l.useRef)("");return s.jsx(i.ZP,{target:s.jsx(c.Z,{title:"Enter custom command",size:"small",color:"gray",className:"w-[42px] h-[42px]",children:s.jsx(m.Z,{name:"Edit3",size:14})}),setOpen:a,open:t,children:(0,s.jsxs)(n.Z,{children:[(0,s.jsxs)(n.Z,{className:"gap-1",children:[s.jsx(o.Z,{className:"admin-h3",children:"Enter a custom Command"}),s.jsx(u.Z,{variant:"faded",children:"Enter a command to run a custom log"})]}),s.jsx(h.Z,{placeholder:"Enter custom command",changeHandler:e=>{r.current=e},autoFocus:!0}),s.jsx(c.Z,{title:"Set Custom Command",onClick:()=>{e(r.current.trim()),a(!1)},children:"Set Custom Command"})]})})}[n,c,i,o,u,h]=x.then?(await x)():x,r()}catch(e){r(e)}})},8149:(e,t,a)=>{a.a(e,async(e,r)=>{try{a.d(t,{Z:()=>u});var s=a(997),n=a(3216),l=a(9705),c=a(1392),i=a(5590),o=e([n,l,c,i]);function u({service:e,setLog:t,log:a}){return s.jsx(n.Z,{className:"w-full gap-2 p-4",children:(0,s.jsxs)(l.Z,{className:"flex-nowrap",children:[s.jsx(c.Z,{setLog:t}),s.jsx(i.Z,{service:e,setLog:t,log:a})]})})}[n,l,c,i]=o.then?(await o)():o,r()}catch(e){r(e)}})},4221:(e,t,a)=>{a.a(e,async(e,r)=>{try{a.d(t,{Z:()=>p});var s=a(997),n=a(3216),l=a(6689),c=a(3893),i=a(8933);a(6517);var o=a(7348),u=a(1048),d=a(7840),h=a(8650),m=a(975),x=e([n,c,o,u,d]);function p({service:e,server:t,target:a,log_cmd:r,portRef:x}){let{pageProps:p,ws:g}=(0,l.useContext)(c.AppContext),w=(0,l.useRef)(void 0),{data:f}=(0,i.Z)(),{isIntersecting:Z}=(0,h.Z)({elementRef:w,options:{rootMargin:"-200px",threshold:0}}),[j,v]=(0,l.useState)(),{refresh:N,setRefresh:y}=(0,m.Z)();(0,l.useRef)(!1);let b=(0,s.jsxs)(s.Fragment,{children:[s.jsx("code",{children:t.private_ip})," ",a]});return(0,s.jsxs)(n.Z,{className:"gap-0 w-full",componentRef:w,children:[Z&&j?.url&&j.port?s.jsx(n.Z,{className:"gap-0",children:s.jsx(d.Z,{url:j?.url,title:b,wrapperProps:{className:"border-none"}})}):s.jsx(u.Z,{className:"p-10 h-[460px]",children:s.jsx(o.Z,{})}),s.jsx("hr",{})]})}[n,c,o,u,d]=x.then?(await x)():x,r()}catch(e){r(e)}})},9986:(e,t,a)=>{a.a(e,async(e,r)=>{try{a.d(t,{Z:()=>g});var s=a(997),n=a(3216),l=a(6689),c=a(3893),i=a(2358),o=a(8650),u=a(4221),d=a(9705),h=a(8006),m=a(8149),x=a(8097),p=e([n,c,u,d,h,m,x]);function g({service:e,server:t,wrapperProps:a,portRef:r}){let{pageProps:p}=(0,l.useContext)(c.AppContext),g=(0,l.useRef)(void 0),{isIntersecting:w}=(0,o.Z)({elementRef:g}),[f,Z]=(0,l.useState)(e.logs?.[0]?"logs":"shell"),[j,v]=(0,l.useState)();return(0,s.jsxs)(n.Z,{...a,className:(0,x.twMerge)("gap-0",a?.className),children:[(0,s.jsxs)(d.Z,{className:"w-full justify-between p-4 -mb-6",children:[s.jsx(d.Z,{children:s.jsx("code",{children:t.private_ip})}),s.jsx(d.Z,{className:"",children:i.e3.map((e,t)=>{let a=e.name==f;return s.jsx(h.Z,{title:`${e.name}`,onClick:()=>{Z(e.name)},size:"smaller",color:"gray",variant:a?void 0:"outlined",children:e.name},t)})})]}),"logs"==f?s.jsx(m.Z,{server:t,service:e,setLog:v,log:j}):s.jsx(d.Z,{className:"h-[74px]"}),s.jsx("hr",{}),s.jsx(u.Z,{server:t,service:e,target:f,portRef:r,log_cmd:j})]})}[n,c,u,d,h,m,x]=p.then?(await p)():p,r()}catch(e){r(e)}})},2358:(e,t,a)=>{a.d(t,{e3:()=>r});let r=[{name:"logs"},{name:"shell"}]},3135:(e,t,a)=>{a(6517),a(6689)},274:(e,t,a)=>{a.a(e,async(e,r)=>{try{a.d(t,{Z:()=>x});var s=a(997);a(6689);var n=a(8097),l=a(6405),c=a.n(l),i=a(8006),o=a(8154),u=a(8092),d=a(6517),h=a.n(d),m=e([n,i,u]);function x({open:e,setOpen:t,...a}){return e?c().createPortal((0,s.jsxs)("div",{className:(0,n.twMerge)("fixed z-[200] top-0 left-0 w-screen h-screen","flex flex-col items-center justify-center p-4","twui-modal-root"),role:"dialog","aria-modal":"true",children:[s.jsx("div",{className:(0,n.twMerge)("absolute top-0 left-0 bg-dark/80 z-0","w-screen h-screen"),onClick:e=>{t(!1)}}),(0,s.jsxs)(u.Z,{...h().omit(a,["targetWrapperProps"]),className:(0,n.twMerge)("z-10 max-w-modal bg-background-light dark:bg-background-dark","w-full relative max-h-[95vh] overflow-y-auto","twui-modal-content",a.className),children:[a.children,s.jsx(i.Z,{className:"absolute top-0 right-0 p-2",variant:"ghost",color:"gray",onClick:()=>{t(!1)},title:"Close Modal Button",children:s.jsx(o.Z,{size:30})})]})]}),document.getElementById("twui-modal-root")):null}[n,i,u]=m.then?(await m)():m,r()}catch(e){r(e)}})},8764:(e,t,a)=>{a.a(e,async(e,r)=>{try{a.d(t,{Z:()=>h});var s=a(997),n=a(6689),l=a.n(n),c=a(8097),i=a(6405),o=a.n(i),u=a(8092);a(3135);var d=e([c,u]);function h({open:e,setOpen:t,targetElRef:a,position:r="bottom",trigger:n="hover",debounce:i,popoverTargetActiveRef:d,popoverContentActiveRef:h,popoverReferenceRef:m,isPopover:x,...p}){let g;if(!e)return null;let[w,f]=l().useState({}),Z=l().useCallback(()=>{h.current=!0,d.current=!1,t(!0)},[]),j=l().useCallback(()=>{window.clearTimeout(g),g=setTimeout(()=>{if(d.current){d.current=!1;return}t(!1)},i)},[]);return e?o().createPortal(s.jsx(u.Z,{...p,className:(0,c.twMerge)("max-w-[300px] z-[250]","twui-popover-content",p.className),style:{...w,...p.style},onMouseEnter:"hover"===n?Z:p.onMouseEnter,onMouseLeave:"hover"===n?j:p.onMouseLeave,role:"dialog","aria-modal":"true",children:p.children}),document.getElementById("twui-popover-root")):null}[c,u]=d.then?(await d)():d,r()}catch(e){r(e)}})},2863:(e,t,a)=>{a.a(e,async(e,r)=>{try{a.d(t,{Z:()=>c});var s=a(997),n=a(8097),l=e([n]);function c({spacing:e,componentRef:t,...a}){return s.jsx("div",{...a,className:(0,n.twMerge)("relative flex items-center gap-2 border border-solid rounded-default","border-slate-200 dark:border-white/10",e?"normal"==e?"px-3 py-2":"tight"==e?"px-2 py-1":"":"px-3 py-2","twui-border",a.className),ref:t,children:a.children})}n=(l.then?(await l)():l)[0],r()}catch(e){r(e)}})},2177:(e,t,a)=>{a.a(e,async(e,r)=>{try{a.d(t,{ZP:()=>d});var s=a(997),n=a(6689),l=a.n(n),c=a(274),i=a(8764),o=a(8097),u=e([c,i,o]);function d(e){let t;let{target:a,targetRef:r,targetWrapperProps:n,open:u,setOpen:d,isPopover:h,popoverReferenceRef:m,trigger:x="hover",debounce:p=500,onClose:g,hoverOpen:w}=e,[f,Z]=l().useState(!1),[j,v]=l().useState(u||!1),N=r||l().useRef(null),y=m||N,b=l().useRef(!1),k=l().useRef(!1),C=l().useCallback(t=>{b.current=!0,k.current=!1,v(!0),e.onMouseEnter?.(t)},[]),M=l().useCallback(a=>{window.clearTimeout(t),t=setTimeout(()=>{if(k.current){k.current=!1;return}v(!1)},p),e.onMouseLeave?.(a)},[]);return l().useCallback(e=>{let t=e.target,a=t.closest(".twui-popover-content");if(!t.closest(".twui-popover-target")&&!a)return v(!1)},[]),(0,s.jsxs)(l().Fragment,{children:[a?s.jsx("div",{...n,onClick:e=>{e.preventDefault(),e.stopPropagation(),v(!j)},ref:N,onMouseEnter:h&&("hover"===x||w)?C:n?.onMouseEnter,onMouseLeave:h&&("hover"===x||w)?M:n?.onMouseLeave,className:(0,o.twMerge)("twui-popover-target",n?.className),children:a}):null,f?h?s.jsx(i.Z,{...e,open:j,setOpen:v,targetElRef:y,debounce:p,popoverTargetActiveRef:b,popoverContentActiveRef:k}):s.jsx(c.Z,{...e,open:j,setOpen:v}):null]})}[c,i,o]=u.then?(await u)():u,r()}catch(e){r(e)}})},5031:(e,t,a)=>{a.a(e,async(e,r)=>{try{a.d(t,{Z:()=>w});var s=a(997),n=a(1568),l=a(6848),c=a(6689),i=a.n(c),o=a(8097),u=a(417),d=a(3352),h=a(5743),m=a(3216),x=a(9396),p=a(6425),g=e([o,u,d,h,m]);function w({label:e,options:t,componentRef:a,labelProps:r,wrapperProps:c,showLabel:g,iconProps:w,changeHandler:f,info:Z,validateValueFn:j,wrapperWrapperProps:v,dispatchState:N,...y}){let[b,k]=i().useState({isValid:!0}),C=a||i().useRef(null),[M,z]=i().useState({value:t[0]?.value,data:t[0]?.data}),R=e?(0,x.Z)(e):y.name?(0,x.Z)(y.name):y.title?(0,x.Z)(y.title):`select-${Math.round(1e6*Math.random())}`;return(0,s.jsxs)(m.Z,{...v,className:(0,o.twMerge)("gap-1",v?.className),children:[(0,s.jsxs)("div",{...c,className:(0,o.twMerge)("relative w-full flex items-center border rounded-default","border-slate-300 dark:border-white/20 pr-2","focus:border-slate-700 dark:focus:border-white/50","outline-slate-300 dark:outline-white/20","focus:outline-slate-700 dark:focus:outline-white/50","bg-white dark:bg-background-dark",b.isValid?"":"outline-warning border-warning",c?.className),children:[g&&s.jsx("label",{htmlFor:R,...r,className:(0,o.twMerge)("text-xs absolute -top-2.5 left-2 text-foreground-light/80 bg-background-light","dark:text-foreground-dark/70 dark:bg-background-dark px-1.5 rounded-t","twui-input-label",r?.className),children:e||y.title||y.name}),s.jsx("select",{id:R,"aria-label":y["aria-label"]||y.title,...y,className:(0,o.twMerge)("w-full pl-3 py-2 rounded-default appearance-none pr-8","grow !border-none !outline-none","twui-select",y.className),ref:C,value:t.flat().find(e=>e.default)?.value||void 0,onChange:e=>{let a=t.find(t=>t.value==e.target.value);a&&z(a),f?.(e.target.value,a?.data),y.onChange?.(e),j?.(e.target.value).then(e=>{k(e)})},children:t.flat().map((e,t)=>{let a=e.title||(0,p.Z)(e.value);return s.jsx("option",{value:e.value,children:a},t)})}),s.jsx(n.Z,{size:20,...w,className:(0,o.twMerge)("pointer-events-none -ml-6",w?.className)}),Z&&s.jsx(u.Z,{target:s.jsx("div",{title:"Select Info Button",children:s.jsx(l.Z,{size:20})}),hoverOpen:!0,children:s.jsx(d.Z,{className:"min-w-[250px] p-6",children:"string"==typeof Z?s.jsx(h.Z,{children:Z}):Z})})]}),!b.isValid&&b.msg?s.jsx(h.Z,{size:"smaller",className:"text-warning",children:b.msg}):void 0]})}[o,u,d,h,m]=g.then?(await g)():g,r()}catch(e){r(e)}})},5204:(e,t,a)=>{a.a(e,async(e,r)=>{try{a.d(t,{Z:()=>c});var s=a(997),n=a(6248),l=e([n]);function c({componentRef:e,...t}){return s.jsx(n.Z,{istextarea:!0,...t,componentRef:e})}n=(l.then?(await l)():l)[0],r()}catch(e){r(e)}})},8650:(e,t,a)=>{let r;a.d(t,{Z:()=>l});var s=a(6689),n=a.n(s);function l({elementRef:e,className:t,options:a,removeIntersected:s,delay:l,elId:c}){let[i,o]=n().useState(!1),[u,d]=n().useState(0),h=l||200;return n().useCallback((e,t)=>{let a=e[0];window.clearTimeout(r),a.isIntersecting?r=setTimeout(()=>{o(!0),s&&t.unobserve(a.target)},h):o(!1)},[]),{isIntersecting:i}}},1048:(e,t,a)=>{a.a(e,async(e,r)=>{try{a.d(t,{Z:()=>c});var s=a(997),n=a(8097),l=e([n]);function c({...e}){return s.jsx("div",{...e,className:(0,n.twMerge)("flex flex-col items-center justify-center gap-4 p-2 w-full","h-full twui-center",e.className),children:e.children})}n=(l.then?(await l)():l)[0],r()}catch(e){r(e)}})},1309:(e,t,a)=>{a.a(e,async(e,r)=>{try{a.d(t,{Z:()=>c});var s=a(997),n=a(8097),l=e([n]);function c({...e}){return s.jsx("h2",{...e,className:(0,n.twMerge)("text-2xl md:text-3xl mb-4","twui-headings twui-heading","twui-h2",e.className),children:e.children})}n=(l.then?(await l)():l)[0],r()}catch(e){r(e)}})},4956:(e,t,a)=>{a.a(e,async(e,r)=>{try{a.d(t,{Z:()=>c});var s=a(997),n=a(8097),l=e([n]);function c({...e}){return s.jsx("h3",{...e,className:(0,n.twMerge)("text-xl mb-4","twui-headings twui-heading","twui-h3",e.className),children:e.children})}n=(l.then?(await l)():l)[0],r()}catch(e){r(e)}})},9396:(e,t,a)=>{a.d(t,{Z:()=>r});function r(e,t,a){let r=t||"-";try{if(!e)return"";let t=String(e).trim().toLowerCase().replace(/ {2,}/g," ").replace(/ /g,r).replace(/[^a-z0-9]/g,r).replace(/-{2,}|_{2,}/g,r).replace(/^-/,"");if(a)return t;return t.replace(/-$/,"")}catch(e){return""}}}}; |