agregar opciones a cada recurso
This commit is contained in:
parent
224ea1ebc5
commit
833213ec80
2 changed files with 7 additions and 1 deletions
|
@ -10,6 +10,12 @@ class StatsController < ApplicationController
|
|||
|
||||
INTERVALS = %i[hour day week month year].freeze
|
||||
RESOURCES = %i[builds space_used build_time].freeze
|
||||
EXTRA_OPTIONS = {
|
||||
builds: {},
|
||||
space_used: { bytes: true },
|
||||
build_time: {}
|
||||
}.freeze
|
||||
|
||||
|
||||
# XXX: Permitir a Chart.js inyectar su propio CSS
|
||||
content_security_policy only: :index do |policy|
|
||||
|
|
|
@ -21,4 +21,4 @@
|
|||
.mb-3
|
||||
%h2= t(".resources.#{resource}.title")
|
||||
%p.lead= t(".resources.#{resource}.description")
|
||||
= line_chart site_stats_resources_path(resource: resource, **@chart_params), **@chart_options
|
||||
= line_chart site_stats_resources_path(resource: resource, **@chart_params), **@chart_options.merge(StatsController::EXTRA_OPTIONS[resource])
|
||||
|
|
Loading…
Reference in a new issue