mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-19 08:33:24 +02:00
35 lines
752 B
JavaScript
35 lines
752 B
JavaScript
module.exports = function ShellCtrl($scope, gettext) {
|
|
// TODO: implement multiple devices
|
|
// $scope.results = []
|
|
$scope.result = null
|
|
|
|
$scope.referenceUrl = '/#!/help/shell'
|
|
|
|
$scope.run = function(command) {
|
|
if (command === 'clear') {
|
|
$scope.clear()
|
|
return
|
|
}
|
|
|
|
$scope.command = ''
|
|
|
|
return $scope.control.shell(command)
|
|
.progressed(function(result) {
|
|
$scope.result = result
|
|
$scope.data = result.data.join('')
|
|
$scope.$digest()
|
|
})
|
|
.then(function(result) {
|
|
$scope.result = result
|
|
$scope.data = result.data.join('')
|
|
$scope.$digest()
|
|
})
|
|
}
|
|
|
|
$scope.clear = function () {
|
|
$scope.command = ''
|
|
$scope.data = ''
|
|
$scope.result = null
|
|
}
|
|
}
|