1import{ba as m,u as g,o as h,aW as k,d as C,f as _,g as p,n as u,k as x,w as D,q as E,r as T,t as I,s as V,L as f,O as B}from"./Be4KCvjK.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new n.Error().stack;r&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[r]="dc113b13-75ce-4d6f-a411-6c3942987064",n._sentryDebugIdIdentifier="sentry-dbid-dc113b13-75ce-4d6f-a411-6c3942987064")}catch{}})();const A={class:"proxmox-console-root"},L={class:"proxmox-console-toolbar"},R={class:"proxmox-console-body"},q={key:0,class:"proxmox-console-status"},N=m({__name:"console",setup(n){const r=g(),c=f(null),o=f("Connecting to console..."),t=f(!1);let e=null,i=null;const a=()=>{i&&(window.clearTimeout(i),i=null)},w=()=>{const s=r.query.token;return Array.isArray(s)?s[0]??"":String(s??"")},y=()=>{!e||!t.value||e.sendCtrlAltDel()};return h(async()=>{if(!c.value){o.value="Console screen is unavailable.";return}try{const s=w();if(!s)throw new Error("Missing console token.");const l=await $fetch("/api/proxmox/console/session",{query:{token:s}}),v=l.data?.websocket_url;if(l.result!=="success"||!v)throw new Error("Console session is unavailable.");const{default:b}=await k(async()=>{const{default:d}=await import("./BW44KeSb.js");return{default:d}},[],import.meta.url);e=new b(c.value,v,{repeaterID:"",shared:!0,credentials:{password:l.data?.password||""}}),e.scaleViewport=!0,e.resizeSession=!1,e.background="#000000",e.viewOnly=!1,e.focusOnClick=!0,i=window.setTimeout(()=>{o.value="Unable to reach console websocket. Please close this window and try opening the console again.",e?.disconnect()},2e4),e.addEventListener("connect",()=>{a(),t.value=!0,o.value=""}),e.addEventListener("disconnect",d=>{a(),t.value=!1,o.value=d?.detail?.clean?"Console disconnected.":"Console connection lost."}),e.addEventListener("credentialsrequired",()=>{a(),t.value=!1,o.value="Console requires credentials."}),e.addEventListener("securityfailure",()=>{a(),t.value=!1,o.value="Console security handshake failed."})}catch(s){a(),o.value=s?.message||"Failed to initialize noVNC console."}}),C(()=>{if(a(),e){try{e.disconnect()}catch{}e=null}}),(s,l)=>(_(),p("div",A,[u("div",L,[x(T,{color:"secondary",variant:"flat",size:"small",disabled:!t.value,onClick:y},{default:D(()=>[...l[0]||(l[0]=[E(" Send Ctrl+Alt+Del ",-1)])]),_:1},8,["disabled"])]),u("div",R,[u("div",{ref_key:"screenRef",ref:c,class:"proxmox-console-screen"},null,512),o.value?(_(),p("div",q,I(o.value),1)):V("",!0)])]))}}),S=B(N,[["__scopeId","data-v-397689b3"]]);export{S as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.