[PATCH conductor] BZ815784 added Pool Family Quota Used column to Pool Families table

jtomasek at redhat.com jtomasek at redhat.com
Thu May 24 14:45:47 UTC 2012


From: Jiri Tomasek <jtomasek at redhat.com>

---
 src/app/models/pool.rb                      |    2 ++
 src/app/views/pool_families/_list.html.haml |    3 +++
 src/config/locales/en.yml                   |    1 +
 3 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/app/models/pool.rb b/src/app/models/pool.rb
index a47a64a..9e5d31a 100644
--- a/src/app/models/pool.rb
+++ b/src/app/models/pool.rb
@@ -107,6 +107,7 @@ class Pool < ActiveRecord::Base
     all_failed = instances.failed
     failed = (user.nil? || all_failed.empty? ? all_failed :
               all_failed.list_for_user(user, Privilege::VIEW))
+    pool_family_quota_percent = pool_family.quota.percentage_used quota.running_instances
     statistics = {
       :cloud_providers => instances.includes(:provider_account).collect{|i| i.provider_account}.uniq.count,
       :deployments => deployments.size,
@@ -119,6 +120,7 @@ class Pool < ActiveRecord::Base
       :used_quota => quota.running_instances,
       :quota_percent => number_to_percentage(quota.percentage_used,
                                              :precision => 0),
+      :pool_family_quota_percent => number_to_percentage(pool_family_quota_percent, :precision => 0),
       :available_quota => avail
     }
     #end
diff --git a/src/app/views/pool_families/_list.html.haml b/src/app/views/pool_families/_list.html.haml
index cb590f3..0d82f45 100644
--- a/src/app/views/pool_families/_list.html.haml
+++ b/src/app/views/pool_families/_list.html.haml
@@ -26,6 +26,7 @@
           %th= t("pool_families.index.pending_instances")
           %th= t("pool_families.index.failed_instances")
           %th= t("pool_families.index.quota_used")
+          %th= t("pool_families.index.pool_family_quota_used")
           %th= t("pool_families.index.active_instances")
           %th= t("pool_families.index.available_instances")
           %th= t("pool_families.index.enabled")
@@ -40,6 +41,7 @@
             %td= pool_stats[:instances_pending]
             %td= pool_stats[:instances_failed_count]
             %td= pool_stats[:quota_percent]
+            %td= pool_stats[:pool_family_quota_percent]
             %td= pool_stats[:used_quota]
             %td= pool_stats[:available_quota].nil? ? raw('&infin;') : pool_stats[:available_quota]
             %td= pool.enabled? ? t("pool_families.index.answer_yes") : t("pool_families.index.answer_no")
@@ -51,6 +53,7 @@
           %td= family_stats[:total_instances]
           %td= family_stats[:instances_pending]
           %td= family_stats[:instances_failed]
+          %td
           %td= family_stats[:quota_percent]
           %td= family_stats[:used_quota]
           %td= family_stats[:available_quota].nil? ? raw('&infin;') : family_stats[:available_quota]
diff --git a/src/config/locales/en.yml b/src/config/locales/en.yml
index 7b1ca00..f28e9b3 100644
--- a/src/config/locales/en.yml
+++ b/src/config/locales/en.yml
@@ -677,6 +677,7 @@ en:
       total_instancies: "Total Inst."
       pending_instances: "Pending Inst."
       quota_used: "Quota Used"
+      pool_family_quota_used: "Pool Family Quota Used"
       active_instances: "Active Inst."
       available_instances: "Available Inst."
       failed_instances: "Failed Inst."
-- 
1.7.7.6




More information about the aeolus-devel mailing list