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 = { 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: { Host: {
name: "Host", name: "Host",
description: "", description: "",
@@ -300,6 +276,30 @@ const initialFieldDef = {
return "Look like " + addr.type + " address"; 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: { Encoding: {
name: "Encoding", name: "Encoding",
description: "The character encoding of the server", description: "The character encoding of the server",
@@ -766,7 +766,6 @@ class Wizard {
command.fieldsWithPreset( command.fieldsWithPreset(
initialFieldDef, initialFieldDef,
[ [
{ name: "User" },
{ {
name: "Host", name: "Host",
suggestions(input) { suggestions(input) {
@@ -794,6 +793,7 @@ class Wizard {
return sugg; return sugg;
}, },
}, },
{ name: "User" },
{ name: "Authentication" }, { name: "Authentication" },
{ name: "Encoding" }, { name: "Encoding" },
{ name: "Notice" }, { name: "Notice" },