Commit 3fc8aa2c authored by Tiago Botelho's avatar Tiago Botelho Committed by Jose

Add environments list instance variable to environment metrics view

parent cd578941
......@@ -6,13 +6,11 @@ class Projects::EnvironmentsController < Projects::ApplicationController
before_action :authorize_update_environment!, only: [:edit, :update]
before_action :authorize_admin_environment!, only: [:terminal, :terminal_websocket_authorize]
before_action :environment, only: [:show, :edit, :update, :stop, :terminal, :terminal_websocket_authorize, :metrics]
before_action :environments, only: [:index, :metrics]
before_action :verify_api_request!, only: :terminal_websocket_authorize
before_action :expire_etag_cache, only: [:index]
def index
@environments = project.environments
.with_state(params[:scope] || :available)
respond_to do |format|
format.html
format.json do
......@@ -165,4 +163,8 @@ class Projects::EnvironmentsController < Projects::ApplicationController
def environment
@environment ||= project.environments.find(params[:id])
end
def environments
@environments ||= project.environments.with_state(params[:scope] || :available)
end
end
......@@ -8,6 +8,7 @@
%h3
Environment:
= link_to @environment.name, environment_path(@environment)
= @environments.to_a
#prometheus-graphs{ data: { "settings-path": edit_project_service_path(@project, 'prometheus'),
"clusters-path": project_clusters_path(@project),
......
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