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));
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);
});
};