diff --git a/app/controllers/stats_controller.rb b/app/controllers/stats_controller.rb index d41573e..8045a65 100644 --- a/app/controllers/stats_controller.rb +++ b/app/controllers/stats_controller.rb @@ -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| diff --git a/app/views/stats/index.haml b/app/views/stats/index.haml index 0251955..101dee1 100644 --- a/app/views/stats/index.haml +++ b/app/views/stats/index.haml @@ -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])