Skip to content

Commit

Permalink
Turned Port field into a "number" input
Browse files Browse the repository at this point in the history
Signed-off-by: Seb Julliand <[email protected]>
  • Loading branch information
sebjulliand committed Jan 5, 2025
1 parent 4f47288 commit b8f7088
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/webviews/login/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class Login {
const connectionTab = new Section()
.addInput(`name`, `Connection Name`, undefined, { minlength: 1 })
.addInput(`host`, l10n.t(`Host or IP Address`), undefined, { minlength: 1 })
.addInput(`port`, l10n.t(`Port (SSH)`), ``, { default: `22`, minlength: 1, maxlength: 5, regexTest: `^\\d+$` })
.addInput(`port`, l10n.t(`Port (SSH)`), ``, { default: `22`, min: 1, max: 65535, inputType: "number" })
.addInput(`username`, l10n.t(`Username`), undefined, { minlength: 1, maxlength: 10 })
.addHorizontalRule()
.addParagraph(l10n.t(`Only provide either the password or a private key - not both.`))
Expand Down
2 changes: 1 addition & 1 deletion src/webviews/settings/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ export class SettingsUI {
const privateKeyWarning = !privateKeyPath || existsSync(privateKeyPath) ? "" : "<b>⚠️ This private key doesn't exist on this system! ⚠️</b></br></br>";
const ui = new CustomUI()
.addInput(`host`, vscode.l10n.t(`Host or IP Address`), undefined, { default: stored.host, minlength: 1 })
.addInput(`port`, vscode.l10n.t(`Port (SSH)`), undefined, { default: String(stored.port), minlength: 1, maxlength: 5, regexTest: `^\\d+$` })
.addInput(`port`, vscode.l10n.t(`Port (SSH)`), undefined, { default: String(stored.port), min: 1, max: 65535, inputType: "number" })
.addInput(`username`, vscode.l10n.t(`Username`), undefined, { default: stored.username, minlength: 1 })
.addHorizontalRule()
.addParagraph(vscode.l10n.t(`Only provide either the password or a private key - not both.`))
Expand Down

0 comments on commit b8f7088

Please sign in to comment.