BigW Consortium Gitlab

Add cluster counts to ClustersController#index

parent 29ef25cc
...@@ -9,7 +9,9 @@ class Projects::ClustersController < Projects::ApplicationController ...@@ -9,7 +9,9 @@ class Projects::ClustersController < Projects::ApplicationController
def index def index
@clusters ||= project.clusters.page(params[:page]).per(20).map { |cluster| cluster.present(current_user: current_user) } @clusters ||= project.clusters.page(params[:page]).per(20).map { |cluster| cluster.present(current_user: current_user) }
@clusters_count = @clusters.count @active_count = project.clusters.enabled.count
@inactive_count = project.clusters.disabled.count
@all_count = @active_count + @inactive_count
end end
def login def login
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment