mirror of
https://github.com/internetee/registry.git
synced 2025-05-18 10:19:45 +02:00
Merge branch '114554395-log_limits' into staging
This commit is contained in:
commit
664c79e248
5 changed files with 34 additions and 5 deletions
|
@ -1,8 +1,8 @@
|
||||||
class Admin::AccountActivitiesController < AdminController
|
class Admin::AccountActivitiesController < AdminController
|
||||||
load_and_authorize_resource
|
load_and_authorize_resource
|
||||||
|
before_action :set_default_dates, only: [:index]
|
||||||
|
|
||||||
def index # rubocop: disable Metrics/AbcSize
|
def index # rubocop: disable Metrics/AbcSize
|
||||||
params[:q] ||= {}
|
|
||||||
|
|
||||||
ca_cache = params[:q][:created_at_lteq]
|
ca_cache = params[:q][:created_at_lteq]
|
||||||
begin
|
begin
|
||||||
|
@ -41,4 +41,13 @@ class Admin::AccountActivitiesController < AdminController
|
||||||
|
|
||||||
params[:q][:created_at_lteq] = ca_cache
|
params[:q][:created_at_lteq] = ca_cache
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def set_default_dates
|
||||||
|
params[:q] ||= {}
|
||||||
|
|
||||||
|
if params[:q][:created_at_gteq].nil? && params[:q][:created_at_lteq].nil?
|
||||||
|
params[:q][:created_at_gteq] = Time.now.strftime("%Y-%m-%d")
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
class Admin::EppLogsController < AdminController
|
class Admin::EppLogsController < AdminController
|
||||||
load_and_authorize_resource class: ApiLog::EppLog
|
load_and_authorize_resource class: ApiLog::EppLog
|
||||||
|
before_action :set_default_dates, only: [:index]
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@q = ApiLog::EppLog.search(params[:q])
|
@q = ApiLog::EppLog.search(params[:q])
|
||||||
|
@ -10,4 +11,13 @@ class Admin::EppLogsController < AdminController
|
||||||
def show
|
def show
|
||||||
@epp_log = ApiLog::EppLog.find(params[:id])
|
@epp_log = ApiLog::EppLog.find(params[:id])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def set_default_dates
|
||||||
|
params[:q] ||= {}
|
||||||
|
|
||||||
|
if params[:q][:created_at_gteq].nil? && params[:q][:created_at_lteq].nil?
|
||||||
|
params[:q][:created_at_gteq] = Time.now.strftime("%Y-%m-%d")
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
class Admin::ReppLogsController < AdminController
|
class Admin::ReppLogsController < AdminController
|
||||||
load_and_authorize_resource class: ApiLog::ReppLog
|
load_and_authorize_resource class: ApiLog::ReppLog
|
||||||
|
before_action :set_default_dates, only: [:index]
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@q = ApiLog::ReppLog.search(params[:q])
|
@q = ApiLog::ReppLog.search(params[:q])
|
||||||
|
@ -10,4 +11,13 @@ class Admin::ReppLogsController < AdminController
|
||||||
def show
|
def show
|
||||||
@repp_log = ApiLog::ReppLog.find(params[:id])
|
@repp_log = ApiLog::ReppLog.find(params[:id])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def set_default_dates
|
||||||
|
params[:q] ||= {}
|
||||||
|
|
||||||
|
if params[:q][:created_at_gteq].nil? && params[:q][:created_at_lteq].nil?
|
||||||
|
params[:q][:created_at_gteq] = Time.now.strftime("%Y-%m-%d")
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -29,11 +29,11 @@
|
||||||
.col-md-3
|
.col-md-3
|
||||||
.form-group
|
.form-group
|
||||||
= f.label t(:created_after)
|
= f.label t(:created_after)
|
||||||
= f.search_field :created_at_gteq, class: 'form-control', placeholder: t(:created_after), autocomplete: 'off'
|
= f.search_field :created_at_gteq, value: params[:q][:created_at_gteq], class: 'form-control datepicker', placeholder: t(:created_after), autocomplete: 'off'
|
||||||
.col-md-3
|
.col-md-3
|
||||||
.form-group
|
.form-group
|
||||||
= f.label t(:created_before)
|
= f.label t(:created_before)
|
||||||
= f.search_field :created_at_lteq, class: 'form-control', placeholder: t(:created_before), autocomplete: 'off'
|
= f.search_field :created_at_lteq, value: params[:q][:created_at_lteq], class: 'form-control datepicker', placeholder: t(:created_before), autocomplete: 'off'
|
||||||
.col-md-3{style: 'padding-top: 25px;'}
|
.col-md-3{style: 'padding-top: 25px;'}
|
||||||
%button.btn.btn-primary
|
%button.btn.btn-primary
|
||||||
|
|
||||||
|
|
|
@ -29,11 +29,11 @@
|
||||||
.col-md-3
|
.col-md-3
|
||||||
.form-group
|
.form-group
|
||||||
= f.label t(:created_after)
|
= f.label t(:created_after)
|
||||||
= f.search_field :created_at_gteq, class: 'form-control', placeholder: t(:created_after), autocomplete: 'off'
|
= f.search_field :created_at_gteq, value: params[:q][:created_at_gteq], class: 'form-control datepicker', placeholder: t(:created_after), autocomplete: 'off'
|
||||||
.col-md-3
|
.col-md-3
|
||||||
.form-group
|
.form-group
|
||||||
= f.label t(:created_before)
|
= f.label t(:created_before)
|
||||||
= f.search_field :created_at_lteq, class: 'form-control', placeholder: t(:created_before), autocomplete: 'off'
|
= f.search_field :created_at_lteq, value: params[:q][:created_at_lteq], class: 'form-control datepicker', placeholder: t(:created_before), autocomplete: 'off'
|
||||||
.col-md-3{style: 'padding-top: 25px;'}
|
.col-md-3{style: 'padding-top: 25px;'}
|
||||||
%button.btn.btn-primary
|
%button.btn.btn-primary
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue