|
|
@ -72,25 +72,26 @@ const submit = async (formEl: FormInstance | undefined) => {
|
|
|
|
if (!valid) {
|
|
|
|
if (!valid) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
localStorage.setItem('VscodeConnctInfo', JSON.stringify(addForm));
|
|
|
|
localStorage.setItem('VscodeConnectInfo', JSON.stringify(addForm));
|
|
|
|
dialogVisible.value = false;
|
|
|
|
dialogVisible.value = false;
|
|
|
|
window.open(
|
|
|
|
const vscodeUrl = `vscode://vscode-remote/ssh-remote+${addForm.username}@${addForm.host}${addForm.path}?windowId=_blank`;
|
|
|
|
`vscode://vscode-remote/ssh-remote+${addForm.username}@${addForm.host}${addForm.path}?windowId=_blank`,
|
|
|
|
window.open(vscodeUrl);
|
|
|
|
);
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
const acceptParams = async (params: DialogProps): Promise<void> => {
|
|
|
|
const acceptParams = async (params: DialogProps): Promise<void> => {
|
|
|
|
if (localStorage.getItem('VscodeConnctInfo')) {
|
|
|
|
const vscodeConnectInfo = localStorage.getItem('VscodeConnectInfo');
|
|
|
|
addForm.host = JSON.parse(localStorage.getItem('VscodeConnctInfo')).host;
|
|
|
|
|
|
|
|
addForm.port = JSON.parse(localStorage.getItem('VscodeConnctInfo')).port;
|
|
|
|
if (vscodeConnectInfo) {
|
|
|
|
addForm.username = JSON.parse(localStorage.getItem('VscodeConnctInfo')).username;
|
|
|
|
try {
|
|
|
|
window.open(
|
|
|
|
const storedInfo = JSON.parse(vscodeConnectInfo);
|
|
|
|
`vscode://vscode-remote/ssh-remote+${addForm.username}@${addForm.host}${params.path}?windowId=_blank`,
|
|
|
|
addForm.host = storedInfo.host;
|
|
|
|
);
|
|
|
|
addForm.port = storedInfo.port;
|
|
|
|
} else {
|
|
|
|
addForm.username = storedInfo.username;
|
|
|
|
addForm.path = params.path;
|
|
|
|
} catch (error) {}
|
|
|
|
dialogVisible.value = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
addForm.path = params.path;
|
|
|
|
|
|
|
|
dialogVisible.value = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
defineExpose({ acceptParams });
|
|
|
|
defineExpose({ acceptParams });
|
|
|
|