Commit c1cc3bae authored by Francesc Guasch's avatar Francesc Guasch Committed by GitHub
Browse files

Merge pull request #173 from UPC/172_hib

172 hib
parents 613bb583 f6ec3315
......@@ -34,6 +34,7 @@ requires 'remove';
requires 'display';
requires 'is_active';
requires 'is_hibernated';
requires 'is_paused';
requires 'start';
requires 'shutdown';
......
......@@ -568,6 +568,17 @@ sub resume {
}
=head2 is_hibernated
Returns if the domain has a managed saved state.
=cut
sub is_hibernated {
my $self = shift;
return $self->domain->has_managed_save_image;
}
=head2 is_paused
Returns if the domain is paused
......
......@@ -87,6 +87,8 @@ sub remove {
$self->remove_disks();
}
sub is_hibernated { return 0 }
sub is_paused {
my $self = shift;
......
......@@ -202,6 +202,7 @@ sub list_domains {
if ( $domain ) {
$row->{is_active} = 1 if $domain->is_active;
$row->{is_locked} = $domain->is_locked;
$row->{is_hibernated} = 1 if $domain->is_hibernated;
$row->{is_paused} = 1 if $domain->is_paused;
$row->{has_clones} = $domain->has_clones;
$row->{disk_size} = ( $domain->disk_size or 0);
......
......@@ -75,7 +75,8 @@
<td class="lgMachActions">
<span style="float:right;" ng-show="{{machine.is_paused && machine.is_active}}" class="label label-warning" ng-cloak><%=l 'Paused' %></span>
<span style="float:left;" ng-show="{{!machine.is_paused && machine.is_active}}" class="label label-success" ng-cloak><%=l 'Running' %></span>
<span style="float:right;" ng-show="{{!machine.is_active}}" class="label label-danger" ng-cloak><%=l 'Down' %></span>
<span style="float:right;" ng-show="{{!machine.is_active && !machine.is_hibernated}}" class="label label-danger" ng-cloak><%=l 'Down' %></span>
<span style="float:right;" ng-show="{{machine.is_hibernated}}" class="label label-warning" ng-cloak><%=l 'Hibernated' %></span>
<div ng-show="{{machine.is_active}}">{{machine.remote_ip}}</div>
</td>
<td class="lgMachToggle">
......@@ -142,7 +143,8 @@
<td class="lgMachActions">
<span style="float:right;" ng-show="{{child.is_paused && child.is_active}}" class="label label-warning" ng-cloak><%=l 'Paused' %></span>
<span style="float:left;" ng-show="{{!child.is_paused && child.is_active}}" class="label label-success" ng-cloak><%=l 'Running' %></span>
<span style="float:right;" ng-show="{{!child.is_active}}" class="label label-danger" ng-cloak><%=l 'Down' %></span>
<span style="float:right;" ng-show="{{!child.is_active && !child.is_hibernated}}" class="label label-danger" ng-cloak><%=l 'Down' %></span>
<span style="float:right;" ng-show="{{child.is_hibernated}}" class="label label-warning" ng-cloak><%=l 'Hibernated' %></span>
<div ng-show="{{child.is_active}}">{{child.remote_ip}}</div>
</td>
<td class="lgMachToggle">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment