|
68 |
CheckBox, ComboBox, TextBox, Button, TreeModel, DomainPage, DomainWizard, types, _) { |
68 |
CheckBox, ComboBox, TextBox, Button, TreeModel, DomainPage, DomainWizard, types, _) { |
69 |
|
69 |
|
70 |
var isRunning = function(item) { |
70 |
var isRunning = function(item) { |
71 |
return (item.state == 'RUNNING' || item.state == 'IDLE') && item.node_available; |
71 |
return (item.state == 'RUNNING' || item.state == 'IDLE' || item.state == 'PAUSED') && item.node_available; |
72 |
}; |
72 |
}; |
73 |
|
73 |
|
74 |
var canStart = function(item) { |
74 |
var canStart = function(item) { |
75 |
return !isRunning(item); |
75 |
return !item.node_available || (item.state != 'RUNNING' && item.state != 'IDLE'); |
76 |
}; |
76 |
}; |
77 |
|
77 |
|
78 |
|
|
|
79 |
var canVNC = function(item) { |
78 |
var canVNC = function(item) { |
80 |
return isRunning(item) && item.vnc_port; |
79 |
return isRunning(item) && item.vnc_port; |
81 |
}; |
80 |
}; |
|
905 |
isStandardAction: false, |
904 |
isStandardAction: false, |
906 |
isMultiAction: true, |
905 |
isMultiAction: true, |
907 |
callback: lang.hitch(this, '_shutdown'), |
906 |
callback: lang.hitch(this, '_shutdown'), |
908 |
canExecute: function(item) { |
907 |
canExecute: isRunning |
909 |
return (item.state == 'RUNNING' || item.state == 'IDLE') && item.node_available; |
|
|
910 |
} |
911 |
}, { |
908 |
}, { |
912 |
name: 'stop', |
909 |
name: 'stop', |
913 |
label: _( 'Stop' ), |
910 |
label: _( 'Stop' ), |
|
920 |
/* buttonLabel */ _( 'Stop' ), |
917 |
/* buttonLabel */ _( 'Stop' ), |
921 |
/* newState */ 'SHUTOFF', |
918 |
/* newState */ 'SHUTOFF', |
922 |
/* action */ 'stop'), |
919 |
/* action */ 'stop'), |
923 |
canExecute: function(item) { |
920 |
canExecute: isRunning |
924 |
return isRunning(item); |
|
|
925 |
} |
926 |
}, { |
921 |
}, { |
927 |
name: 'pause', |
922 |
name: 'pause', |
928 |
label: _( 'Pause' ), |
923 |
label: _( 'Pause' ), |
|
931 |
isMultiAction: true, |
926 |
isMultiAction: true, |
932 |
callback: lang.hitch(this, '_changeState', 'PAUSE', 'pause' ), |
927 |
callback: lang.hitch(this, '_changeState', 'PAUSE', 'pause' ), |
933 |
canExecute: function(item) { |
928 |
canExecute: function(item) { |
934 |
return isRunning(item); |
929 |
return isRunning(item) && item.state != 'PAUSED'; |
935 |
} |
930 |
} |
936 |
}, { |
931 |
}, { |
937 |
name: 'suspend', |
932 |
name: 'suspend', |
|
977 |
isMultiAction: true, |
972 |
isMultiAction: true, |
978 |
callback: lang.hitch(this, '_migrateDomain' ), |
973 |
callback: lang.hitch(this, '_migrateDomain' ), |
979 |
canExecute: function(item) { |
974 |
canExecute: function(item) { |
980 |
return item.state != 'PAUSE'; // FIXME need to find out if there are more than one node of this type |
975 |
return item.state != 'PAUSED'; // FIXME need to find out if there are more than one node of this type |
981 |
} |
976 |
} |
982 |
}, { |
977 |
}, { |
983 |
name: 'remove', |
978 |
name: 'remove', |
|
1006 |
var item = this._grid._grid.getItem(rowIndex); |
1001 |
var item = this._grid._grid.getItem(rowIndex); |
1007 |
var percentage = Math.round(item.cpuUsage); |
1002 |
var percentage = Math.round(item.cpuUsage); |
1008 |
|
1003 |
|
1009 |
if (item.state == 'RUNNING' || item.state == 'IDLE') { |
1004 |
if (isRunning(item)) { |
1010 |
// only show CPU info, if the machine is running |
1005 |
// only show CPU info, if the machine is running |
1011 |
return new ProgressBar({ |
1006 |
return new ProgressBar({ |
1012 |
value: percentage + '%' |
1007 |
value: percentage + '%' |