Added Restart Device functionality.

Added device status to Fatal Message modal.
Added auto-reconnect to Fatal Message modal.
This commit is contained in:
Gunther Brunner
2014-06-19 21:13:20 +09:00
parent 694d621794
commit aebeb4d357
5 changed files with 47 additions and 25 deletions

View File

@@ -151,6 +151,8 @@ module.exports = function ControlPanesController($scope, $http, gettext, $routeP
$scope.device = device
$scope.control = ControlService.create(device, device.channel)
//FatalMessageService.open($scope.device)
return device
})
.catch(function () {
@@ -159,14 +161,17 @@ module.exports = function ControlPanesController($scope, $http, gettext, $routeP
})
})
// TODO: WHAT???
$scope.$watch('device')
$scope.$watch('device.state', function (newValue, oldValue) {
if (newValue !== oldValue) {
if (oldValue === 'using') {
FatalMessageService.open(angular.copy($scope.device))
FatalMessageService.open($scope.device)
}
} else if (typeof newValue === 'undefined' && typeof oldValue === 'undefined') {
//FatalMessageService.open(angular.copy($scope.device))