feat: support first connect in remote environment

This commit is contained in:
Levi Yan
2025-05-06 23:05:00 +08:00
parent e4d9d2b3b7
commit 70fa291e37
3 changed files with 141 additions and 37 deletions

View File

@@ -43,12 +43,12 @@ export class DevStarExtension {
// 如果没有用户登录,则直接登录;
const res = await this.user.login(access_token, devstar_username)
if (res === 'ok') {
await this.remoteContainer.firstOpenProject(container_host, container_port, container_username, project_path)
await this.remoteContainer.firstOpenProject(container_host, container_port, container_username, project_path, this.context)
}
} else if (devstar_username === this.user.getUsernameFromLocal()) {
// 如果同用户已经登录,则忽略;
// 直接打开项目
await this.remoteContainer.firstOpenProject(container_host, container_port, container_username, project_path)
await this.remoteContainer.firstOpenProject(container_host, container_port, container_username, project_path, this.context)
} else {
// 如果不是同用户,可以选择切换用户,或者不切换登录用户,直接打开容器
const selection = await vscode.window.showWarningMessage(`已登录用户:${this.user.getUsernameFromLocal()},是否切换用户?`,
@@ -57,7 +57,7 @@ export class DevStarExtension {
// 如果没有用户登录,则直接登录;
const res = await this.user.login(access_token, devstar_username)
if (res === 'ok') {
await this.remoteContainer.firstOpenProject(container_host, container_port, container_username, project_path)
await this.remoteContainer.firstOpenProject(container_host, container_port, container_username, project_path, this.context)
}
} else if (selection === 'No') {
await openProjectWithoutLogging(container_host, container_port, container_username, project_path);