|
|
@ -2,11 +2,7 @@ let commands = [
|
|
|
|
{
|
|
|
|
{
|
|
|
|
name: "unknown",
|
|
|
|
name: "unknown",
|
|
|
|
output:[
|
|
|
|
output:[
|
|
|
|
{
|
|
|
|
{color: "white", content: "\nthe command you entered is undefined!\n\n", delay: 100},
|
|
|
|
color: "white",
|
|
|
|
|
|
|
|
content: "\nthe command you entered is undefined!\n",
|
|
|
|
|
|
|
|
delay: 100
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
color: "white",
|
|
|
|
color: "white",
|
|
|
|
content:
|
|
|
|
content:
|
|
|
@ -25,11 +21,7 @@ let commands = [
|
|
|
|
{
|
|
|
|
{
|
|
|
|
name: "welcome",
|
|
|
|
name: "welcome",
|
|
|
|
output:[
|
|
|
|
output:[
|
|
|
|
{
|
|
|
|
{color: "white", content: "\nWelcome to:\n", delay: 100},
|
|
|
|
color: "white",
|
|
|
|
|
|
|
|
content: "\nWelcome to:\n",
|
|
|
|
|
|
|
|
delay: 100
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
color: "green",
|
|
|
|
color: "green",
|
|
|
|
content:
|
|
|
|
content:
|
|
|
@ -42,7 +34,7 @@ let commands = [
|
|
|
|
" \\/____/\\/___/\\ \\___/ \\/_/ \\/____/\\/_/ \\/__//___/ \\/_/\\/_/ \\/_/\\/_/\n" +
|
|
|
|
" \\/____/\\/___/\\ \\___/ \\/_/ \\/____/\\/_/ \\/__//___/ \\/_/\\/_/ \\/_/\\/_/\n" +
|
|
|
|
" /\\___/\n" +
|
|
|
|
" /\\___/\n" +
|
|
|
|
" \\/__/ @adb.sh\n\n",
|
|
|
|
" \\/__/ @adb.sh\n\n",
|
|
|
|
delay: 200
|
|
|
|
delay: 300
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
color: "white",
|
|
|
|
color: "white",
|
|
|
@ -55,25 +47,75 @@ let commands = [
|
|
|
|
" - Etherpad > ether\n" +
|
|
|
|
" - Etherpad > ether\n" +
|
|
|
|
" - short url > surl\n" +
|
|
|
|
" - short url > surl\n" +
|
|
|
|
" - Jitsi > meet\n",
|
|
|
|
" - Jitsi > meet\n",
|
|
|
|
delay: 300
|
|
|
|
delay: 500
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
]
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
name: "social",
|
|
|
|
name: ["ls", "la", "list"],
|
|
|
|
output:[
|
|
|
|
output:[
|
|
|
|
|
|
|
|
{color: "white", content: "social ", delay: 100},
|
|
|
|
|
|
|
|
{color: "white", content: "git ", delay: 200},
|
|
|
|
|
|
|
|
{color: "white", content: "element ", delay: 300},
|
|
|
|
|
|
|
|
{color: "white", content: "ether ", delay: 350},
|
|
|
|
|
|
|
|
{color: "white", content: "surl ", delay: 400},
|
|
|
|
|
|
|
|
{color: "white", content: "meet", delay: 500},
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
color: "blue",
|
|
|
|
name: ["social", "mastodon", "Mastodon", "mstdn"],
|
|
|
|
content: "\nsocial",
|
|
|
|
output:[
|
|
|
|
delay: 100
|
|
|
|
{color: "blue", content: "\nMastodon", delay: 100},
|
|
|
|
|
|
|
|
{color: "white", content: " is loading\n", delay: 200},
|
|
|
|
|
|
|
|
{color: "white", content: "forwarding", delay: 400},
|
|
|
|
|
|
|
|
{color: "white", content: " ...", forward: "https://social.cybre.town", delay: 600}
|
|
|
|
|
|
|
|
]
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
color: "white",
|
|
|
|
name: ["git", "gitea", "Gitea"],
|
|
|
|
content: " is loading\n",
|
|
|
|
output:[
|
|
|
|
delay: 100
|
|
|
|
{color: "blue", content: "\nGitea", delay: 100},
|
|
|
|
|
|
|
|
{color: "white", content: " is loading\n", delay: 200},
|
|
|
|
|
|
|
|
{color: "white", content: "forwarding", delay: 400},
|
|
|
|
|
|
|
|
{color: "white", content: " ...", forward: "https://git.adb.sh", delay: 600}
|
|
|
|
|
|
|
|
]
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
name: ["matrix", "Matrix", "element", "Element"],
|
|
|
|
|
|
|
|
output:[
|
|
|
|
|
|
|
|
{color: "blue", content: "\nmatrix", delay: 100},
|
|
|
|
|
|
|
|
{color: "white", content: " is loading\n", delay: 200},
|
|
|
|
|
|
|
|
{color: "white", content: "forwarding", delay: 400},
|
|
|
|
|
|
|
|
{color: "white", content: " ...", forward: "https://element.adb.sh", delay: 600}
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
name: ["ether", "etherpad", "Etherpad"],
|
|
|
|
|
|
|
|
output:[
|
|
|
|
|
|
|
|
{color: "blue", content: "\nEtherpad", delay: 100},
|
|
|
|
|
|
|
|
{color: "white", content: " is loading\n", delay: 200},
|
|
|
|
|
|
|
|
{color: "white", content: "forwarding", delay: 400},
|
|
|
|
|
|
|
|
{color: "white", content: " ...", forward: "https://ether.adb.sh", delay: 600}
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
name: ["surl", "short-url", "shortURL"],
|
|
|
|
|
|
|
|
output:[
|
|
|
|
|
|
|
|
{color: "blue", content: "\ngit", delay: 100},
|
|
|
|
|
|
|
|
{color: "white", content: " is loading\n", delay: 200},
|
|
|
|
|
|
|
|
{color: "white", content: "forwarding", delay: 400},
|
|
|
|
|
|
|
|
{color: "white", content: " ...", forward: "https://s.adb.sh", delay: 600}
|
|
|
|
]
|
|
|
|
]
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
name: ["meet", "jitsi", "Jitsi"],
|
|
|
|
|
|
|
|
output:[
|
|
|
|
|
|
|
|
{color: "blue", content: "\nJitsi", delay: 100},
|
|
|
|
|
|
|
|
{color: "white", content: " is loading\n", delay: 200},
|
|
|
|
|
|
|
|
{color: "white", content: "forwarding", delay: 400},
|
|
|
|
|
|
|
|
{color: "white", content: " ...", forward: "https://meet.adb.sh", delay: 600}
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
}
|
|
|
|
]
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
let history = [{
|
|
|
|
let history = [{
|
|
|
@ -91,21 +133,19 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods:{
|
|
|
|
methods:{
|
|
|
|
renderCommand(input){
|
|
|
|
renderCommand(input){
|
|
|
|
if (input === undefined) input = history[history.length-1].command;
|
|
|
|
history[history.length-1].output = this.getCommand(input).output;
|
|
|
|
input = input.split(" ");
|
|
|
|
|
|
|
|
let command = commands.find((command) => command.name === input[0]);
|
|
|
|
|
|
|
|
if (command === undefined) command = commands[0];
|
|
|
|
|
|
|
|
command.output.forEach(group => {
|
|
|
|
|
|
|
|
/*setTimeout(() => {
|
|
|
|
|
|
|
|
history[history.length-1].output.push(group);
|
|
|
|
|
|
|
|
}, group.delay)*/
|
|
|
|
|
|
|
|
history[history.length-1].output.push(group);
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
history.push({
|
|
|
|
history.push({
|
|
|
|
host: "[cybre.town]$ ",
|
|
|
|
host: "[cybre.town]$ ",
|
|
|
|
command: "",
|
|
|
|
command: "",
|
|
|
|
output: []
|
|
|
|
output: []
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
getCommand(input) {
|
|
|
|
|
|
|
|
input = (input?input:history[history.length-1].command).split(" ")[0];
|
|
|
|
|
|
|
|
let command = commands.find(
|
|
|
|
|
|
|
|
command => Array.isArray(command.name)?command.name.find(
|
|
|
|
|
|
|
|
altName => altName === input):command.name === input);
|
|
|
|
|
|
|
|
return command?command:commands[0];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|