debian-mirror-gitlab/app/controllers/groups/observability_controller.rb

35 lines
748 B
Ruby
Raw Normal View History

2022-10-11 01:57:18 +05:30
# frozen_string_literal: true
module Groups
class ObservabilityController < Groups::ApplicationController
2023-03-04 22:38:38 +05:30
include ::Observability::ContentSecurityPolicy
2022-10-11 01:57:18 +05:30
2023-03-04 22:38:38 +05:30
feature_category :tracing
2022-10-11 01:57:18 +05:30
2023-01-13 00:05:48 +05:30
before_action :check_observability_allowed
2022-10-11 01:57:18 +05:30
2023-01-13 00:05:48 +05:30
def dashboards
render_observability
end
2022-10-11 01:57:18 +05:30
2023-01-13 00:05:48 +05:30
def manage
render_observability
end
2022-10-11 01:57:18 +05:30
2023-01-13 00:05:48 +05:30
def explore
render_observability
2022-10-11 01:57:18 +05:30
end
private
2023-01-13 00:05:48 +05:30
def render_observability
render 'observability', layout: 'group', locals: { base_layout: 'layouts/fullscreen' }
end
2022-10-11 01:57:18 +05:30
def check_observability_allowed
2023-03-04 22:38:38 +05:30
return render_404 unless Gitlab::Observability.observability_url.present?
2022-10-11 01:57:18 +05:30
render_404 unless can?(current_user, :read_observability, @group)
end
end
end