This is an automated email from the ASF dual-hosted git repository. msciabarra pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/openserverless-vscode-extension.git
commit 6551d68238d313aebf97a0d77cb15c9e538ce2ed Author: William Grienti <[email protected]> AuthorDate: Mon Mar 11 11:48:37 2024 +0100 default value in api host - removed login page confirmation --- package.json | 2 +- src/extension.ts | 12 ++---------- src/login/LoginPanel.ts | 4 ++-- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index 009476a..9f2f290 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "viewsWelcome": [ { "view": "command-palette", - "contents": "\n[Devel](command:nuvolaris.devel)\n[Deploy](command:nuvolaris.deploy)\n[Change User](command:nuvolaris.changeuser)" + "contents": "\n[Devel](command:nuvolaris.devel)\n[Deploy](command:nuvolaris.deploy)\n[Login](command:nuvolaris.login)" } ] }, diff --git a/src/extension.ts b/src/extension.ts index 0e8a5ec..6bc8acd 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -1,6 +1,5 @@ import * as vscode from 'vscode'; import { NuvolarisTerminalName } from './constants'; -import { NuvolarisLoginParams } from './interfaces'; import { LoginPanel } from './login/LoginPanel'; import { CliCommands } from './enumerators'; import * as fs from "fs"; @@ -21,15 +20,8 @@ export async function activate(ctx: vscode.ExtensionContext) { } ))); - context.subscriptions.push(vscode.commands.registerCommand('nuvolaris.changeuser', () => { - let yes = "Yes"; - let no = "No"; - vscode.window.showInformationMessage("Are you sure you want to change user?", yes, no) - .then(answer => { - if (answer === yes) { + context.subscriptions.push(vscode.commands.registerCommand('nuvolaris.login', () => { LoginPanel.render(handleLogin, context.extensionUri); - } - }) })); } catch (error: any) { printError(error); @@ -42,7 +34,7 @@ function isLoggedIn() { let isLoggedIn = false; switch (os.platform().toLowerCase()) { case "linux": { - isLoggedIn = fs.existsSync("/root/.wskprops"); + isLoggedIn = fs.existsSync(os.userInfo().homedir + "/.wskprops"); break; } case "win32": { diff --git a/src/login/LoginPanel.ts b/src/login/LoginPanel.ts index d9fbf38..51ed482 100644 --- a/src/login/LoginPanel.ts +++ b/src/login/LoginPanel.ts @@ -118,8 +118,8 @@ export class LoginPanel { <form class="login-form" id="login-form"> <input type="text" id="username-input" placeholder="Username"> <input type="password" id="password-input" placeholder="Password"> - <input type="text" id="api-host-input" placeholder="API Host URL"> - <vscode-button id="login-button" type="submit" value="https://nuvolaris.dev/"> L O G I N </vscode-button> + <input type="text" id="api-host-input" placeholder="API Host URL" value="https://nuvolaris.dev/"> + <vscode-button id="login-button" type="submit" > L O G I N </vscode-button> </form> </div> <script type="module" nonce="${nonce}" src="${webviewUri}"></script>
