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/06/12 13:07:59 UTC
git commit: Fixes for DTACLOUD 230 (Addresses)
Updated Branches:
refs/heads/master 0c7493213 -> 7736ee8ea
Fixes for DTACLOUD 230 (Addresses)
Various nits brought over from modular - associate
disassociate address/ create new etc.
https://issues.apache.org/jira/browse/DTACLOUD-230
Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/7736ee8e
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/7736ee8e
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/7736ee8e
Branch: refs/heads/master
Commit: 7736ee8ea48b1105099ac4829da2e43339b7c932
Parents: 0c74932
Author: marios <ma...@redhat.com>
Authored: Tue Jun 12 12:58:49 2012 +0300
Committer: marios <ma...@redhat.com>
Committed: Tue Jun 12 12:58:49 2012 +0300
----------------------------------------------------------------------
server/lib/deltacloud/collections/addresses.rb | 8 ++++++++
server/views/addresses/associate.html.haml | 2 +-
server/views/addresses/index.html.haml | 2 +-
server/views/addresses/show.html.haml | 5 ++---
4 files changed, 12 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/7736ee8e/server/lib/deltacloud/collections/addresses.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/collections/addresses.rb b/server/lib/deltacloud/collections/addresses.rb
index b97d170..95c4ae5 100644
--- a/server/lib/deltacloud/collections/addresses.rb
+++ b/server/lib/deltacloud/collections/addresses.rb
@@ -18,6 +18,14 @@ module Deltacloud::Collections
check_capability :for => lambda { |m| driver.respond_to? m }
+ get route_for('/addresses/:id/associate') do
+ @address = driver.address(credentials, params )
+ @instances = driver.instances(credentials)
+ respond_to do |format|
+ format.html {haml :"addresses/associate"}
+ end
+ end
+
collection :addresses do
description "Pool of IP addresses allocated in cloud provider"
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/7736ee8e/server/views/addresses/associate.html.haml
----------------------------------------------------------------------
diff --git a/server/views/addresses/associate.html.haml b/server/views/addresses/associate.html.haml
index 38cf7e6..b4fb707 100644
--- a/server/views/addresses/associate.html.haml
+++ b/server/views/addresses/associate.html.haml
@@ -2,7 +2,7 @@
=subheader @address.id
%div{ :'data-role' => :content, :'data-theme' => 'c', :class => 'middle-dialog'}
- %form{ :action => associate_address_url(@address.id), :method => :post}
+ %form{ :action => "#{address_url(@address.id)}/associate", :method => :post}
%div{ 'data-role' => :fieldcontain }
%label{ :for => :name} Instance:
%select{:name => 'instance_id'}
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/7736ee8e/server/views/addresses/index.html.haml
----------------------------------------------------------------------
diff --git a/server/views/addresses/index.html.haml b/server/views/addresses/index.html.haml
index 9cac99f..7c72735 100644
--- a/server/views/addresses/index.html.haml
+++ b/server/views/addresses/index.html.haml
@@ -1,5 +1,5 @@
=header "Addresses" do
- %a{ :href => "#", :onclick => "create_address('#{create_address_url}')", :'data-icon' => :plus, :'data-role' => :button, :class => 'ui-btn-right', :'data-ajax' => "false", :method => :post} Create new address
+ %a{ :href => "#", :onclick => "create_address('#{addresses_url}')", :'data-icon' => :plus, :'data-role' => :button, :class => 'ui-btn-right', :'data-ajax' => "false", :method => :post} Create new address
=subheader "#{Thread::current[:provider] || ENV['API_PROVIDER'] || 'default'}"
%div{ :'data-role' => :content, :'data-theme' => 'c'}
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/7736ee8e/server/views/addresses/show.html.haml
----------------------------------------------------------------------
diff --git a/server/views/addresses/show.html.haml b/server/views/addresses/show.html.haml
index ab4b4e2..86eb546 100644
--- a/server/views/addresses/show.html.haml
+++ b/server/views/addresses/show.html.haml
@@ -13,9 +13,8 @@
%li
%div{ :'data-role' => 'controlgroup', :'data-type' => "horizontal" }
- if @address.associated?
- %a{:href => instance_url(@address.instance_id) }=@address.instance_id
- =link_to_action 'Disassociate', disassociate_address_url(@address.id), :post
+ =link_to_action 'Disassociate', "#{address_url(@address.id)}/disassociate", :post
- else
- if driver.respond_to?(:associate_address)
- =link_to_action 'Associate', associate_address_url(@address.id), :get
+ =link_to_action 'Associate',"#{address_url(@address.id)}/associate", :get
=link_to_action "Destroy", destroy_address_url(@address.id), :delete