5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-16 20:46:22 +00:00

informar hace cuánto se actualizaron los datos

This commit is contained in:
f 2021-10-08 18:24:19 -03:00
parent df2b66afe8
commit a2e4e0ab89
4 changed files with 12 additions and 6 deletions

View file

@ -19,6 +19,7 @@ class StatsController < ApplicationController
@chart_params = { interval: interval }
hostnames
last_stat
end
# Genera un gráfico de visitas por dominio asociado a este sitio
@ -40,6 +41,10 @@ class StatsController < ApplicationController
private
def last_stat
@last_stat ||= Stat.last
end
# TODO: Eliminar cuando mergeemos referer-origin
def hostnames
@hostnames ||= [@site.hostname, @site.alternative_hostnames].flatten

View file

@ -2,6 +2,11 @@
.col
%h1= t('.title')
%p.lead= t('.help')
%p
%small
= t('.last_update')
%time{ datetime: @last_stat.created_at }
"#{time_ago_in_words @last_stat.created_at}."
.mb-3
- StatsController::INTERVALS.each do |interval|

View file

@ -252,9 +252,7 @@ en:
help: |
These statistics show information about how your site is generated and
how many resources it uses.
build:
average: 'Average building time'
maximum: 'Maximum building time'
last_update: 'Updated every hour. Last update on '
hour: 'Hourly'
day: 'Daily'
week: 'Weekly'

View file

@ -257,9 +257,7 @@ es:
help: |
Las estadísticas visibilizan información sobre cómo se genera y
cuántos recursos utiliza tu sitio.
build:
average: 'Tiempo promedio de generación'
maximum: 'Tiempo máximo de generación'
last_update: 'Actualizadas cada hora. Última actualización hace '
hour: 'Por hora'
day: 'Diarias'
week: 'Semanales'