added alias c to clear and exit command

This commit is contained in:
Adphi 2019-01-19 16:38:43 +01:00
parent 6856ac0eba
commit 5e7da4b5c7

View File

@ -8,6 +8,14 @@
var baseUrl = OC.generateUrl('/apps/occweb'); var baseUrl = OC.generateUrl('/apps/occweb');
$.get(baseUrl + '/cmd', function(response){ $.get(baseUrl + '/cmd', function(response){
$('#app-content').terminal(function(command, term) { $('#app-content').terminal(function(command, term) {
switch (command) {
case "c":
this.clear();
break;
case "exit":
this.reset();
break;
default:
var occCommand = { var occCommand = {
command: command command: command
}; };
@ -18,10 +26,11 @@
contentType: 'application/json', contentType: 'application/json',
data: JSON.stringify(occCommand) data: JSON.stringify(occCommand)
}).done(function (response) { }).done(function (response) {
term.echo('\n'+ response).resume(); term.echo('\n' + response).resume();
}).fail(function (response, code) { }).fail(function (response, code) {
term.echo('\n' + response).resume(); term.echo('\n' + response).resume();
}); });
}
}, { }, {
greetings: '[[;green;]' + new Date().toString().slice(0, 24) + "]\n\nPress [[;#ff5e99;]Enter] for more information on [[;#009ae3;]occ] commands.\n", greetings: '[[;green;]' + new Date().toString().slice(0, 24) + "]\n\nPress [[;#ff5e99;]Enter] for more information on [[;#009ae3;]occ] commands.\n",
name: 'occ', name: 'occ',