Return-Path: X-Original-To: apmail-deltacloud-commits-archive@www.apache.org Delivered-To: apmail-deltacloud-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A2157794B for ; Wed, 7 Dec 2011 16:18:42 +0000 (UTC) Received: (qmail 80611 invoked by uid 500); 7 Dec 2011 16:18:42 -0000 Delivered-To: apmail-deltacloud-commits-archive@deltacloud.apache.org Received: (qmail 80594 invoked by uid 500); 7 Dec 2011 16:18:42 -0000 Mailing-List: contact commits-help@deltacloud.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@deltacloud.apache.org Delivered-To: mailing list commits@deltacloud.apache.org Received: (qmail 80587 invoked by uid 99); 7 Dec 2011 16:18:42 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Dec 2011 16:18:42 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Dec 2011 16:18:41 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 3EE3523889E1 for ; Wed, 7 Dec 2011 16:18:20 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@deltacloud.apache.org From: mfojtik@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20111207161820.3EE3523889E1@eris.apache.org> 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