[PATCH conductor] Autoupdating deployments list on Pools#index
by Imre Farkas
From: Imre Farkas <ifarkas(a)redhat.com>
---
src/app/models/deployment.rb | 1 +
src/app/views/pools/_deployments.html.haml | 24 ++++++++++++++++++++-
src/public/javascripts/backbone/routers.js | 18 +--------------
src/public/javascripts/backbone/views.js | 32 +++------------------------
4 files changed, 29 insertions(+), 46 deletions(-)
diff --git a/src/app/models/deployment.rb b/src/app/models/deployment.rb
index a2aac0a..1e1645c 100644
--- a/src/app/models/deployment.rb
+++ b/src/app/models/deployment.rb
@@ -398,6 +398,7 @@ class Deployment < ActiveRecord::Base
:deployment_state => deployment_state,
:instances_count => instances.count,
:uptime => ApplicationHelper.count_uptime(uptime_1st_instance),
+ :global_uptime => ApplicationHelper.count_uptime(uptime_all),
:pool => {
:name => pool.name,
:id => pool.id,
diff --git a/src/app/views/pools/_deployments.html.haml b/src/app/views/pools/_deployments.html.haml
index 70cfea0..8ffe835 100644
--- a/src/app/views/pools/_deployments.html.haml
+++ b/src/app/views/pools/_deployments.html.haml
@@ -14,4 +14,26 @@
%li.left
%dt=t :uptime
- %dd= count_uptime(deployment.uptime_1st_instance)
\ No newline at end of file
+ %dd= count_uptime(deployment.uptime_1st_instance)
+
+%script#deploymentTemplate{ :type => 'text/x-jquery-tmpl' }
+ :plain
+ <li class="deployment">
+ <h3 class="name">
+ <a href="#{deployment_path('replace_id').sub('replace_id', '${id}')}">${name}</a>
+ #{t 'pools.index.global_uptime'}
+ ${global_uptime}
+ </h3>
+ <dl class="statistics">
+ <ul>
+ <li class="right">
+ <dt class="instances count">#{t 'instances.instances'}</dt>
+ <dd>${instances_count}</dd>
+ </li>
+ <li class="left">
+ <dt>#{t :uptime}</dt>
+ <dd>${uptime}</dd>
+ </li>
+ </ul>
+ </dl>
+ </li>
diff --git a/src/public/javascripts/backbone/routers.js b/src/public/javascripts/backbone/routers.js
index c92ea3d..c49c84b 100644
--- a/src/public/javascripts/backbone/routers.js
+++ b/src/public/javascripts/backbone/routers.js
@@ -11,21 +11,7 @@ Conductor.Routers.Pools = Backbone.Router.extend({
index: function() {
setInterval(function() {
var view = new Conductor.Views.PoolsIndex();
-
- switch(view.currentTab()) {
- case 'pools':
- view.collection = new Conductor.Models.Pools();
- break;
- case 'deployments':
- view.collection = new Conductor.Models.Deployments();
- break;
- case 'instances':
- view.collection = new Conductor.Models.Instances();
- break;
- default:
- return;
- }
-
+ view.collection = new Conductor.Models.Deployments();
view.collection.bind('change', function() { view.render() });
view.collection.fetch({ success: function() {
@@ -69,8 +55,6 @@ Conductor.Routers.Deployments = Backbone.Router.extend({
var view = new Conductor.Views.DeploymentsShow({ model: deployment,
collection: deployment.instances });
- if(view.currentTab() !== 'instances') return;
-
deployment.bind('change', function() { view.render() });
deployment.instances.fetch({success: function(instances) {
diff --git a/src/public/javascripts/backbone/views.js b/src/public/javascripts/backbone/views.js
index 488d083..a54e98c 100644
--- a/src/public/javascripts/backbone/views.js
+++ b/src/public/javascripts/backbone/views.js
@@ -4,34 +4,15 @@ Conductor.Views = Conductor.Views || {}
Conductor.Views.PoolsIndex = Backbone.View.extend({
el: '#content',
- currentTab: function() {
- if($('#details_pools.active').length > 0) {
- return 'pools';
- }
- else if ($('#details_deployments.active').length > 0) {
- return 'deployments';
- }
- else if ($('#details_instances.active').length > 0) {
- return 'instances';
- }
- },
-
template: function() {
- switch(this.currentTab()) {
- case 'pools': return $('#poolTemplate');
- case 'deployments': return $('#deploymentTemplate');
- case 'instances': return $('#instanceTemplate');
- }
+ return $('#deploymentTemplate');
},
render: function() {
- var $template = this.template();
- var $table = this.$('table.checkbox_table > tbody');
- if($table.length === 0 || $template.length === 0) return;
+ $deployments = this.$('ul.deployment-array');
- var checkboxes = Conductor.saveCheckboxes('td :checkbox', $table);
- $table.empty().append($template.tmpl(this.collection.toJSON()))
- Conductor.restoreCheckboxes(checkboxes, 'td :checkbox', $table);
+ var $template = this.template();
+ $deployments.empty().append($template.tmpl(this.collection.toJSON()))
},
});
@@ -81,11 +62,6 @@ Conductor.Views.DeploymentsShow = Backbone.View.extend({
el: '#content',
- currentTab: function() {
- if($('#details_instances.active').length > 0) {
- return 'instances';
- }
- },
render: function() {
var $instances = this.$('ul.instances-array');
if($instances.length === 0) {
--
1.7.6.4
12 years, 5 months
[PATCH conductor] Show pool enabled/disabled status in Environments
by Tomas Sedovic
From: Tomas Sedovic <tomas(a)sedovic.cz>
https://bugzilla.redhat.com/show_bug.cgi?id=765865
---
src/app/views/pool_families/_list.html.haml | 2 ++
src/config/locales/en.yml | 3 +++
2 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/src/app/views/pool_families/_list.html.haml b/src/app/views/pool_families/_list.html.haml
index bcb6136..c1be075 100644
--- a/src/app/views/pool_families/_list.html.haml
+++ b/src/app/views/pool_families/_list.html.haml
@@ -27,6 +27,7 @@
%th= t("pool_families.index.quota_used")
%th= t("pool_families.index.active_instances")
%th= t("pool_families.index.available_instances")
+ %th= t("pool_families.index.enabled")
%th= t("pool_families.index.catalog")
%th
- pool_family.pools.each do |pool|
@@ -39,5 +40,6 @@
%td= pool.statistics[:quota_percent]
%td= pool.statistics[:used_quota]
%td= pool.statistics[:available_quota].nil? ? raw('∞') : pool.statistics[:available_quota]
+ %td= pool.enabled? ? t("pool_families.index.yes") : t("pool_families.index.no")
%td= link_to pool.catalogs.first.name, catalog_path(pool.catalogs.first) if pool.catalogs.any?
%td= link_to t(:edit), edit_pool_path(pool), :class => 'pool_family_button'
diff --git a/src/config/locales/en.yml b/src/config/locales/en.yml
index e3eef1c..01d3c03 100644
--- a/src/config/locales/en.yml
+++ b/src/config/locales/en.yml
@@ -566,6 +566,9 @@ en:
active_instances: "Active Inst."
available_instances: "Available Inst."
failed_instances: "Failed Inst."
+ enabled: Enabled
+ yes: Yes
+ no: No
catalog: "Catalog"
new:
environments: Environments
--
1.7.6.4
12 years, 5 months
BZ 761279/766137 - Handling of imported images (rev2)
by Matt Wagner
Hi all,
Sending this out for hopefully the last time. This is a resent of my
previous send[1], but with a few changes:
* In the course of rebasing on master, I had to deal with the fact that
app/models/image.rb was removed. Rather than re-adding it, it was
decided that it was best to move the image-import logic to
aeolus-image-rubygem and then create a small bit of code to call it
from Conductor. So the aeolus-image-rubygem change is
semi-significant.
* The issue that tsedovic found in images#show is resolved. (It ended up
requiring a ridiculous amount of code.)
* I'm omitting the aeolus-cli changes from the patch, because nothing
has changed from last time and the series was essentially ACKed.
They're still necessary.
Note that the initial patch was ACKed, but in the course of fixing a
small issue and dealing with a large merge conflict (see first bullet
point), I ended up changing things significantly enough that I think
this deserves a resend.
Best,
Matt
[1]
http://lists.fedorahosted.org/pipermail/aeolus-devel/2011-December/007384...
12 years, 5 months
imagefactory initscript and .spec changes
by James Laska
Greetings,
> GIT: [PATCH 1/3] Add /etc/sysconfig/imagefactory support
While debugging/patching imagefactory with calfonso earlier this week, we both
noticed that the default 'imagefactory' command-line options are not
accessible. In order to adjust the default command-line options, it is
required to modify the initscript directly. To resolve this, I've created
/etc/sysconfig/imagefactory to house the initscript configuration that is
sourced from the initscript. The file allows adminstrators to override common
imagefactory command-line options without modifying "code" directly.
> GIT: [PATCH 2/3] Add logrotate support
While discussing this patc, calfonso pointed out that imagefactory would
eventually need logrotation support. This patch adds weekly log rotation.
> GIT: [PATCH 3/3] Use install macro and adjust config perms
Lastly, I noticed the config file permissions were 664. This patch adjusts the
permissions appropriately, and uses the built-in %{__install} rpm macro.
I have rpm packaged and tested these changes locally, and things appear to work
by design. Comments/complaints/suggestions encouraged!
Thanks,
James
12 years, 5 months
[PATCH conductor]
by Jirka Tomasek
This patch implements new Buildpush UI icons and images styling, image
detail styling
12 years, 5 months
[PATCH conductor 1/3] Add "New Image" button to the images list
by Tomas Sedovic
From: Tomas Sedovic <tomas(a)sedovic.cz>
https://www.aeolusproject.org/redmine/issues/2882
---
src/app/views/images/_list.html.haml | 4 +++-
src/config/locales/en.yml | 1 +
2 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/src/app/views/images/_list.html.haml b/src/app/views/images/_list.html.haml
index f4ae8a1..e2c2c80 100644
--- a/src/app/views/images/_list.html.haml
+++ b/src/app/views/images/_list.html.haml
@@ -1,6 +1,8 @@
- content_for :form_header do
%li= restful_submit_tag t("delete"), "destroy", multi_destroy_images_path, 'DELETE', :id => 'delete_button', :class => 'button danger'
- %li= link_to t('images.index.import'), new_image_path(:tab => 'import'), { :class => 'button primary', :id => 'import_image_button'}
+ %li= link_to t('images.import.import_image'), new_image_path(:tab => 'import'), { :class => 'button primary', :id => 'import_image_button'}
+ - if @pool_family
+ %li= link_to t('images.index.new'), new_image_path(:environment => @pool_family), { :class => 'button primary', :id => 'import_image_button'}
= filter_table(@header, @images) do |image|
%tr{:class => cycle('nostripe','stripe')}
diff --git a/src/config/locales/en.yml b/src/config/locales/en.yml
index 3e14332..2e58fee 100644
--- a/src/config/locales/en.yml
+++ b/src/config/locales/en.yml
@@ -701,6 +701,7 @@ en:
os_version: OS Version
architecture: Architecture
last_rebuild: Last Rebuild
+ new: New Image
show:
provider_images: Provider Images
provider_account: Provider Account
--
1.7.6.4
12 years, 5 months
BZ 761279/766137 - Handling of imported images
by Matt Wagner
Hi all,
I had previously sent out a similar patchset[1], but it hasn't been
reviewed and this one builds on it, so I'm resending the whole thing.
This patch won't be terribly effective unless you test it with a build
of Image Factory that uses sloranz's bug/no-template-on-import branch,
which is currently an open pull request[2].
This implements a few changes:
1.) When images are imported, Factory will no longer create a
(pointless, empty) Template object in iwhd for them. This allows us to
create an imported? method on Warehouse objects to detect if images are
imported or not.
2.) We do not offer to upload/push or build imported images, since this
is nonsensical.
3.) Imported images are now tied to a specific Provider Account, not
just a Provider/Target. Existing images had to have this association,
but we weren't setting it for imported images. Now we are.
4.) As a consequence of #3, the UI is changed slightly -- importing an
image prompts for a provider account, not a provider. More
significantly, the aeolus-cli syntax is changed here. Rather than
specifying a --target and a --provider, you just specify a
--provider_account. Conductor can get the rest of the information from
this. For example, you would now run "aeolus-cli import
--provider_account ec2-mawagner --id ami-abc123"
5.) As an incidental benefit, aeolus-cli image import and the Conductor
web UI now call the exact same method to import images. Previously they
were doing similar, but not identical, calls to Factory.
This will resolve BZ #766137 [3] and #761279 [4].
Thanks,
Matt
[1]
https://fedorahosted.org/pipermail/aeolus-devel/2011-December/007280.html
[2] https://github.com/aeolusproject/imagefactory/pull/51
[3] https://bugzilla.redhat.com/show_bug.cgi?id=766137
[4] https://bugzilla.redhat.com/show_bug.cgi?id=761279
12 years, 5 months