incubator-deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lut...@apache.org
Subject svn commit: r962079 - in /incubator/deltacloud/trunk/framework: app/controllers/ app/models/ app/views/instances/ app/views/realms/ lib/converters/ lib/deltacloud/
Date Thu, 08 Jul 2010 23:21:32 GMT
Author: lutter
Date: Thu Jul  8 23:21:31 2010
New Revision: 962079

URL: http://svn.apache.org/viewvc?rev=962079&view=rev
Log:
Require 'realm' because the case fails otherwise.
Add some extra attributes in the HTML representation.

Modified:
    incubator/deltacloud/trunk/framework/app/controllers/realms_controller.rb
    incubator/deltacloud/trunk/framework/app/models/instance.rb
    incubator/deltacloud/trunk/framework/app/views/instances/index.html.erb
    incubator/deltacloud/trunk/framework/app/views/instances/new.html.erb
    incubator/deltacloud/trunk/framework/app/views/instances/show.html.erb
    incubator/deltacloud/trunk/framework/app/views/realms/index.html.erb
    incubator/deltacloud/trunk/framework/app/views/realms/show.html.erb
    incubator/deltacloud/trunk/framework/lib/converters/xml_converter.rb
    incubator/deltacloud/trunk/framework/lib/deltacloud/base_driver.rb

Modified: incubator/deltacloud/trunk/framework/app/controllers/realms_controller.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/framework/app/controllers/realms_controller.rb?rev=962079&r1=962078&r2=962079&view=diff
==============================================================================
--- incubator/deltacloud/trunk/framework/app/controllers/realms_controller.rb (original)
+++ incubator/deltacloud/trunk/framework/app/controllers/realms_controller.rb Thu Jul  8 23:21:31
2010
@@ -19,6 +19,7 @@ class RealmsController < ApplicationCont
 
   def show
     @realm = driver.realm( credentials, :id => params[:id] )
+    puts "REALM IS #{@realm.inspect}"
     respond_to do |format|
       format.html
       format.json

Modified: incubator/deltacloud/trunk/framework/app/models/instance.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/framework/app/models/instance.rb?rev=962079&r1=962078&r2=962079&view=diff
==============================================================================
--- incubator/deltacloud/trunk/framework/app/models/instance.rb (original)
+++ incubator/deltacloud/trunk/framework/app/models/instance.rb Thu Jul  8 23:21:31 2010
@@ -5,6 +5,7 @@ class Instance < BaseModel
   attr_accessor :image_id
   attr_accessor :flavor_id
   attr_accessor :name
+  attr_accessor :realm_id
   attr_accessor :state
   attr_accessor :actions
   attr_accessor :public_addresses
@@ -16,4 +17,4 @@ class Instance < BaseModel
    self.public_addresses = [] if self.public_addresses.nil?
    self.private_addresses = [] if self.private_addresses.nil?
   end
-end
\ No newline at end of file
+end

Modified: incubator/deltacloud/trunk/framework/app/views/instances/index.html.erb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/framework/app/views/instances/index.html.erb?rev=962079&r1=962078&r2=962079&view=diff
==============================================================================
--- incubator/deltacloud/trunk/framework/app/views/instances/index.html.erb (original)
+++ incubator/deltacloud/trunk/framework/app/views/instances/index.html.erb Thu Jul  8 23:21:31
2010
@@ -18,6 +18,9 @@
       Flavor
     </th>
     <th>
+      Realm
+    </th>
+    <th>
       State
     </th>
     <th>
@@ -39,7 +42,18 @@
         <%= link_to instance.image_id, image_url( instance.image_id ) %>
       </td>
       <td>
-        <%= link_to instance.flavor_id, flavor_url( instance.flavor_id ) %>
+        <% if ( instance.flavor_id ) %>
+          <%= link_to instance.flavor_id, flavor_url( instance.flavor_id ) %>
+        <% else %>
+          default
+        <% end %>
+      </td>
+      <td>
+        <% if ( instance.realm_id ) %>
+          <%= link_to instance.realm_id, realm_url( instance.realm_id ) %>
+        <% else %>
+          default
+        <% end %>
       </td>
       <td>
         <%= instance.state %>

Modified: incubator/deltacloud/trunk/framework/app/views/instances/new.html.erb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/framework/app/views/instances/new.html.erb?rev=962079&r1=962078&r2=962079&view=diff
==============================================================================
--- incubator/deltacloud/trunk/framework/app/views/instances/new.html.erb (original)
+++ incubator/deltacloud/trunk/framework/app/views/instances/new.html.erb Thu Jul  8 23:21:31
2010
@@ -7,7 +7,7 @@
   <%= hidden_field_tag :image_id, @instance.image_id %>
   <label>Instance Name: </label><%= text_field_tag 'name', '', :size =>
30 %>
   <% if !@flavors.empty? %>
-    <h3>Pick Yer Flavor</h3>
+    <h3>What flavor of machine?</h3>
     <% for flavor in @flavors %>
       <div class="radio-group">
         <label for="flavor_id_<%=flavor.id%>">

Modified: incubator/deltacloud/trunk/framework/app/views/instances/show.html.erb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/framework/app/views/instances/show.html.erb?rev=962079&r1=962078&r2=962079&view=diff
==============================================================================
--- incubator/deltacloud/trunk/framework/app/views/instances/show.html.erb (original)
+++ incubator/deltacloud/trunk/framework/app/views/instances/show.html.erb Thu Jul  8 23:21:31
2010
@@ -32,7 +32,23 @@
       Flavor
     </dt>
     <dd>
-      <%= link_to @instance.flavor_id, flavor_url( @instance.flavor_id ) %>
+      <% if ( @instance.flavor_id ) %>
+        <%= link_to @instance.flavor_id, flavor_url( @instance.flavor_id ) %>
+      <% else %>
+        default
+      <% end %>
+    </dd>
+  </di>
+  <di>
+    <dt>
+      Realm
+    </dt>
+    <dd>
+      <% if ( @instance.realm_id ) %>
+        <%= link_to @instance.realm_id, realm_url( @instance.realm_id ) %>
+      <% else %>
+        default
+      <% end %>
     </dd>
   </di>
   <di>

Modified: incubator/deltacloud/trunk/framework/app/views/realms/index.html.erb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/framework/app/views/realms/index.html.erb?rev=962079&r1=962078&r2=962079&view=diff
==============================================================================
--- incubator/deltacloud/trunk/framework/app/views/realms/index.html.erb (original)
+++ incubator/deltacloud/trunk/framework/app/views/realms/index.html.erb Thu Jul  8 23:21:31
2010
@@ -10,6 +10,9 @@
       Name
     </th>
     <th>
+      State
+    </th>
+    <th>
       Limit
     </th>
   </tr>
@@ -22,6 +25,9 @@
         <%= realm.name %>
       </td>
       <td>
+        <%= realm.state %>
+      </td>
+      <td>
         <%= realm.limit %>
       </td>
     </tr>

Modified: incubator/deltacloud/trunk/framework/app/views/realms/show.html.erb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/framework/app/views/realms/show.html.erb?rev=962079&r1=962078&r2=962079&view=diff
==============================================================================
--- incubator/deltacloud/trunk/framework/app/views/realms/show.html.erb (original)
+++ incubator/deltacloud/trunk/framework/app/views/realms/show.html.erb Thu Jul  8 23:21:31
2010
@@ -11,6 +11,14 @@
   </di>
   <di>
     <dt>
+      State
+    </dt>
+    <dd>
+      <%= @realm.state %>
+    </dd>
+  </di>
+  <di>
+    <dt>
       Limit
     </dt>
     <dd>

Modified: incubator/deltacloud/trunk/framework/lib/converters/xml_converter.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/framework/lib/converters/xml_converter.rb?rev=962079&r1=962078&r2=962079&view=diff
==============================================================================
--- incubator/deltacloud/trunk/framework/lib/converters/xml_converter.rb (original)
+++ incubator/deltacloud/trunk/framework/lib/converters/xml_converter.rb Thu Jul  8 23:21:31
2010
@@ -1,11 +1,13 @@
 require 'flavor'
 
+require 'realm'
+
 module Converters
 
-  ALIASES = {
+  ( ALIASES = {
     :owner=>nil,
     :volume=>:storage_volume,
-  }
+  } ) unless defined?( ALIASES )
 
   def self.url_type(type)
     type = type.to_sym
@@ -25,6 +27,7 @@ module Converters
     end 
 
     def convert(obj, builder=nil)
+      puts "CONVERT #{obj.inspect} #{obj.class} #{obj.class == Realm} #{obj.class == Flavor}"
       builder ||= Builder::XmlMarkup.new( :indent=>2 )
       if ( obj.is_a?( Array ) )
         builder.__send__( @type.to_s.pluralize.gsub( /_/, '-' ).to_sym ) do

Modified: incubator/deltacloud/trunk/framework/lib/deltacloud/base_driver.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/framework/lib/deltacloud/base_driver.rb?rev=962079&r1=962078&r2=962079&view=diff
==============================================================================
--- incubator/deltacloud/trunk/framework/lib/deltacloud/base_driver.rb (original)
+++ incubator/deltacloud/trunk/framework/lib/deltacloud/base_driver.rb Thu Jul  8 23:21:31
2010
@@ -26,7 +26,7 @@ module DeltaCloud
       nil
     end
 
-    def realms(credentials, ops)
+    def realms(credentials, opts=nil)
       []
     end
 



Mime
View raw message