[refs #2161] Add refresh option to statistics

This commit is contained in:
konstantin.grabar 2011-10-31 19:57:44 +04:00
parent ea0be5cd97
commit de959bb527
4 changed files with 14 additions and 0 deletions

View File

@ -5,4 +5,11 @@ class DownloadsController < ApplicationController
def index
@downloads = Download.paginate :page => params[:page], :per_page => 30
end
def refresh
Download.rotate_nginx_log
Download.send_later :parse_and_remove_nginx_log
redirect_to downloads_path, :notice => t('flash.downloads.statistics_refreshed')
end
end

View File

@ -2,6 +2,7 @@
.content
%h2.title
= t("layout.downloads.title")
%h3= t("layout.downloads.message")
.inner
%table.table
%tr

View File

@ -32,6 +32,8 @@ ru:
downloads:
title: Статистика закачек пакетов
message: Обновляется автоматически каждые 24 часа
refresh_btn: Обновить
auto_build_lists:
header: Проекты с автоматической сборкой
@ -289,6 +291,9 @@ ru:
project_version_not_found: версия не найден
flash:
downloads:
statistics_refreshed: Статистика обновлена
collaborators:
successfuly_changed: Список коллабораторов успешно изменен
error_in_changing: Ошибка изменения списка коллабораторов

View File

@ -20,6 +20,7 @@ Rosa::Application.routes.draw do
#resources :downloads, :only => :index
match 'statistics/' => 'downloads#index', :as => :downloads
match 'statistics/refresh' => 'downloads#refresh', :as => :downloads_refresh
resources :categories do
get :platforms, :on => :collection