mirror of
https://github.com/nasa/openmct.git
synced 2025-04-20 00:51:09 +00:00
[CLI] Receive input
This commit is contained in:
parent
f1f8439726
commit
e2b4c87c03
@ -5,6 +5,13 @@
|
||||
"when": "/cli",
|
||||
"templateUrl": "templates/cli.html"
|
||||
}
|
||||
],
|
||||
"controllers": [
|
||||
{
|
||||
"key": "CLIController",
|
||||
"implementation": "CLIController.js",
|
||||
"depends": [ "$scope" ]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,10 @@
|
||||
<div class="abs holder-all browse-mode">
|
||||
<div class="abs holder-all browse-mode" ng-controller="CLIController">
|
||||
<div class="iw-stdout">
|
||||
<span ng-repeat="line in stdout">{{line}}</span>
|
||||
<span ng-repeat="line in stdout track by $index">{{line}}</span>
|
||||
</div>
|
||||
<input type="text" class="iw-stdin" ng-model="stdin" cli-grabfocus>
|
||||
<form ng-submit="enter(stdin)">
|
||||
<input type="text" class="iw-stdin" ng-model="stdin" cli-grabfocus>
|
||||
</form>
|
||||
<mct-include key="'bottombar'"></mct-include>
|
||||
</div>
|
||||
|
||||
|
16
ideas/cli/src/CLIController.js
Normal file
16
ideas/cli/src/CLIController.js
Normal file
@ -0,0 +1,16 @@
|
||||
/*global define*/
|
||||
|
||||
define(function () {
|
||||
'use strict';
|
||||
return function CLIController($scope) {
|
||||
$scope.stdout = [];
|
||||
$scope.stdin = "";
|
||||
|
||||
$scope.enter = function (input) {
|
||||
$scope.stdin = "";
|
||||
$scope.stdout.push("");
|
||||
$scope.stdout.push(input);
|
||||
$scope.stdout.push("");
|
||||
};
|
||||
};
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user