deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject svn commit: r1211499 - in /deltacloud/trunk/clients/cimi: lib/cimi_frontend_helper.rb views/machines/show.haml views/volume_configurations/show.haml views/volume_images/show.haml views/volumes/show.haml
Date Wed, 07 Dec 2011 16:18:20 GMT
Author: mfojtik
Date: Wed Dec  7 16:18:19 2011
New Revision: 1211499

URL: http://svn.apache.org/viewvc?rev=1211499&view=rev
Log:
CIMI: Replaced .inspect in Details with formatted data

Modified:
    deltacloud/trunk/clients/cimi/lib/cimi_frontend_helper.rb
    deltacloud/trunk/clients/cimi/views/machines/show.haml
    deltacloud/trunk/clients/cimi/views/volume_configurations/show.haml
    deltacloud/trunk/clients/cimi/views/volume_images/show.haml
    deltacloud/trunk/clients/cimi/views/volumes/show.haml

Modified: deltacloud/trunk/clients/cimi/lib/cimi_frontend_helper.rb
URL: http://svn.apache.org/viewvc/deltacloud/trunk/clients/cimi/lib/cimi_frontend_helper.rb?rev=1211499&r1=1211498&r2=1211499&view=diff
==============================================================================
--- deltacloud/trunk/clients/cimi/lib/cimi_frontend_helper.rb (original)
+++ deltacloud/trunk/clients/cimi/lib/cimi_frontend_helper.rb Wed Dec  7 16:18:19 2011
@@ -46,6 +46,23 @@ module CIMI
         halt(*args)
       end
 
+      def boolean_span_for(bool)
+        return bool if !bool.nil? and bool!='true' and bool!='false'
+        capture_haml do
+          haml_tag :span, :class => [ 'label', bool.nil? ? '' : (bool===false) ? 'important'
: 'success' ] do
+            haml_concat bool.nil? ? 'not specified' : (bool===false) ? 'no' : 'yes'
+          end
+        end
+      end
+
+      def state_span_for(state)
+        capture_haml do
+          haml_tag :span, :class => [ 'label', state=='STARTED' ? 'success' : 'important'
] do
+            haml_concat state
+          end
+        end
+      end
+
     end
   end
 end

Modified: deltacloud/trunk/clients/cimi/views/machines/show.haml
URL: http://svn.apache.org/viewvc/deltacloud/trunk/clients/cimi/views/machines/show.haml?rev=1211499&r1=1211498&r2=1211499&view=diff
==============================================================================
--- deltacloud/trunk/clients/cimi/views/machines/show.haml (original)
+++ deltacloud/trunk/clients/cimi/views/machines/show.haml Wed Dec  7 16:18:19 2011
@@ -43,7 +43,22 @@
   %dt Created
   %dd #{@machine.created} 
   %dt State
-  %dd=@machine.state
+  %dd=state_span_for @machine.state
+  %dt CPU
+  %dd=boolean_span_for @machine.cpu
+  %dt Memory
+  %dd
+    - if @machine.memory.quantity.nil?
+      %span.label Not specified
+    - else
+      =[@memory.quantity, @memory.units].join(" ")
+  %dt Meters
+  %dd
+    - if @machine.meters.empty?
+      %span.label No meters
+    - else
+      - @machine.meters.each do |meters|
+        %dd=meters.ref
 
 %h3 Network Interfaces
 
@@ -76,3 +91,18 @@
           %a{:href => "/cimi/volumes/#{href_to_id(volume.href)}" }=href_to_id(volume.href)
         %td=volume.attachment_point
         %td=volume.protocol
+
+%h3 Disks
+
+%table.bordered-table
+  %thead
+    %tr
+      %th Capacity
+      %th Format
+      %th Attachment point
+  %tbody
+    - @machine.disks.each do |disk|
+      %tr
+        %td=[boolean_span_for(disk.capacity.quantity), disk.capacity.units].join(" ")
+        %td=boolean_span_for disk.format
+        %td=boolean_span_for disk.attachment_point

Modified: deltacloud/trunk/clients/cimi/views/volume_configurations/show.haml
URL: http://svn.apache.org/viewvc/deltacloud/trunk/clients/cimi/views/volume_configurations/show.haml?rev=1211499&r1=1211498&r2=1211499&view=diff
==============================================================================
--- deltacloud/trunk/clients/cimi/views/volume_configurations/show.haml (original)
+++ deltacloud/trunk/clients/cimi/views/volume_configurations/show.haml Wed Dec  7 16:18:19
2011
@@ -30,6 +30,13 @@
   %dt Description
   %dd=@volume_configuration.description
   %dt Created
-  %dd #{@volume_configuration.created} 
-  %dt Details
-  %dd=@volume_configuration.inspect
+  %dd=@volume_configuration.created
+  %dt Format
+  %dd=boolean_span_for @volume_configuration.format
+  %dt Supports snapshots
+  %dd=boolean_span_for @volume_configuration.supports_snapshots
+  %dt Guest interface
+  %dd=boolean_span_for @volume_configuration.guest_interface
+  %dt Capacity
+  %dd
+    =[@volume_configuration.capacity.quantity, @volume_configuration.capacity.units].join(' ')

Modified: deltacloud/trunk/clients/cimi/views/volume_images/show.haml
URL: http://svn.apache.org/viewvc/deltacloud/trunk/clients/cimi/views/volume_images/show.haml?rev=1211499&r1=1211498&r2=1211499&view=diff
==============================================================================
--- deltacloud/trunk/clients/cimi/views/volume_images/show.haml (original)
+++ deltacloud/trunk/clients/cimi/views/volume_images/show.haml Wed Dec  7 16:18:19 2011
@@ -29,5 +29,10 @@
   %dd=@volume_image.description
   %dt Created
   %dd=@volume_image.created
-  %dt Details
-  %dd=@volume_image.inspect
+  %dt Bootable
+  %dd=boolean_span_for @volume_image.bootable
+  %dt Image Location
+  %dd
+    %a{:href => "/cimi/volumes/#{href_to_id(@volume_image.image_location.href)}"}=href_to_id
@volume_image.image_location.href
+  %dt Image Data
+  %dd=boolean_span_for @volume_image.image_data

Modified: deltacloud/trunk/clients/cimi/views/volumes/show.haml
URL: http://svn.apache.org/viewvc/deltacloud/trunk/clients/cimi/views/volumes/show.haml?rev=1211499&r1=1211498&r2=1211499&view=diff
==============================================================================
--- deltacloud/trunk/clients/cimi/views/volumes/show.haml (original)
+++ deltacloud/trunk/clients/cimi/views/volumes/show.haml Wed Dec  7 16:18:19 2011
@@ -28,6 +28,24 @@
   %dt Description
   %dd=@volume.description
   %dt Created
-  %dd #{@volume.created} 
-  %dt Details
-  %dd=@volume.inspect
+  %dd=@volume.created
+  %dt Bootable
+  %dd=boolean_span_for @volume.bootable
+  %dt Support Snapshots
+  %dd=boolean_span_for @volume.supports_snapshots
+  %dt Guest Interface
+  %dd=boolean_span_for @volume.guest_interface
+  %dt Snapshots
+  %dd
+    - if @volume.snapshots.empty?
+      %span.label No snapshots
+    - else
+      - @volume.snapshots.each do |snapshot|
+        %dd=snapshot.ref
+  %dt Meters
+  %dd
+    - if @volume.meters.empty?
+      %span.label No meters
+    - else
+      - @volume.meters.each do |meters|
+        %dd=meters.ref



Mime
View raw message