removed some console logs
This commit is contained in:
@@ -2,13 +2,11 @@ function ls (req, res, dir, fs) {
|
|||||||
dir = dir.startsWith('/') ? dir : '/' + dir;
|
dir = dir.startsWith('/') ? dir : '/' + dir;
|
||||||
dir = dir.endsWith('/') ? dir : dir + '/';
|
dir = dir.endsWith('/') ? dir : dir + '/';
|
||||||
|
|
||||||
console.log(dir);
|
|
||||||
|
|
||||||
const contents = fs[dir];
|
const contents = fs[dir];
|
||||||
|
|
||||||
if (contents && typeof contents === 'object') {
|
if (contents && typeof contents === 'object') {
|
||||||
let keys = Object.keys(contents)
|
let keys = Object.keys(contents)
|
||||||
console.log(keys);
|
|
||||||
res.json({"response": keys.join(" "), "command": "ls"});
|
res.json({"response": keys.join(" "), "command": "ls"});
|
||||||
} else {
|
} else {
|
||||||
res.json({"response": "No Files Found!", "command": "ls"});
|
res.json({"response": "No Files Found!", "command": "ls"});
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ async function sendCommand(e){
|
|||||||
|
|
||||||
if (command.startsWith("cd")){
|
if (command.startsWith("cd")){
|
||||||
let commandSplit = command.split(" ");
|
let commandSplit = command.split(" ");
|
||||||
console.log(commandSplit)
|
|
||||||
try {
|
try {
|
||||||
if (commandSplit[1].startsWith("/")){
|
if (commandSplit[1].startsWith("/")){
|
||||||
currentFolder = commandSplit[1];
|
currentFolder = commandSplit[1];
|
||||||
@@ -59,9 +58,6 @@ async function sendCommand(e){
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
console.log("COMMAND SENT: "+command);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Construct the URL with the command parameter in the query string
|
// Construct the URL with the command parameter in the query string
|
||||||
const url = "/execute?command=" + encodeURIComponent(command) + "¤tDir=" + encodeURIComponent(currentFolder);
|
const url = "/execute?command=" + encodeURIComponent(command) + "¤tDir=" + encodeURIComponent(currentFolder);
|
||||||
@@ -101,7 +97,6 @@ function deactivateAllStuff() {
|
|||||||
input.disabled = true;
|
input.disabled = true;
|
||||||
input.setAttribute("id", "");
|
input.setAttribute("id", "");
|
||||||
|
|
||||||
console.log("deactivated inputs");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -116,7 +111,6 @@ function handleExecutionResponse(response) {
|
|||||||
|
|
||||||
commandResponse.appendChild(textElement)
|
commandResponse.appendChild(textElement)
|
||||||
terminalContainer.appendChild(commandResponse);
|
terminalContainer.appendChild(commandResponse);
|
||||||
console.log("created response element")
|
|
||||||
|
|
||||||
|
|
||||||
//create new terminal line.
|
//create new terminal line.
|
||||||
|
|||||||
@@ -35,8 +35,6 @@ app.get("/execute", (req, res)=> {
|
|||||||
|
|
||||||
const currentDir = req.query.currentDir
|
const currentDir = req.query.currentDir
|
||||||
|
|
||||||
console.log(`Executed Command: ${formatted_command}`);
|
|
||||||
|
|
||||||
if (formatted_command.startsWith("ls")){
|
if (formatted_command.startsWith("ls")){
|
||||||
commands.ls(req, res, currentDir, fileSystem);
|
commands.ls(req, res, currentDir, fileSystem);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user