Reformat code

This commit is contained in:
NI
2020-11-14 22:53:21 +08:00
parent ffdab9f037
commit 530570abc0
3 changed files with 39 additions and 39 deletions

View File

@@ -138,7 +138,7 @@ const defField = {
}, },
verify(v) { verify(v) {
return ""; return "";
} },
}; };
/** /**
@@ -264,7 +264,7 @@ class Prompt {
this.f[data.inputs[i].name.toLowerCase()] = { this.f[data.inputs[i].name.toLowerCase()] = {
value: f.value, value: f.value,
verify: f.verify verify: f.verify,
}; };
} }
} }
@@ -376,7 +376,7 @@ function next(type, data) {
}, },
data() { data() {
return data; return data;
} },
}; };
} }
@@ -396,7 +396,7 @@ export function done(success, successData, errorTitle, errorMessage) {
success: success, success: success,
successData: successData, successData: successData,
errorTitle: errorTitle, errorTitle: errorTitle,
errorMessage: errorMessage errorMessage: errorMessage,
}); });
} }
@@ -412,7 +412,7 @@ export function done(success, successData, errorTitle, errorMessage) {
export function wait(title, message) { export function wait(title, message) {
return next(NEXT_WAIT, { return next(NEXT_WAIT, {
title: title, title: title,
message: message message: message,
}); });
} }
@@ -436,7 +436,7 @@ export function prompt(title, message, actionText, respond, cancel, inputs) {
actionText: actionText, actionText: actionText,
inputs: inputs, inputs: inputs,
respond: respond, respond: respond,
cancel: cancel cancel: cancel,
}); });
} }
@@ -617,7 +617,7 @@ class Builder {
*/ */
constructor(command) { constructor(command) {
this.cid = command.id(); this.cid = command.id();
this.represeter = n => { this.represeter = (n) => {
return command.represet(n); return command.represet(n);
}; };
this.wizarder = (n, i, r, u, y, x, l) => { this.wizarder = (n, i, r, u, y, x, l) => {
@@ -629,7 +629,7 @@ class Builder {
this.launchCmd = (n, i, r, u, y, x) => { this.launchCmd = (n, i, r, u, y, x) => {
return command.launch(n, i, r, u, y, x); return command.launch(n, i, r, u, y, x);
}; };
this.launcherCmd = c => { this.launcherCmd = (c) => {
return command.launcher(c); return command.launcher(c);
}; };
this.type = command.name(); this.type = command.name();

View File

@@ -60,7 +60,7 @@ class Telnet {
"connect.succeed", "connect.succeed",
"@inband", "@inband",
"close", "close",
"@completed" "@completed",
], ],
callbacks callbacks
); );
@@ -214,7 +214,7 @@ const initialFieldDef = {
} }
return "Look like " + addr.type + " address"; return "Look like " + addr.type + " address";
} },
}, },
Encoding: { Encoding: {
name: "Encoding", name: "Encoding",
@@ -236,8 +236,8 @@ const initialFieldDef = {
} }
throw new Error('The character encoding "' + d + '" is not supported'); throw new Error('The character encoding "' + d + '" is not supported');
} },
} },
}; };
class Wizard { class Wizard {
@@ -324,7 +324,7 @@ class Wizard {
let parsedConfig = { let parsedConfig = {
host: address.parseHostPort(configInput.host, DEFAULT_PORT), host: address.parseHostPort(configInput.host, DEFAULT_PORT),
charset: configInput.charset charset: configInput.charset,
}; };
return new Telnet(sender, parsedConfig, { return new Telnet(sender, parsedConfig, {
@@ -362,7 +362,7 @@ class Wizard {
close() { close() {
return commandHandler.sendClose(); return commandHandler.sendClose();
}, },
events: commandHandler.events events: commandHandler.events,
}), }),
self.controls.ui() self.controls.ui()
) )
@@ -386,7 +386,7 @@ class Wizard {
}, },
"@inband"(rd) {}, "@inband"(rd) {},
close() {}, close() {},
"@completed"() {} "@completed"() {},
}); });
} }
@@ -397,15 +397,15 @@ class Wizard {
"Telnet", "Telnet",
"Teletype Network", "Teletype Network",
"Connect", "Connect",
r => { (r) => {
self.hasStarted = true; self.hasStarted = true;
self.streams.request(COMMAND_ID, sd => { self.streams.request(COMMAND_ID, (sd) => {
return self.buildCommand( return self.buildCommand(
sd, sd,
{ {
host: r.host, host: r.host,
charset: r.encoding charset: r.encoding,
}, },
self.session self.session
); );
@@ -434,15 +434,15 @@ class Wizard {
title: hosts[i].title, title: hosts[i].title,
value: hosts[i].data.host, value: hosts[i].data.host,
meta: { meta: {
Encoding: hosts[i].data.charset Encoding: hosts[i].data.charset,
} },
}); });
} }
return sugg; return sugg;
}
}, },
{ name: "Encoding" } },
{ name: "Encoding" },
], ],
self.preset self.preset
) )
@@ -482,12 +482,12 @@ class Executor extends Wizard {
self.hasStarted = true; self.hasStarted = true;
self.streams.request(COMMAND_ID, sd => { self.streams.request(COMMAND_ID, (sd) => {
return self.buildCommand( return self.buildCommand(
sd, sd,
{ {
host: self.config.host, host: self.config.host,
charset: self.config.charset ? self.config.charset : "utf-8" charset: self.config.charset ? self.config.charset : "utf-8",
}, },
self.session self.session
); );
@@ -566,7 +566,7 @@ export class Command {
info, info,
{ {
host: d[0], host: d[0],
charset: charset charset: charset,
}, },
null, null,
streams, streams,

View File

@@ -83,7 +83,7 @@
v-if="presets.length > 0" v-if="presets.length > 0"
id="connect-known-list-presets" id="connect-known-list-presets"
:class="{ :class="{
'last-planel': knownList.length > 0 'last-planel': knownList.length > 0,
}" }"
> >
<h3>Presets</h3> <h3>Presets</h3>
@@ -134,34 +134,34 @@ export default {
props: { props: {
presets: { presets: {
type: Array, type: Array,
default: () => [] default: () => [],
}, },
restrictedToPresets: { restrictedToPresets: {
type: Boolean, type: Boolean,
default: () => false default: () => false,
}, },
knowns: { knowns: {
type: Array, type: Array,
default: () => [] default: () => [],
}, },
launcherBuilder: { launcherBuilder: {
type: Function, type: Function,
default: () => [] default: () => [],
}, },
knownsExport: { knownsExport: {
type: Function, type: Function,
default: () => [] default: () => [],
}, },
knownsImport: { knownsImport: {
type: Function, type: Function,
default: () => [] default: () => [],
} },
}, },
data() { data() {
return { return {
knownList: [], knownList: [],
reloaded: false, reloaded: false,
busy: false busy: false,
}; };
}, },
watch: { watch: {
@@ -182,7 +182,7 @@ export default {
setTimeout(() => { setTimeout(() => {
self.reloaded = false; self.reloaded = false;
}, 500); }, 500);
} },
}, },
mounted() { mounted() {
this.reload(this.knowns); this.reload(this.knowns);
@@ -195,7 +195,7 @@ export default {
this.knownList.unshift({ this.knownList.unshift({
data: knownList[i], data: knownList[i],
copying: false, copying: false,
copyStatus: "Copy link" copyStatus: "Copy link",
}); });
} }
}, },
@@ -312,7 +312,7 @@ export default {
"overflow: hidden; opacity: 0; width: 1px; height: 1px; top: -1px;" + "overflow: hidden; opacity: 0; width: 1px; height: 1px; top: -1px;" +
"left: -1px; position: absolute;" "left: -1px; position: absolute;"
); );
el.addEventListener("change", ev => { el.addEventListener("change", (ev) => {
const t = ev.target; const t = ev.target;
if (t.files.length <= 0) { if (t.files.length <= 0) {
@@ -346,7 +346,7 @@ export default {
} }
document.body.removeChild(el); document.body.removeChild(el);
} },
} },
}; };
</script> </script>