deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dko...@apache.org
Subject [2/8] git commit: CIMI: added/changed conditionals to only show machine operations for which the action url was returned in client UI
Date Mon, 15 Jul 2013 07:00:12 GMT
CIMI: added/changed conditionals to only show machine operations
for which the action url was returned in client UI


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/7bab5887
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/7bab5887
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/7bab5887

Branch: refs/heads/master
Commit: 7bab5887904435d6c66116a9163b8887318bd035
Parents: 5c2c9dc
Author: Dies Koper <diesk@fast.au.fujitsu.com>
Authored: Mon Jul 15 10:31:28 2013 +1000
Committer: Dies Koper <diesk@fast.au.fujitsu.com>
Committed: Mon Jul 15 10:53:01 2013 +1000

----------------------------------------------------------------------
 clients/cimi/views/machines/show.haml | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/7bab5887/clients/cimi/views/machines/show.haml
----------------------------------------------------------------------
diff --git a/clients/cimi/views/machines/show.haml b/clients/cimi/views/machines/show.haml
index cc31f0c..7d36da0 100644
--- a/clients/cimi/views/machines/show.haml
+++ b/clients/cimi/views/machines/show.haml
@@ -19,12 +19,14 @@
     %form{ :action => "/cimi/machines/#{href_to_id @machine.id}/restart", :method =>
:post, :style => 'display:inline', :id => 'frm_restart'}
     %form{ :action => "/cimi/machines/#{href_to_id @machine.id}/delete", :method =>
:post, :style => 'display:inline', :id => 'frm_delete'}
       %input{ :type => :hidden, :name => '_method', :value => 'delete'}
-    - if @machine.state == 'STARTED'
+    - if @machine.operations.find {|o| o.rel == 'http://schemas.dmtf.org/cimi/1/action/stop'}
       %button{ :class => 'btn btn-warning', :type => :button, :onclick => '$("#frm_stop").submit()'}
Stop
-    - if @machine.state == 'STOPPED'
+    - if @machine.operations.find {|o| o.rel == 'http://schemas.dmtf.org/cimi/1/action/start'}
       %button{ :class => 'btn btn-success', :type => :button, :onclick => '$("#frm_start").submit()'}
Start
-    %button{ :class => 'btn btn-info', :type => :button, :onclick => '$("#frm_restart").submit()'}
Reboot
-    %button{ :class => 'btn btn-danger', :type => :button, :onclick => '$("#frm_delete").submit()'}
Destroy
+    - if @machine.operations.find {|o| o.rel == 'http://schemas.dmtf.org/cimi/1/action/restart'}
+      %button{ :class => 'btn btn-info', :type => :button, :onclick => '$("#frm_restart").submit()'}
Reboot
+    - if @machine.operations.find {|o| o.rel == 'delete'}
+      %button{ :class => 'btn btn-danger', :type => :button, :onclick => '$("#frm_delete").submit()'}
Destroy
 
   %p{:style => 'margin-top:1em;'}
     %a{ :href => "#{@machine.id}?format=xml", :class => 'label warning' } XML


Mime
View raw message