* also couple of small cleanup changes

---
 src/app/controllers/dashboard_controller.rb |   13 +++++++++----
 src/app/services/graph_service.rb           |    1 +
 src/app/views/dashboard/summary.haml        |    3 ++-
 src/public/stylesheets/components.css       |    6 ++++++
 4 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/src/app/controllers/dashboard_controller.rb 
b/src/app/controllers/dashboard_controller.rb
index 845901f..bcd2073 100644
--- a/src/app/controllers/dashboard_controller.rb
+++ b/src/app/controllers/dashboard_controller.rb
@@ -31,8 +31,7 @@ class DashboardController < ApplicationController
     return params[:ajax] == "true"
   end
 
-  def provider_qos_graph(opts = {})
-    entity = nil
+  def provider_qos_graph
     params[:provider] = Provider.find(params[:id])
     graph = GraphService.dashboard_qos(current_user, 
params)[params[:provider]][Graph::QOS_AVG_TIME_TO_SUBMIT]
     respond_to do |format|
@@ -40,8 +39,7 @@ class DashboardController < ApplicationController
     end
   end
 
-  def account_quota_graph(opts = {})
-    entity = nil
+  def account_quota_graph
     params[:account] = CloudAccount.find(params[:id])
     graph = GraphService.dashboard_quota(current_user, 
params)[params[:account]][Graph::QUOTA_INSTANCES_IN_USE]
     respond_to do |format|
@@ -49,6 +47,13 @@ class DashboardController < ApplicationController
     end
   end
 
+  def provider_instances_graph
+    graph = GraphService.dashboard_instances_by_provider(current_user, 
params)[Graph::INSTANCES_BY_PROVIDER_PIE]
+    respond_to do |format|
+      format.svg  { render :xml => graph.svg}
+    end
+  end
+
   def index
     # FIXME filter to just those that the user has access to
     @cloud_accounts = CloudAccount.find(:all)
diff --git a/src/app/services/graph_service.rb 
b/src/app/services/graph_service.rb
index f56bbfc..6aa5b5b 100644
--- a/src/app/services/graph_service.rb
+++ b/src/app/services/graph_service.rb
@@ -49,6 +49,7 @@ class GraphService
     #FIXME add permission checks to see if user can view this graph
     graphs = Hash.new
     graphs[Graph::INSTANCES_BY_PROVIDER_PIE] = instances_by_provider_pie(opts)
+    graphs
   end
 
   private
diff --git a/src/app/views/dashboard/summary.haml 
b/src/app/views/dashboard/summary.haml
index d8813a1..7cb3cb3 100644
--- a/src/app/views/dashboard/summary.haml
+++ b/src/app/views/dashboard/summary.haml
@@ -90,7 +90,8 @@
       %li
         Total instances
         .count= @stats[:total_instances]
-    .instance_graph
+    #provider_instances_graph
+      %object{ :data => url_for(:action => :provider_instances_graph, :width 
=> 200, :height => 100), :type => 'image/svg+xml'}
 
 .dashboard_column
   #quota_usage_dashboard_section
diff --git a/src/public/stylesheets/components.css 
b/src/public/stylesheets/components.css
index 99fb5d0..4007228 100644
--- a/src/public/stylesheets/components.css
+++ b/src/public/stylesheets/components.css
@@ -228,6 +228,12 @@ ul.nav li:hover {
   float: left;
 }
 
+#provider_instances_graph {
+  width: 200px;
+  height: 250px;
+  float: left;
+}
+
 #quota_usage_dashboard_section {
   width: 390px;
   border: 1px solid black;
-- 
1.6.2.5

_______________________________________________
deltacloud-devel mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/deltacloud-devel

Reply via email to