mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
chore: lint
This commit is contained in:
parent
e99d084728
commit
af77eeed8d
14 changed files with 143 additions and 91 deletions
|
|
@ -6,22 +6,22 @@ const repl = require('node:repl');
|
|||
|
||||
module.exports = net
|
||||
.createServer((socket) => {
|
||||
const {pid} = process;
|
||||
const addr = socket.remoteAddress;
|
||||
const port = socket.remotePort;
|
||||
|
||||
const r = repl.start({
|
||||
prompt: `[${pid} ${addr}:${port}>`,
|
||||
input: socket,
|
||||
output: socket,
|
||||
terminal: true,
|
||||
useGlobal: false,
|
||||
});
|
||||
|
||||
r.on('exit', () => {
|
||||
socket.end();
|
||||
});
|
||||
|
||||
r.context.socket = socket;
|
||||
})
|
||||
const {pid} = process;
|
||||
const addr = socket.remoteAddress;
|
||||
const port = socket.remotePort;
|
||||
|
||||
const r = repl.start({
|
||||
prompt: `[${pid} ${addr}:${port}>`,
|
||||
input: socket,
|
||||
output: socket,
|
||||
terminal: true,
|
||||
useGlobal: false,
|
||||
});
|
||||
|
||||
r.on('exit', () => {
|
||||
socket.end();
|
||||
});
|
||||
|
||||
r.context.socket = socket;
|
||||
})
|
||||
.listen(1337);
|
||||
|
|
|
|||
|
|
@ -11,9 +11,9 @@ module.exports = (config) => {
|
|||
const data = Object
|
||||
.keys(config)
|
||||
.map((name) => [
|
||||
name,
|
||||
config[name],
|
||||
]);
|
||||
name,
|
||||
config[name],
|
||||
]);
|
||||
|
||||
if (!data.length)
|
||||
return '';
|
||||
|
|
|
|||
|
|
@ -74,10 +74,10 @@ async function onGET({req, res, menuName, readFile}) {
|
|||
function getError(error, source) {
|
||||
return montag`
|
||||
const e = Error(\`<pre>${codeframe({
|
||||
error,
|
||||
source,
|
||||
highlightCode: false,
|
||||
})}</pre>\`);
|
||||
error,
|
||||
source,
|
||||
highlightCode: false,
|
||||
})}</pre>\`);
|
||||
|
||||
e.code = 'frame';
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue