incubator-deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@redhat.com
Subject [PATCH core 3/4] Added JQuery code to display select box for keys when creating a new instance
Date Tue, 24 Aug 2010 14:04:32 GMT
---
 server/public/javascripts/application.js |    9 +++++++++
 server/views/instances/new.html.haml     |    8 +++++++-
 2 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/server/public/javascripts/application.js b/server/public/javascripts/application.js
index 80e1d1c..32d77d7 100644
--- a/server/public/javascripts/application.js
+++ b/server/public/javascripts/application.js
@@ -29,4 +29,13 @@ $(document).ready(function() {
     return false;
   })
 
+  if ($("select[name=keyname]").length) {
+    $.getJSON('/api/keys?format=json', function(data) {
+      $("select[name=keyname]").empty()
+      $.each(data.keys, function(i, key){
+        $("select[name=keyname]").append('<option value="'+key.id+'">'+key.id+'</option>')
+      })
+    })
+  }
+
 })
diff --git a/server/views/instances/new.html.haml b/server/views/instances/new.html.haml
index 6d67c2d..3846886 100644
--- a/server/views/instances/new.html.haml
+++ b/server/views/instances/new.html.haml
@@ -13,7 +13,13 @@
     %p
       %label
         Instance Keyname:
-        %input{:name => 'keyname', :size => 30 }
+        %select{:name => 'keyname'}
+          %option loading...
+  -if driver_has_feature?(:create_multiple_instance)
+    %p
+      %label
+        Number of instances to launch:
+        %input{:name => 'amount', :size => 30, :value => '1' }
   - if !@hardware_profiles.empty?
     %h3 What size machine?
     - for hwp in @hardware_profiles
-- 
1.7.2


Mime
View raw message