force reload, add fallback (unknown), add social

master
adb 4 years ago
parent 7603345384
commit 4482c4673b

@ -3,7 +3,7 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta name="viewport" content="width=device-width,initial-scale=8.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> <link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title> <title><%= htmlWebpackPlugin.options.title %></title>
</head> </head>

@ -21,6 +21,7 @@ export default {
methods:{ methods:{
execCommand(){ execCommand(){
commands.methods.renderCommand() commands.methods.renderCommand()
this.$forceUpdate()
} }
} }
} }

@ -1,4 +1,27 @@
let commands = [ let commands = [
{
name: "unknown",
output:[
{
color: "white",
content: "\nthe command you entered is undefined!\n",
delay: 100
},
{
color: "white",
content:
"try something like:\n" +
"\n" +
" - Mastodon > social\n" +
" - Gitea > git\n" +
" - Matrix > element\n" +
" - Etherpad > ether\n" +
" - short url > surl\n" +
" - Jitsi > meet\n",
delay: 200
},
]
},
{ {
name: "welcome", name: "welcome",
output:[ output:[
@ -33,9 +56,24 @@ let commands = [
" - short url > surl\n" + " - short url > surl\n" +
" - Jitsi > meet\n", " - Jitsi > meet\n",
delay: 300 delay: 300
}
]
},
{
name: "social",
output:[
{
color: "blue",
content: "\nsocial",
delay: 100
},
{
color: "white",
content: " is loading\n",
delay: 100
}, },
] ]
} },
] ]
let history = [{ let history = [{
@ -56,6 +94,7 @@ export default {
if (input === undefined) input = history[history.length-1].command; if (input === undefined) input = history[history.length-1].command;
input = input.split(" "); input = input.split(" ");
let command = commands.find((command) => command.name === input[0]); let command = commands.find((command) => command.name === input[0]);
if (command === undefined) command = commands[0];
command.output.forEach(group => { command.output.forEach(group => {
/*setTimeout(() => { /*setTimeout(() => {
history[history.length-1].output.push(group); history[history.length-1].output.push(group);
@ -70,5 +109,3 @@ export default {
} }
} }
} }
//this.methods.renderCommand("welcome --help")
Loading…
Cancel
Save