mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-16 14:41:41 +00:00
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
|
INTERVALS = %i[hour day week month year].freeze
|
||||||
RESOURCES = %i[builds space_used build_time].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
|
# XXX: Permitir a Chart.js inyectar su propio CSS
|
||||||
content_security_policy only: :index do |policy|
|
content_security_policy only: :index do |policy|
|
||||||
|
|
|
@ -21,4 +21,4 @@
|
||||||
.mb-3
|
.mb-3
|
||||||
%h2= t(".resources.#{resource}.title")
|
%h2= t(".resources.#{resource}.title")
|
||||||
%p.lead= t(".resources.#{resource}.description")
|
%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