Swap field order between Host and User which is more logical for users

This commit is contained in:
NI
2022-05-14 20:24:49 +08:00
parent 1937aac9b0
commit de23d076c6

View File

@@ -242,30 +242,6 @@ class SSH {
}
const initialFieldDef = {
User: {
name: "User",
description: "",
type: "text",
value: "",
example: "guest",
readonly: false,
suggestions(input) {
return [];
},
verify(d) {
if (d.length <= 0) {
throw new Error("Username must be specified");
}
if (d.length > MAX_USERNAME_LEN) {
throw new Error(
"Username must not longer than " + MAX_USERNAME_LEN + " bytes"
);
}
return "We'll login as user \"" + d + '"';
},
},
Host: {
name: "Host",
description: "",
@@ -300,6 +276,30 @@ const initialFieldDef = {
return "Look like " + addr.type + " address";
},
},
User: {
name: "User",
description: "",
type: "text",
value: "",
example: "guest",
readonly: false,
suggestions(input) {
return [];
},
verify(d) {
if (d.length <= 0) {
throw new Error("Username must be specified");
}
if (d.length > MAX_USERNAME_LEN) {
throw new Error(
"Username must not longer than " + MAX_USERNAME_LEN + " bytes"
);
}
return "We'll login as user \"" + d + '"';
},
},
Encoding: {
name: "Encoding",
description: "The character encoding of the server",
@@ -766,7 +766,6 @@ class Wizard {
command.fieldsWithPreset(
initialFieldDef,
[
{ name: "User" },
{
name: "Host",
suggestions(input) {
@@ -794,6 +793,7 @@ class Wizard {
return sugg;
},
},
{ name: "User" },
{ name: "Authentication" },
{ name: "Encoding" },
{ name: "Notice" },