You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by ma...@apache.org on 2012/05/21 10:01:52 UTC

git commit: JIRA DTACLOUD_210

Updated Branches:
  refs/heads/master 56bb7ff01 -> 862c7cbe3


JIRA DTACLOUD_210

various small GUI improvements: use hyperlinks for FWs and volumes in
instances, allow name to be specified for new volumes, display name
when available, don't use hyperlink for 'unknown' instances,
don't use <--> if no device specified

Patches from Dies Koper diesk@fast.au.fujitsu.com

https://issues.apache.org/jira/browse/DTACLOUD-210


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

Branch: refs/heads/master
Commit: 862c7cbe31159449ae1411902966620323b7f279
Parents: 56bb7ff
Author: marios <ma...@redhat.com>
Authored: Mon May 21 11:00:24 2012 +0300
Committer: marios <ma...@redhat.com>
Committed: Mon May 21 11:00:24 2012 +0300

----------------------------------------------------------------------
 server/lib/deltacloud/drivers/mock/mock_driver.rb |    4 +++-
 server/views/instances/show.html.haml             |    6 ++++--
 server/views/storage_volumes/attach.html.haml     |    2 +-
 server/views/storage_volumes/index.html.haml      |    2 +-
 server/views/storage_volumes/new.html.haml        |    4 ++++
 server/views/storage_volumes/show.html.haml       |   11 ++++++++---
 6 files changed, 21 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/862c7cbe/server/lib/deltacloud/drivers/mock/mock_driver.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/drivers/mock/mock_driver.rb b/server/lib/deltacloud/drivers/mock/mock_driver.rb
index 9cd233e..aaa60ca 100644
--- a/server/lib/deltacloud/drivers/mock/mock_driver.rb
+++ b/server/lib/deltacloud/drivers/mock/mock_driver.rb
@@ -273,8 +273,10 @@ module Deltacloud::Drivers::Mock
       check_credentials(credentials)
       opts ||= {}
       opts[:capacity] ||= "1"
+      id = "Volume#{Time.now.to_i}"
       volume = {
-            :id => "Volume#{Time.now.to_i}",
+            :id => id,
+            :name => opts[:name] ? opts[:name] : id,
             :created => Time.now.to_s,
             :state => "AVAILABLE",
             :capacity => opts[:capacity],

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/862c7cbe/server/views/instances/show.html.haml
----------------------------------------------------------------------
diff --git a/server/views/instances/show.html.haml b/server/views/instances/show.html.haml
index 994f1c2..c820408 100644
--- a/server/views/instances/show.html.haml
+++ b/server/views/instances/show.html.haml
@@ -45,12 +45,14 @@
         %a{ :href => key_url(@instance.keyname), :'data-ajax' => 'false'}=@instance.keyname
     - if @instance.firewalls
       %li{ :'data-role' => 'list-divider'} Firewalls
-      %li=@instance.firewalls.join(", ")
+      - @instance.firewalls.each do |firewall|
+        %li
+          %a{ :href => firewall_url(firewall), :'data-ajax' => 'false'}=firewall
     - if @instance.storage_volumes
       %li{ :'data-role' => 'list-divider'} Attached Storage Volumes
       -@instance.storage_volumes.each do |vol|
         %li
-          %p{ :'data-role' => 'fieldcontain'}="#{vol.keys.first} <---> #{vol.values.first}"
+          %a{ :href => storage_volume_url("#{vol.keys.first}"), :'data-ajax' => 'false'}=["#{vol.keys.first}", "#{vol.values.first}"].compact.reject{ |e| e.empty? }.join(' <---> ')
     %li{ :'data-role' => 'list-divider'} Actions
     %li
       %div{ :'data-role' => 'controlgroup', :'data-type' => "horizontal" }

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/862c7cbe/server/views/storage_volumes/attach.html.haml
----------------------------------------------------------------------
diff --git a/server/views/storage_volumes/attach.html.haml b/server/views/storage_volumes/attach.html.haml
index 60c23cb..0127ccd 100644
--- a/server/views/storage_volumes/attach.html.haml
+++ b/server/views/storage_volumes/attach.html.haml
@@ -16,4 +16,4 @@
       Device name:
     %input{ :name => "device", :size => 10, :value => "/dev/sdc"}
   %p
-    %input{ :type => :submit, :name => "commit", :value => "create" }/
+    %input{ :type => :submit, :name => "commit", :value => "attach" }/

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/862c7cbe/server/views/storage_volumes/index.html.haml
----------------------------------------------------------------------
diff --git a/server/views/storage_volumes/index.html.haml b/server/views/storage_volumes/index.html.haml
index 9a9deaf..ba44b65 100644
--- a/server/views/storage_volumes/index.html.haml
+++ b/server/views/storage_volumes/index.html.haml
@@ -8,6 +8,6 @@
       %li
         %a{ :href => storage_volume_url(volume.id), :'data-ajax' => 'false'}
           %img{ :class => 'ui-link-thumb', :src => '/images/volume.png'}
-          %h3= volume.id
+          %h3= volume.name ? volume.name : volume.id
           %p=[volume.realm_id, volume.capacity].join(', ')
           %span{ :class => 'ui-li-count'}=volume.state

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/862c7cbe/server/views/storage_volumes/new.html.haml
----------------------------------------------------------------------
diff --git a/server/views/storage_volumes/new.html.haml b/server/views/storage_volumes/new.html.haml
index 7cbcf2b..ff8a83f 100644
--- a/server/views/storage_volumes/new.html.haml
+++ b/server/views/storage_volumes/new.html.haml
@@ -3,6 +3,10 @@
 %form{ :action => storage_volumes_url, :method => :post }
   %p
     %label
+      Name:
+    %input{ :name => 'name', :size => 30 } (optional)
+  %p
+    %label
       Snapshot ID:
     %input{ :name => 'snapshot_id', :size => 30 } (optional)
   %p

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/862c7cbe/server/views/storage_volumes/show.html.haml
----------------------------------------------------------------------
diff --git a/server/views/storage_volumes/show.html.haml b/server/views/storage_volumes/show.html.haml
index aabdd85..600e6a4 100644
--- a/server/views/storage_volumes/show.html.haml
+++ b/server/views/storage_volumes/show.html.haml
@@ -5,7 +5,7 @@
   %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'd'}
     %li{ :'data-role' => 'list-divider'} Name
     %li
-      %p{ :'data-role' => 'fieldcontain'}=@storage_volume.id
+      %p{ :'data-role' => 'fieldcontain'}=(@storage_volume.name ? @storage_volume.name : @storage_volume.id)
     %li{ :'data-role' => 'list-divider'} Created
     %li
       %p{ :'data-role' => 'fieldcontain'}=@storage_volume.created
@@ -20,8 +20,13 @@
       %p{ :'data-role' => 'fieldcontain'}=@storage_volume.state
     %li{ :'data-role' => 'list-divider'} Attached to
     %li
-      %a{ :href => instance_url( @storage_volume.instance_id)}
-        = @storage_volume.instance_id || 'unknown'
+      - if @storage_volume.instance_id
+        %a{ :href => instance_url( @storage_volume.instance_id)}
+          = @storage_volume.instance_id
+      - elsif @storage_volume.state == "AVAILABLE"
+        %p{ :'data-role' => 'fieldcontain'}= 'none (detached)'
+      -else
+        %p{ :'data-role' => 'fieldcontain'}= 'unknown'
     %li{ :'data-role' => 'list-divider'} Device
     %li
       %p{ :'data-role' => 'fieldcontain'}= @storage_volume.device