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/01/03 10:38:50 UTC
svn commit: r1226714 - in /deltacloud/trunk/server: lib/deltacloud/server.rb
views/storage_volumes/show.html.haml
Author: marios
Date: Tue Jan 3 09:38:50 2012
New Revision: 1226714
URL: http://svn.apache.org/viewvc?rev=1226714&view=rev
Log:
Fix deltacloud HTML UI attach volume form
Modified:
deltacloud/trunk/server/lib/deltacloud/server.rb
deltacloud/trunk/server/views/storage_volumes/show.html.haml
Modified: deltacloud/trunk/server/lib/deltacloud/server.rb
URL: http://svn.apache.org/viewvc/deltacloud/trunk/server/lib/deltacloud/server.rb?rev=1226714&r1=1226713&r2=1226714&view=diff
==============================================================================
--- deltacloud/trunk/server/lib/deltacloud/server.rb (original)
+++ deltacloud/trunk/server/lib/deltacloud/server.rb Tue Jan 3 09:38:50 2012
@@ -675,6 +675,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
Modified: deltacloud/trunk/server/views/storage_volumes/show.html.haml
URL: http://svn.apache.org/viewvc/deltacloud/trunk/server/views/storage_volumes/show.html.haml?rev=1226714&r1=1226713&r2=1226714&view=diff
==============================================================================
--- deltacloud/trunk/server/views/storage_volumes/show.html.haml (original)
+++ deltacloud/trunk/server/views/storage_volumes/show.html.haml Tue Jan 3 09:38:50 2012
@@ -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