This commit is contained in:
Bruno Rybársky 2022-06-17 21:06:49 +02:00
parent 291cc2d12e
commit 9bfd6b23fc
22 changed files with 106 additions and 34 deletions

@ -10,6 +10,9 @@ function append(args, curdir) {
if (curdir[args[0]] == undefined) { if (curdir[args[0]] == undefined) {
curdir[args[0]] = ""; curdir[args[0]] = "";
} }
else {
buf += "append: file already exists\n";
}
for (var i = 1; i < args.length; i++) { for (var i = 1; i < args.length; i++) {
curdir[args[0]] += args[i] + "\n"; curdir[args[0]] += args[i] + "\n";
} }

@ -1 +1 @@
{"version":3,"file":"append.js","sourceRoot":"","sources":["append.ts"],"names":[],"mappings":";;;AAAA,SAAS,MAAM,CAAC,IAAkB,EAAE,MAAU;IAC1C,IAAI,GAAG,GAAG,EAAE,CAAC;IACb,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,EAAE;QAClB,GAAG,IAAI,2BAA2B,CAAC;KACtC;SACI;QACD,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,SAAS,EAAE;YAC9B,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;SACxB;QACD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAClC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;SACrC;KACJ;IACD,OAAO,GAAG,CAAC;AACf,CAAC;AACQ,wBAAM"} {"version":3,"file":"append.js","sourceRoot":"","sources":["append.ts"],"names":[],"mappings":";;;AAAA,SAAS,MAAM,CAAC,IAAkB,EAAE,MAAU;IAC1C,IAAI,GAAG,GAAG,EAAE,CAAC;IACb,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,EAAE;QAClB,GAAG,IAAI,2BAA2B,CAAC;KACtC;SACI;QACD,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,SAAS,EAAE;YAC9B,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;SACxB;aACI;YACD,GAAG,IAAI,+BAA+B,CAAC;SAC1C;QACD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAClC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;SACrC;KACJ;IACD,OAAO,GAAG,CAAC;AACf,CAAC;AACQ,wBAAM"}

@ -7,6 +7,9 @@ function append(args:Array<string>, curdir:any):string {
if (curdir[args[0]] == undefined) { if (curdir[args[0]] == undefined) {
curdir[args[0]] = ""; curdir[args[0]] = "";
} }
else {
buf += "append: file already exists\n";
}
for (let i = 1; i < args.length; i++) { for (let i = 1; i < args.length; i++) {
curdir[args[0]] += args[i] + "\n"; curdir[args[0]] += args[i] + "\n";
} }

@ -9,8 +9,8 @@ var clear_1 = require("./clear");
var cp_1 = require("./cp"); var cp_1 = require("./cp");
var echo_1 = require("./echo"); var echo_1 = require("./echo");
var exec_1 = require("./exec"); var exec_1 = require("./exec");
var faq_1 = require("./faq");
var help_1 = require("./help"); var help_1 = require("./help");
var loadsess_1 = require("./loadsess");
var ls_1 = require("./ls"); var ls_1 = require("./ls");
var man_1 = require("./man"); var man_1 = require("./man");
var mkdir_1 = require("./mkdir"); var mkdir_1 = require("./mkdir");
@ -19,7 +19,6 @@ var overwrite_1 = require("./overwrite");
var pwd_1 = require("./pwd"); var pwd_1 = require("./pwd");
var rm_1 = require("./rm"); var rm_1 = require("./rm");
var rmdir_1 = require("./rmdir"); var rmdir_1 = require("./rmdir");
var savesess_1 = require("./savesess");
var screenshot_1 = require("./screenshot"); var screenshot_1 = require("./screenshot");
var spam_1 = require("./spam"); var spam_1 = require("./spam");
var touch_1 = require("./touch"); var touch_1 = require("./touch");
@ -47,6 +46,9 @@ function resolveCommand(commandname, socket, args, buffer, sessions, filesystem,
case "beep": case "beep":
bufko += (0, beep_1.beep)(socket); bufko += (0, beep_1.beep)(socket);
break; break;
case "faq":
bufko += (0, faq_1.faq)();
break;
case "screenshot": case "screenshot":
bufko += (0, screenshot_1.screenshot)(args, curdir, buffer, socket); bufko += (0, screenshot_1.screenshot)(args, curdir, buffer, socket);
break; break;
@ -95,19 +97,13 @@ function resolveCommand(commandname, socket, args, buffer, sessions, filesystem,
case "clear": case "clear":
bufko += (0, clear_1.clear)(buffer[socket.id]); bufko += (0, clear_1.clear)(buffer[socket.id]);
break; break;
case "savesess":
bufko += (0, savesess_1.savesess)(args, sessions, filesystem, curdir, buffer, socket);
break;
case "loadsess":
bufko += (0, loadsess_1.loadsess)(args, sessions, filesystem[socket.id], curdir[socket.id], buffer[socket.id]);
break;
case "wee": case "wee":
bufko += (0, wee_1.wee)(); bufko += (0, wee_1.wee)();
break; break;
case "woo": case "woo":
bufko += (0, woo_1.woo)(); bufko += (0, woo_1.woo)();
break; break;
case "resendbufko": case "resendbuf":
sendbuffer(socket, buffer, true); sendbuffer(socket, buffer, true);
break; break;
case "spam": case "spam":
@ -115,6 +111,7 @@ function resolveCommand(commandname, socket, args, buffer, sessions, filesystem,
break; break;
default: default:
bufko += "Invalid command.\n"; bufko += "Invalid command.\n";
socket.emit("bell");
} }
return bufko; return bufko;
} }

@ -1 +1 @@
{"version":3,"file":"commands.js","sourceRoot":"","sources":["commands.ts"],"names":[],"mappings":";;;AACA,mCAAkC;AAClC,+BAA8B;AAC9B,6BAA4B;AAC5B,2BAA0B;AAC1B,iCAAgC;AAChC,2BAA0B;AAC1B,+BAA8B;AAC9B,+BAA8B;AAC9B,+BAA8B;AAC9B,uCAAsC;AACtC,2BAA0B;AAC1B,6BAA4B;AAC5B,iCAAgC;AAChC,2BAA0B;AAC1B,yCAAwC;AACxC,6BAA4B;AAC5B,2BAA0B;AAC1B,iCAAgC;AAChC,uCAAsC;AACtC,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AAI;YACL,KAAK,IAAI,IAAA,OAAE,EAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;YACvD,MAAM;QACV,KAAK,KAAK;YACN,KAAK,IAAI,IAAA,SAAG,EAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;YACjC,MAAM;QACV,KAAK,MAAM;YACP,KAAK,IAAI,IAAA,WAAI,EAAC,IAAI,CAAC,CAAC;YACpB,MAAM;QACV,KAAK,OAAO;YACR,KAAK,IAAI,IAAA,aAAK,EAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;YAClC,MAAM;QAOV,KAAK,KAAK;YACN,KAAK,IAAI,IAAA,SAAG,GAAE,CAAC;YACf,MAAM;QACV,KAAK,KAAK;YACN,KAAK,IAAI,IAAA,SAAG,GAAE,CAAC;YACf,MAAM;QACV,KAAK,WAAW;YACZ,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;YACjC,MAAM;QACV,KAAK,MAAM;YACX,KAAK,IAAI,IAAA,WAAI,EAAC,IAAI,CAAC,CAAC;YACpB,MAAM;QAEN;YACI,KAAK,IAAI,oBAAoB,CAAC;YAC9B,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;KAC3B;IACD,OAAO,KAAK,CAAC;AACjB,CAAC;AACO,wCAAc"}

@ -7,8 +7,9 @@ import { clear } from './clear';
import { cp } from './cp'; import { cp } from './cp';
import { echo } from './echo'; import { echo } from './echo';
import { exec } from './exec'; import { exec } from './exec';
import { faq } from './faq';
import { help } from './help'; import { help } from './help';
import { loadsess } from './loadsess'; //import { loadsess } from './loadsess';
import { ls } from './ls'; import { ls } from './ls';
import { man } from './man'; import { man } from './man';
import { mkdir } from './mkdir'; import { mkdir } from './mkdir';
@ -17,7 +18,7 @@ import { overwrite } from './overwrite';
import { pwd } from './pwd'; import { pwd } from './pwd';
import { rm } from './rm'; import { rm } from './rm';
import { rmdir } from './rmdir'; import { rmdir } from './rmdir';
import { savesess } from './savesess'; //import { savesess } from './savesess';
import { screenshot } from './screenshot'; import { screenshot } from './screenshot';
import { spam } from './spam'; import { spam } from './spam';
import { touch } from './touch'; import { touch } from './touch';
@ -47,6 +48,9 @@ function resolveCommand(commandname:string, socket:Socket, args:string[], buffer
case "beep": case "beep":
bufko += beep(socket); bufko += beep(socket);
break; break;
case "faq":
bufko += faq();
break;
case "screenshot": case "screenshot":
bufko += screenshot(args, curdir, buffer, socket); bufko += screenshot(args, curdir, buffer, socket);
break; break;
@ -95,19 +99,19 @@ function resolveCommand(commandname:string, socket:Socket, args:string[], buffer
case "clear": case "clear":
bufko += clear(buffer[socket.id]); bufko += clear(buffer[socket.id]);
break; break;
case "savesess": // case "savesess":
bufko += savesess(args, sessions, filesystem, curdir, buffer, socket); // bufko += savesess(args, sessions, filesystem, curdir, buffer, socket);
break; // break;
case "loadsess": // case "loadsess":
bufko += loadsess(args, sessions, filesystem[socket.id], curdir[socket.id], buffer[socket.id], socket); // bufko += loadsess(args, sessions, filesystem[socket.id], curdir[socket.id], buffer[socket.id], socket);
break; // break;
case "wee": case "wee":
bufko += wee(); bufko += wee();
break; break;
case "woo": case "woo":
bufko += woo(); bufko += woo();
break; break;
case "resendbufko": case "resendbuf":
sendbuffer(socket, buffer, true); sendbuffer(socket, buffer, true);
break; break;
case "spam": case "spam":
@ -116,6 +120,7 @@ function resolveCommand(commandname:string, socket:Socket, args:string[], buffer
//invalid command //invalid command
default: default:
bufko += "Invalid command.\n"; bufko += "Invalid command.\n";
socket.emit("bell");
} }
return bufko; return bufko;
} }

24
commands/faq.js Normal file

@ -0,0 +1,24 @@
"use strict";
exports.__esModule = true;
exports.faq = void 0;
function faq() {
var buf = "";
buf += "FAQ:\n";
buf += "1. Why if you use path with \'/\' or with \'..\' the command does not process it?\n";
buf += "Because the commands don 't use unix like paths, they take literally what filename you give them and create a file with it.\n";
buf += "2. Then, why does \'pwd\' output path with \'/\'s?\n";
buf += "Because otherwise it\'s output would be unreadable and also it is the only command that uses unix like paths.\n";
buf += "3. Why don\'t arrows work?\n";
buf += "Because they are not supported by the console and I didn\'t spend time to detect them in the client.\n";
buf += "4. Why is this console so primitive?\n";
buf += "Because I didn\'t spend time to make it more complex.\n";
buf += "5. Is it open source?\n";
buf += "Yes, it is open source, \"https://brn.systems:3000/BRNSystems/CliSite\".\n";
buf += "6. Why did you create the console?\n";
buf += "Because I like sitting at my computer and typing commands.\n";
buf += "7. Why is this FAQ so long?\n";
buf += "Because I made it so long.\n";
return buf;
}
exports.faq = faq;
//# sourceMappingURL=faq.js.map

1
commands/faq.js.map Normal file

@ -0,0 +1 @@
{"version":3,"file":"faq.js","sourceRoot":"","sources":["faq.ts"],"names":[],"mappings":";;;AAAA,SAAS,GAAG;IACR,IAAI,GAAG,GAAG,EAAE,CAAC;IACb,GAAG,IAAI,QAAQ,CAAC;IAChB,GAAG,IAAI,qFAAqF,CAAC;IAC7F,GAAG,IAAI,+HAA+H,CAAC;IACvI,GAAG,IAAI,sDAAsD,CAAC;IAC9D,GAAG,IAAI,iHAAiH,CAAC;IACzH,GAAG,IAAI,8BAA8B,CAAC;IACtC,GAAG,IAAI,wGAAwG,CAAC;IAChH,GAAG,IAAI,wCAAwC,CAAC;IAChD,GAAG,IAAI,yDAAyD,CAAC;IACjE,GAAG,IAAI,yBAAyB,CAAC;IACjC,GAAG,IAAI,4EAA4E,CAAC;IACpF,GAAG,IAAI,sCAAsC,CAAC;IAC9C,GAAG,IAAI,8DAA8D,CAAC;IACtE,GAAG,IAAI,+BAA+B,CAAC;IACvC,GAAG,IAAI,8BAA8B,CAAC;IACtC,OAAO,GAAG,CAAC;AACf,CAAC;AACO,kBAAG"}

20
commands/faq.ts Normal file

@ -0,0 +1,20 @@
function faq(): string {
var buf = "";
buf += "FAQ:\n";
buf += "1. Why if you use path with \'/\' or with \'..\' the command does not process it?\n";
buf += "Because the commands don 't use unix like paths, they take literally what filename you give them and create a file with it.\n";
buf += "2. Then, why does \'pwd\' output path with \'/\'s?\n";
buf += "Because otherwise it\'s output would be unreadable and also it is the only command that uses unix like paths.\n";
buf += "3. Why don\'t arrows work?\n";
buf += "Because they are not supported by the console and I didn\'t spend time to detect them in the client.\n";
buf += "4. Why is this console so primitive?\n";
buf += "Because I didn\'t spend time to make it more complex.\n";
buf += "5. Is it open source?\n";
buf += "Yes, it is open source, \"https://brn.systems:3000/BRNSystems/CliSite\".\n";
buf += "6. Why did you create the console?\n";
buf += "Because I like sitting at my computer and typing commands.\n";
buf += "7. Why is this FAQ so long?\n";
buf += "Because I made it so long.\n";
return buf;
}
export {faq};

@ -14,6 +14,7 @@ function help() {
buf += "touch - creates a new file\n"; buf += "touch - creates a new file\n";
buf += "rm - removes a file\n"; buf += "rm - removes a file\n";
buf += "mv - moves a file\n"; buf += "mv - moves a file\n";
buf += "faq - displays FAQ\n";
buf += "cp - copies a file\n"; buf += "cp - copies a file\n";
buf += "rmdir - removes a directory\n"; buf += "rmdir - removes a directory\n";
buf += "pwd - prints the current directory\n"; buf += "pwd - prints the current directory\n";

@ -1 +1 @@
{"version":3,"file":"help.js","sourceRoot":"","sources":["help.ts"],"names":[],"mappings":";;;AAAA,SAAS,IAAI;IACT,IAAI,GAAG,GAAG,EAAE,CAAC;IACb,GAAG,IAAI,uBAAuB,CAAC;IAC/B,GAAG,IAAI,0BAA0B,CAAC;IAClC,GAAG,IAAI,8BAA8B,CAAC;IACtC,GAAG,IAAI,iDAAiD,CAAC;IACzD,GAAG,IAAI,sCAAsC,CAAC;IAC9C,GAAG,IAAI,+BAA+B,CAAC;IACvC,GAAG,IAAI,mCAAmC,CAAC;IAC3C,GAAG,IAAI,uCAAuC,CAAC;IAC/C,GAAG,IAAI,8BAA8B,CAAC;IACtC,GAAG,IAAI,uBAAuB,CAAC;IAC/B,GAAG,IAAI,qBAAqB,CAAC;IAC7B,GAAG,IAAI,sBAAsB,CAAC;IAC9B,GAAG,IAAI,+BAA+B,CAAC;IACvC,GAAG,IAAI,sCAAsC,CAAC;IAC9C,GAAG,IAAI,0BAA0B,CAAC;IAClC,GAAG,IAAI,4BAA4B,CAAC;IACpC,GAAG,IAAI,6CAA6C,CAAC;IACrD,GAAG,IAAI,4CAA4C,CAAC;IACpD,GAAG,IAAI,mCAAmC,CAAC;IAC3C,GAAG,IAAI,uBAAuB,CAAC;IAC/B,GAAG,IAAI,6BAA6B,CAAC;IACrC,OAAO,GAAG,CAAC;AACf,CAAC;AACO,oBAAI"} {"version":3,"file":"help.js","sourceRoot":"","sources":["help.ts"],"names":[],"mappings":";;;AAAA,SAAS,IAAI;IACT,IAAI,GAAG,GAAG,EAAE,CAAC;IACb,GAAG,IAAI,uBAAuB,CAAC;IAC/B,GAAG,IAAI,0BAA0B,CAAC;IAClC,GAAG,IAAI,8BAA8B,CAAC;IACtC,GAAG,IAAI,iDAAiD,CAAC;IACzD,GAAG,IAAI,sCAAsC,CAAC;IAC9C,GAAG,IAAI,+BAA+B,CAAC;IACvC,GAAG,IAAI,mCAAmC,CAAC;IAC3C,GAAG,IAAI,uCAAuC,CAAC;IAC/C,GAAG,IAAI,8BAA8B,CAAC;IACtC,GAAG,IAAI,uBAAuB,CAAC;IAC/B,GAAG,IAAI,qBAAqB,CAAC;IAC7B,GAAG,IAAI,sBAAsB,CAAC;IAC9B,GAAG,IAAI,sBAAsB,CAAC;IAC9B,GAAG,IAAI,+BAA+B,CAAC;IACvC,GAAG,IAAI,sCAAsC,CAAC;IAC9C,GAAG,IAAI,0BAA0B,CAAC;IAClC,GAAG,IAAI,4BAA4B,CAAC;IACpC,GAAG,IAAI,6CAA6C,CAAC;IACrD,GAAG,IAAI,4CAA4C,CAAC;IACpD,GAAG,IAAI,mCAAmC,CAAC;IAC3C,GAAG,IAAI,uBAAuB,CAAC;IAC/B,GAAG,IAAI,6BAA6B,CAAC;IACrC,OAAO,GAAG,CAAC;AACf,CAAC;AACO,oBAAI"}

@ -11,6 +11,7 @@ function help(): string {
buf += "touch - creates a new file\n"; buf += "touch - creates a new file\n";
buf += "rm - removes a file\n"; buf += "rm - removes a file\n";
buf += "mv - moves a file\n"; buf += "mv - moves a file\n";
buf += "faq - displays FAQ\n";
buf += "cp - copies a file\n"; buf += "cp - copies a file\n";
buf += "rmdir - removes a directory\n"; buf += "rmdir - removes a directory\n";
buf += "pwd - prints the current directory\n"; buf += "pwd - prints the current directory\n";

@ -13,6 +13,8 @@ function man(args) {
case "clear": case "clear":
buf += "\'clear\' Clears the console\n"; buf += "\'clear\' Clears the console\n";
break; break;
case "faq":
buf += "\'faq\' Prints answers to commonly asked questions about the console\n";
case "ls": case "ls":
buf += "\'ls\' Lists the files in the current directory, also displays if file or directory\n"; buf += "\'ls\' Lists the files in the current directory, also displays if file or directory\n";
break; break;

@ -1 +1 @@
{"version":3,"file":"man.js","sourceRoot":"","sources":["man.ts"],"names":[],"mappings":";;;AAAA,SAAS,GAAG,CAAC,IAAmB;IAC5B,IAAI,GAAG,GAAG,EAAE,CAAC;IACb,IAAG,IAAI,CAAC,MAAM,IAAI,CAAC,EAAC;QAChB,GAAG,IAAI,mBAAmB,CAAA;KAC7B;IACD,QAAQ,IAAI,CAAC,CAAC,CAAC,EAAC;QACZ,KAAK,MAAM;YACP,GAAG,IAAI,kDAAkD,CAAC;YAC1D,MAAM;QACV,KAAK,OAAO;YACR,GAAG,IAAI,gCAAgC,CAAC;YACxC,MAAM;QACV,KAAK,IAAI;YACL,GAAG,IAAI,uFAAuF,CAAC;YAC/F,MAAM;QACV,KAAK,IAAI;YACL,GAAG,IAAI,qDAAqD,CAAC;YAC7D,MAAM;QACV,KAAK,MAAM;YACP,GAAG,IAAI,oEAAoE,CAAC;YAC5E,MAAM;QACV,KAAK,OAAO;YACR,GAAG,IAAI,wEAAwE,CAAC;YAChF,MAAM;QACV,KAAK,KAAK;YACN,GAAG,IAAI,uEAAuE,CAAC;YAC/E,MAAM;QACV,KAAK,OAAO;YACR,GAAG,IAAI,oEAAoE,CAAC;YAC5E,MAAM;QAC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):string{
case "clear": case "clear":
buf += "\'clear\' Clears the console\n"; buf += "\'clear\' Clears the console\n";
break; break;
case "faq":
buf += "\'faq\' Prints answers to commonly asked questions about the console\n";
case "ls": case "ls":
buf += "\'ls\' Lists the files in the current directory, also displays if file or directory\n"; buf += "\'ls\' Lists the files in the current directory, also displays if file or directory\n";
break; break;

@ -4,7 +4,10 @@ exports.pwd = void 0;
function pwd(curdirx) { function pwd(curdirx) {
var buf = ""; var buf = "";
var curdirasstring = curdirx.join("/"); var curdirasstring = curdirx.join("/");
buf += "Current directory: " + curdirasstring + "\n"; if (curdirx.length > 0) {
curdirasstring = curdirasstring + "/";
}
buf += "Current directory: /" + curdirasstring + "\n";
return buf; return buf;
} }
exports.pwd = pwd; exports.pwd = pwd;

@ -1 +1 @@
{"version":3,"file":"pwd.js","sourceRoot":"","sources":["pwd.ts"],"names":[],"mappings":";;;AAAA,SAAS,GAAG,CAAC,OAAqB;IAC9B,IAAI,GAAG,GAAG,EAAE,CAAC;IACb,IAAI,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACvC,GAAG,IAAI,qBAAqB,GAAG,cAAc,GAAG,IAAI,CAAC;IACrD,OAAO,GAAG,CAAC;AACf,CAAC;AACQ,kBAAG"} {"version":3,"file":"pwd.js","sourceRoot":"","sources":["pwd.ts"],"names":[],"mappings":";;;AAAA,SAAS,GAAG,CAAC,OAAqB;IAC9B,IAAI,GAAG,GAAG,EAAE,CAAC;IACb,IAAI,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACvC,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE;QACpB,cAAc,GAAG,cAAc,GAAG,GAAG,CAAC;KACzC;IACD,GAAG,IAAI,sBAAsB,GAAG,cAAc,GAAG,IAAI,CAAC;IACtD,OAAO,GAAG,CAAC;AACf,CAAC;AACQ,kBAAG"}

@ -1,7 +1,10 @@
function pwd(curdirx:Array<string>):string { function pwd(curdirx:Array<string>):string {
var buf = ""; var buf = "";
var curdirasstring = curdirx.join("/"); var curdirasstring = curdirx.join("/");
buf += "Current directory: " + curdirasstring + "\n"; if (curdirx.length > 0) {
curdirasstring = curdirasstring + "/";
}
buf += "Current directory: /" + curdirasstring + "\n";
return buf; return buf;
} }
export { pwd }; export { pwd };

@ -71,7 +71,7 @@ io.on('connection', function (socket) {
var bufko = "\n" + (0, commands_1.resolveCommand)(commandName, socket, commandArgs, buffer, sessions, filesystem, curdir, curdirx); var bufko = "\n" + (0, commands_1.resolveCommand)(commandName, socket, commandArgs, buffer, sessions, filesystem, curdir, curdirx);
console.log("This command \"" + commandName + "\" with args:\"" + commandArgs + "\" returned \"" + bufko + "\""); console.log("This command \"" + commandName + "\" with args:\"" + commandArgs + "\" returned \"" + bufko + "\"");
bufko += "#"; bufko += "#";
socket.emit("bufferx", bufko + '\u2588'); socket.emit("bufferx", "\n" + bufko + '\u2588');
buffer[socket.id] += bufko; buffer[socket.id] += bufko;
} }
else { else {

@ -1 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;AACA,IAAI,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAC3B,IAAI,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;AAEjC,IAAI,GAAG,GAAG,OAAO,EAAE,CAAC;AACpB,IAAI,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;AACpC,IAAI,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC;AAC5B,IAAA,MAAM,GAAK,OAAO,CAAC,WAAW,CAAC,OAAzB,CAA0B;AAExC,IAAM,EAAE,GAAG,IAAI,MAAM,CAAC,MAAM,CAAC,CAAC;AAE9B,gDAAqD;AAErD,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,UAAC,GAAW,EAAE,GAAY;IACnC,GAAG,CAAC,QAAQ,CAAC,SAAS,GAAG,qBAAq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AC;AACP,CAAC,CAAC,CAAC;AACH,EAAE,CAAC,EAAE,CAAC,YAAY,EAAE,UAAC,MAAa;IAC9B,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;IACjC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC;AAC3B,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE;IAChB,OAAO,CAAC,GAAG,CAAC,6BAA6B,EAAE,IAAI,CAAC,CAAC;AACrD,CAAC,CAAC,CAAC"}

@ -68,8 +68,6 @@ io.on('connection', (socket:Socket) => {
//convert key to lowercase //convert key to lowercase
key = key.toLowerCase(); key = key.toLowerCase();
console.log(data); console.log(data);
//check if key is printable character or digit or . or space etc
//check if key is enter //check if key is enter
if (data == 8){ if (data == 8){
//backspace //backspace
@ -103,7 +101,7 @@ io.on('connection', (socket:Socket) => {
var bufko = "\n" + resolveCommand(commandName, socket, commandArgs, buffer, sessions, filesystem, curdir, curdirx); var bufko = "\n" + resolveCommand(commandName, socket, commandArgs, buffer, sessions, filesystem, curdir, curdirx);
console.log("This command \""+ commandName +"\" with args:\""+commandArgs+"\" returned \""+bufko+"\""); console.log("This command \""+ commandName +"\" with args:\""+commandArgs+"\" returned \""+bufko+"\"");
bufko += "#"; bufko += "#";
socket.emit("bufferx", bufko+ '\u2588'); socket.emit("bufferx", "\n" + bufko+ '\u2588');
buffer[socket.id] += bufko; buffer[socket.id] += bufko;
} }
else{ else{

@ -50,7 +50,16 @@ $(document).ready(function(){
//$('#console').css('height', $(window).height() - $('#console').offset().top - 10); //$('#console').css('height', $(window).height() - $('#console').offset().top - 10);
//account for the input box //account for the input box
$("#console").focus(); $("#console").focus();
let host = 'wss://console.brn.systems:443'; //if connection is https, then use wss://
if(window.location.protocol == "https:"){
var ws_scheme = "wss://";
}
else{
var ws_scheme = "ws://";
}
//set host to ws_scheme + hostname + port
var host = ws_scheme + window.location.hostname + ":" + window.location.port;
console.log("connecting to " + host);
var socket = io.connect(host); var socket = io.connect(host);
resizeit(); resizeit();
//resize it on window resize //resize it on window resize
@ -84,11 +93,11 @@ $(document).ready(function(){
//connect to the server //connect to the server
//on connect //on connect
socket.on('connect', function () { socket.on('connect', function () {
setareacontent("Connected to server"); addareacontent("Connected to server");
}); });
//on disconnect //on disconnect
socket.on('disconnect', function () { socket.on('disconnect', function () {
setareacontent("Disconnected from server"); addareacontent("Disconnected from server");
}); });
//on error //on error
socket.on('error', function (err) { socket.on('error', function (err) {