Iftekharul Islam | cd78950 | 2017-04-19 14:37:55 -0500 | [diff] [blame] | 1 | /** |
| 2 | * Controller for server |
| 3 | * |
| 4 | * @module app/serverControl |
| 5 | * @exports remoteConsoleController |
| 6 | * @name remoteConsoleController |
| 7 | * @version 0.1.0 |
| 8 | */ |
| 9 | |
| 10 | window.angular && (function (angular) { |
| 11 | 'use strict'; |
| 12 | |
| 13 | angular |
| 14 | .module('app.serverControl') |
| 15 | .controller('remoteConsoleController', [ |
| 16 | '$scope', |
| 17 | '$window', |
| 18 | 'APIUtils', |
| 19 | 'dataService', |
| 20 | function($scope, $window, APIUtils, dataService){ |
| 21 | $scope.dataService = dataService; |
Michael Davis | 8b52206 | 2017-05-05 09:21:07 -0500 | [diff] [blame^] | 22 | |
| 23 | // See https://github.com/macton/hterm for available hterm options |
| 24 | |
| 25 | //Storage |
| 26 | hterm.defaultStorage = new lib.Storage.Local(); |
| 27 | |
| 28 | var term = new hterm.Terminal("foo"); |
| 29 | term.onTerminalReady = function() { |
| 30 | var io = term.io.push(); |
| 31 | io.onVTKeystroke = function(str) { |
| 32 | console.log(str) |
| 33 | term.io.print(str); |
| 34 | }; |
| 35 | io.sendString = function(str) { |
| 36 | console.log(str) |
| 37 | }; |
| 38 | }; |
| 39 | term.decorate(document.querySelector('#terminal')); |
| 40 | |
| 41 | //Set cursor color |
| 42 | term.prefs_.set('cursor-color', 'rgba(83, 146, 255, .5)'); |
| 43 | |
| 44 | //Set background color |
| 45 | term.prefs_.set('background-color', '#19273c'); |
| 46 | |
| 47 | //Print to console window |
| 48 | term.io.println('OpenBMC ver.00'); |
| 49 | term.io.println('This is not an actual live connection.'); |
| 50 | term.io.print('root@IBM:'); |
| 51 | |
| 52 | //Allows keyboard input |
| 53 | term.installKeyboard(); |
Iftekharul Islam | cd78950 | 2017-04-19 14:37:55 -0500 | [diff] [blame] | 54 | } |
| 55 | ] |
| 56 | ); |
| 57 | |
| 58 | })(angular); |