Return-Path: Delivered-To: apmail-incubator-deltacloud-dev-archive@minotaur.apache.org Received: (qmail 30669 invoked from network); 24 Aug 2010 14:04:17 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 24 Aug 2010 14:04:17 -0000 Received: (qmail 44376 invoked by uid 500); 24 Aug 2010 14:04:17 -0000 Delivered-To: apmail-incubator-deltacloud-dev-archive@incubator.apache.org Received: (qmail 44330 invoked by uid 500); 24 Aug 2010 14:04:17 -0000 Mailing-List: contact deltacloud-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: deltacloud-dev@incubator.apache.org Delivered-To: mailing list deltacloud-dev@incubator.apache.org Received: (qmail 44322 invoked by uid 99); 24 Aug 2010 14:04:16 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Aug 2010 14:04:16 +0000 X-ASF-Spam-Status: No, hits=-5.0 required=10.0 tests=RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of mfojtik@redhat.com designates 209.132.183.28 as permitted sender) Received: from [209.132.183.28] (HELO mx1.redhat.com) (209.132.183.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Aug 2010 14:04:10 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o7OE3npI027252 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 24 Aug 2010 10:03:50 -0400 Received: from redhat.com (dhcp-2-247.brq.redhat.com [10.34.2.247]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with SMTP id o7OE3lhk003502; Tue, 24 Aug 2010 10:03:48 -0400 Received: by redhat.com (sSMTP sendmail emulation); Tue, 24 Aug 2010 16:04:42 +0200 From: mfojtik@redhat.com To: deltacloud-dev@incubator.apache.org Cc: Michal Fojtik Subject: [PATCH core 3/4] Added JQuery code to display select box for keys when creating a new instance Date: Tue, 24 Aug 2010 16:04:32 +0200 Message-Id: <1282658673-18585-4-git-send-email-mfojtik@redhat.com> In-Reply-To: <1282658673-18585-1-git-send-email-mfojtik@redhat.com> References: <1282658673-18585-1-git-send-email-mfojtik@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 --- 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('') + }) + }) + } + }) 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