From 175fbaf3f22a1859afedef1227e824cd2e7c6234 Mon Sep 17 00:00:00 2001 From: ssongliu Date: Wed, 21 Oct 2026 16:40:42 +0800 Subject: [PATCH] fix: correct terminal node routing for containers (#14142) --- frontend/src/components/terminal/index.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/terminal/index.vue b/frontend/src/components/terminal/index.vue index 1375d53df..4a84554fd 100644 --- a/frontend/src/components/terminal/index.vue +++ b/frontend/src/components/terminal/index.vue @@ -313,9 +313,10 @@ const initWebSocket = async (endpoint_: string, args: string = '') => { const protocol = href.split('//')[0] === 'http:' ? 'ws' : 'wss'; const host = href.split('//')[1].split('/')[0]; const endpoint = endpoint_.replace(/^\/+/, ''); - let node = args.indexOf('id=') !== -1 ? 'local' : currentNode.value; + const params = new URLSearchParams(args); + const node = params.has('id') ? 'local' : currentNode.value; let conn = `${protocol}://${host}/${endpoint}?cols=${term.value.cols}&rows=${term.value.rows}&${args}&operateNode=${node}`; - if (args.indexOf('operateNode=') !== -1) { + if (params.has('operateNode')) { conn = `${protocol}://${host}/${endpoint}?cols=${term.value.cols}&rows=${term.value.rows}&${args}`; } if (sessionId.value) {