diff --git a/branches/ucs-3.2/ucs-3.2-2/virtualization/univention-virtual-machine-manager-daemon/umc/js/uvmm.js b/branches/ucs-3.2/ucs-3.2-2/virtualization/univention-virtual-machine-manager-daemon/umc/js/uvmm.js index 833e05d..03ca5e2 100644 --- a/branches/ucs-3.2/ucs-3.2-2/virtualization/univention-virtual-machine-manager-daemon/umc/js/uvmm.js +++ b/branches/ucs-3.2/ucs-3.2-2/virtualization/univention-virtual-machine-manager-daemon/umc/js/uvmm.js @@ -68,14 +68,13 @@ define([ CheckBox, ComboBox, TextBox, Button, TreeModel, DomainPage, DomainWizard, types, _) { var isRunning = function(item) { - return (item.state == 'RUNNING' || item.state == 'IDLE') && item.node_available; + return (item.state == 'RUNNING' || item.state == 'IDLE' || item.state == 'PAUSED') && item.node_available; }; var canStart = function(item) { - return !isRunning(item); + return !item.node_available || (item.state != 'RUNNING' && item.state != 'IDLE'); }; - var canVNC = function(item) { return isRunning(item) && item.vnc_port; }; @@ -905,9 +904,7 @@ define([ isStandardAction: false, isMultiAction: true, callback: lang.hitch(this, '_shutdown'), - canExecute: function(item) { - return (item.state == 'RUNNING' || item.state == 'IDLE') && item.node_available; - } + canExecute: isRunning }, { name: 'stop', label: _( 'Stop' ), @@ -920,9 +917,7 @@ define([ /* buttonLabel */ _( 'Stop' ), /* newState */ 'SHUTOFF', /* action */ 'stop'), - canExecute: function(item) { - return isRunning(item); - } + canExecute: isRunning }, { name: 'pause', label: _( 'Pause' ), @@ -931,7 +926,7 @@ define([ isMultiAction: true, callback: lang.hitch(this, '_changeState', 'PAUSE', 'pause' ), canExecute: function(item) { - return isRunning(item); + return isRunning(item) && item.state != 'PAUSED'; } }, { name: 'suspend', @@ -977,7 +972,7 @@ define([ isMultiAction: true, callback: lang.hitch(this, '_migrateDomain' ), canExecute: function(item) { - return item.state != 'PAUSE'; // FIXME need to find out if there are more than one node of this type + return item.state != 'PAUSED'; // FIXME need to find out if there are more than one node of this type } }, { name: 'remove', @@ -1006,7 +1001,7 @@ define([ var item = this._grid._grid.getItem(rowIndex); var percentage = Math.round(item.cpuUsage); - if (item.state == 'RUNNING' || item.state == 'IDLE') { + if (isRunning(item)) { // only show CPU info, if the machine is running return new ProgressBar({ value: percentage + '%'