deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@redhat.com
Subject [PATCH 1/6] Fix deltacloud HTML UI attach volume form
Date Fri, 23 Dec 2011 16:31:19 GMT
From: marios <marios@redhat.com>


Signed-off-by: marios <marios@redhat.com>
---
 server/lib/deltacloud/server.rb             |   10 ++++++++++
 server/views/storage_volumes/show.html.haml |    2 +-
 2 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/server/lib/deltacloud/server.rb b/server/lib/deltacloud/server.rb
index 88250a6..2fa81c7 100644
--- a/server/lib/deltacloud/server.rb
+++ b/server/lib/deltacloud/server.rb
@@ -664,6 +664,16 @@ collection :storage_volumes do
     end
   end
 
+  operation :attach_instance, :method=>:get, :member=>true  do
+    description "A form to attach a storage volume to an instance"
+    control do
+      @instances = driver.instances(credentials)
+      respond_to do |format|
+        format.html{ haml :"storage_volumes/attach"}
+      end
+    end
+  end
+
   operation :attach, :method => :post, :member => true do
     description "Attach storage volume to instance"
     with_capability :attach_storage_volume
diff --git a/server/views/storage_volumes/show.html.haml b/server/views/storage_volumes/show.html.haml
index 585990e..aabdd85 100644
--- a/server/views/storage_volumes/show.html.haml
+++ b/server/views/storage_volumes/show.html.haml
@@ -32,6 +32,6 @@
           =link_to_action "Snapshot", api_url_for("storage_snapshots/new?volume_id=#{@storage_volume.id}"),
:get
           - unless @storage_volume.instance_id
             =link_to_action "Delete", destroy_storage_volume_url(@storage_volume.id), :delete
-            =link_to_action "Attach", api_url_for("storage_volumes/attach?id=#{@storage_volume.id}"),
:get
+            =link_to_action "Attach", api_url_for("storage_volumes/#{@storage_volume.id}/attach_instance"),
:get
           - if @storage_volume.instance_id
             =link_to_action "Detach", detach_storage_volume_url(@storage_volume.id), :post
-- 
1.7.6.4


Mime
View raw message