added some more commands
This commit is contained in:
@@ -11,17 +11,20 @@ async function sendCommand(e){
|
||||
const command = e.target.value;
|
||||
deactivateAllStuff();
|
||||
|
||||
if (command == "clear"){
|
||||
if (command.trim() == "clear"){
|
||||
lines = document.querySelectorAll(".terminalLine").forEach((line)=>{
|
||||
line.remove();
|
||||
})
|
||||
createNewTerminalLine();
|
||||
return;
|
||||
}
|
||||
else if (command.trim() == "logout" || command.trim() == "exit"){
|
||||
window.location.href = "https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&cad=rja&uact=8&ved=2ahUKEwj2jve6z_iDAxWb9rsIHflPD_sQwqsBegQIDxAF&url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DdQw4w9WgXcQ&usg=AOvVaw0aHtehaphMhOCAkCydRLZU&opi=89978449"
|
||||
}
|
||||
|
||||
try {
|
||||
// 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);
|
||||
|
||||
// Make a GET request using the fetch API
|
||||
const response = await fetch(url);
|
||||
@@ -96,11 +99,14 @@ function createNewTerminalLine(){
|
||||
pathColon.innerHTML = ":";
|
||||
pathColon.classList.add("pathColon");
|
||||
|
||||
|
||||
let pathPath = document.createElement("h4");
|
||||
pathPath.innerHTML = "~"+currentFolder;
|
||||
pathPath.classList.add("pathPath");
|
||||
|
||||
fetch('/currentDir')
|
||||
.then(response => response.text())
|
||||
.then(data => {
|
||||
pathPath.innerHTML = "~"+data;
|
||||
pathPath.classList.add("pathPath");
|
||||
})
|
||||
.catch(error => console.error('Error:', error));
|
||||
|
||||
let pathDollar = document.createElement("h4");
|
||||
pathDollar.innerHTML = "$";
|
||||
|
||||
Reference in New Issue
Block a user