Add port to vscodeUrl in SSH remote connection (#5775)

修改了 vscodeUrl 模板以在主机和路径之间包含来自 addForm.port 的端口,确保正确设置 SSH 远程连接。
This commit is contained in:
Anye 2024-07-11 18:45:52 +08:00 committed by GitHub
parent 0194362a35
commit 6f86dda1aa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -74,7 +74,7 @@ const submit = async (formEl: FormInstance | undefined) => {
} }
localStorage.setItem('VscodeConnectInfo', JSON.stringify(addForm)); localStorage.setItem('VscodeConnectInfo', JSON.stringify(addForm));
dialogVisible.value = false; dialogVisible.value = false;
const vscodeUrl = `vscode://vscode-remote/ssh-remote+${addForm.username}@${addForm.host}${addForm.path}?windowId=_blank`; const vscodeUrl = `vscode://vscode-remote/ssh-remote+${addForm.username}@${addForm.host}:${addForm.port}${addForm.path}?windowId=_blank`;
window.open(vscodeUrl); window.open(vscodeUrl);
}); });
}; };