added alias c to clear and exit command
This commit is contained in:
parent
6856ac0eba
commit
5e7da4b5c7
37
js/index.js
37
js/index.js
@ -8,20 +8,29 @@
|
|||||||
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) {
|
||||||
var occCommand = {
|
switch (command) {
|
||||||
command: command
|
case "c":
|
||||||
};
|
this.clear();
|
||||||
term.pause();
|
break;
|
||||||
$.ajax({
|
case "exit":
|
||||||
url: baseUrl + '/cmd',
|
this.reset();
|
||||||
type: 'POST',
|
break;
|
||||||
contentType: 'application/json',
|
default:
|
||||||
data: JSON.stringify(occCommand)
|
var occCommand = {
|
||||||
}).done(function (response) {
|
command: command
|
||||||
term.echo('\n'+ response).resume();
|
};
|
||||||
}).fail(function (response, code) {
|
term.pause();
|
||||||
term.echo('\n' + response).resume();
|
$.ajax({
|
||||||
});
|
url: baseUrl + '/cmd',
|
||||||
|
type: 'POST',
|
||||||
|
contentType: 'application/json',
|
||||||
|
data: JSON.stringify(occCommand)
|
||||||
|
}).done(function (response) {
|
||||||
|
term.echo('\n' + response).resume();
|
||||||
|
}).fail(function (response, code) {
|
||||||
|
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',
|
||||||
|
Loading…
Reference in New Issue
Block a user