Class: AdministrationController
Overview
This is a top-level class documentation comment for the Administration Controller
Constant Summary
ProjectsHelper::CLASSIFIER, ProjectsHelper::CLASSIFIER_ANNOTATION
Instance Method Summary
collapse
#destroy_redirect
#json_request?
Methods included from LogRecent
#log_user_recent_route
Methods included from Cookies
#digest_cookie, #digested_cookie_exists?
Methods included from Whitelist
#whitelist_constantize
#cumulative_gb_per_year, #document_cumulative_gb_per_year, #document_gb_per_year, #gb_per_year, #image_cumulative_gb_per_year, #image_gb_per_year, #invalid_object, #project_classification, #project_link, #project_matches, #project_tag, #projects_list, #projects_search_form, #taxonworks_classification, #week_in_review_graphs
#intercept_api
#intercept_project, #intercept_user, #intercept_user_or_project, #project_token_authenticate, #token_authenticate
Instance Method Details
#cached_maps_status ⇒ Object
22
23
|
# File 'app/controllers/administration_controller.rb', line 22
def cached_maps_status
end
|
#data_class_summary ⇒ Object
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
# File 'app/controllers/administration_controller.rb', line 25
def data_class_summary
@klass = params.require(:klass)&.safe_constantize
@time_span = params.require(:time_span)
@target = params.require(:target)
@projects = params[:project_id].blank? ? Project.all : Project.where(id: params[:project_id])
@start_date = (params[:start_date].presence || 1000.years.ago.to_date)
@end_date = (params[:end_date].presence || 1.day.from_now.to_date)
@data = []
@projects.each do |u|
d = {
id: u.id,
name: u.name
}
data = @klass.where(project: u).where("#{@klass.table_name}.#{@target} BETWEEN ? AND ?", @start_date, @end_date)
d[:data] = data.send("group_by_#{@time_span}", "#{@target}".to_sym ).count
@data.push d
end
@data = @data.select{|h| !h[:data].empty?}
data_labels = @data.collect{|a| a[:data].keys}.flatten.uniq.sort
if a = @data.first
data_labels.each do |k|
if a[:data][k].nil?
a[:data][k] = 0
end
end
a[:data] = a[:data].sort.to_h
end
end
|
#data_health ⇒ Object
16
17
|
# File 'app/controllers/administration_controller.rb', line 16
def data_health
end
|
#data_overview ⇒ Object
13
14
|
# File 'app/controllers/administration_controller.rb', line 13
def data_overview
end
|
#data_reindex ⇒ Object
19
20
|
# File 'app/controllers/administration_controller.rb', line 19
def data_reindex
end
|
#index ⇒ Object
7
8
|
# File 'app/controllers/administration_controller.rb', line 7
def index
end
|
#user_activity ⇒ Object
10
11
|
# File 'app/controllers/administration_controller.rb', line 10
def user_activity
end
|