diff --git a/frontend/composables/useRdp.ts b/frontend/composables/useRdp.ts index e697656..e9514fc 100644 --- a/frontend/composables/useRdp.ts +++ b/frontend/composables/useRdp.ts @@ -17,6 +17,7 @@ function createJsonWsTunnel(wsUrl: string, connectMsg: object) { let onDisconnected: ((reason: string) => void) | null = null let onGatewayError: ((message: string) => void) | null = null + let instructionCount = 0 function dispatchInstructions(raw: string) { if (!tunnel.oninstruction) return let remaining = raw @@ -37,6 +38,14 @@ function createJsonWsTunnel(wsUrl: string, connectMsg: object) { pos = dotIdx + 1 + len + 1 } if (parts.length > 0) { + instructionCount++ + if (instructionCount <= 30) { + const opcode = parts[0] + const argSummary = opcode === 'blob' + ? `[stream=${parts[1]}, ${(parts[2] || '').length} bytes]` + : parts.slice(1).join(',') + console.log(`[RDP] Instruction #${instructionCount}: ${opcode}(${argSummary})`) + } tunnel.oninstruction(parts[0], parts.slice(1)) } } @@ -190,6 +199,12 @@ export function useRdp() { console.log(`[RDP] State: ${states[state] || state}`) } + // Log when display is ready + client.onready = () => { + const display = client.getDisplay() + console.log(`[RDP] Ready! Display: ${display.getWidth()}x${display.getHeight()}, element: ${displayEl.offsetWidth}x${displayEl.offsetHeight}, container: ${container.offsetWidth}x${container.offsetHeight}`) + } + // Attach Guacamole display element to container const displayEl = client.getDisplay().getElement() container.appendChild(displayEl)