Close VM console during reboot (fix #208).

This commit is contained in:
Julien Fontanet
2015-03-10 12:42:28 +01:00
parent d045b1af9b
commit 0b09d672d2
2 changed files with 10 additions and 2 deletions

View File

@@ -1,5 +1,7 @@
angular = require 'angular'
contains = require('lodash.contains')
#=====================================================================
module.exports = angular.module 'xoWebApp.console', [
@@ -26,13 +28,18 @@ module.exports = angular.module 'xoWebApp.console', [
$scope.$watch(
-> xoApi.get id
(VM) ->
$scope.consoleUrl = null
unless xoApi.user
$scope.consoleUrl = ''
$scope.VDIs = []
return
$scope.VM = VM
return unless VM? and VM.power_state is 'Running'
return unless (
VM? and
VM.power_state is 'Running' and
not contains(VM.current_operations, 'clean_reboot')
)
pool = get VM.poolRef
return unless pool

View File

@@ -41,6 +41,7 @@
"gulp-watch": "^4.1.1",
"in-publish": "^1.1.1",
"jquery": "^2.1.3",
"lodash.contains": "^2.4.1",
"lodash.filter": "^3.0.0",
"lodash.indexof": "^3.0.0",
"lodash.throttle": "^3.0.1",