mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 16:13:24 +02:00
- Controlling devices from control-panes.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
module.exports = function ControlPanesCtrl($scope, gettext) {
|
||||
module.exports = function ($scope, gettext, $routeParams, $location, DeviceService, GroupService, ControlService) {
|
||||
|
||||
var sharedTabs = [
|
||||
{
|
||||
@@ -52,4 +52,20 @@ module.exports = function ControlPanesCtrl($scope, gettext) {
|
||||
].concat(angular.copy(sharedTabs))
|
||||
|
||||
|
||||
$scope.device = null
|
||||
$scope.control = null
|
||||
|
||||
|
||||
DeviceService.get($routeParams.serial, $scope)
|
||||
.then(function (device) {
|
||||
return GroupService.invite(device)
|
||||
})
|
||||
.then(function (device) {
|
||||
$scope.device = device
|
||||
$scope.control = ControlService.create(device, device.channel)
|
||||
return device
|
||||
})
|
||||
.catch(function () {
|
||||
$location.path('/')
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user