mirror of
https://github.com/hashicorp/vault.git
synced 2025-08-28 01:51:09 +02:00
27 lines
538 B
JavaScript
27 lines
538 B
JavaScript
Demo.DemoController = Ember.ObjectController.extend({
|
|
isLoading: false,
|
|
logs: "",
|
|
|
|
appendLog: function(data, prefix) {
|
|
var newline;
|
|
|
|
if (prefix) {
|
|
data = '$ ' + data;
|
|
} else {
|
|
newline = '';
|
|
}
|
|
|
|
newline = '\n';
|
|
|
|
this.set('logs', this.get('logs')+data+newline);
|
|
|
|
Ember.run.later(function() {
|
|
var element = $('.demo-terminal');
|
|
// Scroll to the bottom of the element
|
|
element.scrollTop(element[0].scrollHeight);
|
|
|
|
element.find('input.shell')[0].focus();
|
|
}, 5);
|
|
},
|
|
});
|