blob: 4bdf4c12cac5552ef6031cf91f2ecd2d989ea4e2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# frozen_string_literal: true
class Projects::GrafanaApiController < Projects::ApplicationController
include RenderServiceResults
def proxy
result = ::Grafana::ProxyService.new(
project,
params[:datasource_id],
params[:proxy_path],
query_params.to_h
).execute
return continue_polling_response if result.nil?
return error_response(result) if result[:status] == :error
success_response(result)
end
private
def query_params
params.permit(:query, :start, :end, :step)
end
end
|