Class: Dbviewer::LogsController
Instance Method Summary
collapse
#available_connections, #current_connection_key, #database_manager, #fetch_database_analytics, #fetch_filtered_record_count, #fetch_table_columns, #fetch_table_metadata, #fetch_table_record_count, #fetch_table_records, #fetch_table_relationships, #fetch_tables, #get_adapter_name, #get_database_name, #safe_quote_table_name, #switch_connection, #table_query_operations
Instance Method Details
#destroy_all ⇒ Object
23
24
25
26
27
28
|
# File 'app/controllers/dbviewer/logs_controller.rb', line 23
def destroy_all
dbviewer_logger.clear
flash[:success] = "Query logs cleared successfully"
redirect_to logs_path
end
|
#index ⇒ Object
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# File 'app/controllers/dbviewer/logs_controller.rb', line 6
def index
@queries = dbviewer_logger.recent_queries(
limit: @limit,
table_filter: @table_filter,
request_id: @request_id,
min_duration: @min_duration
)
if @request_id.present? || @table_filter.present? || @min_duration.present?
@stats = dbviewer_logger.stats_for_queries(@queries)
@filtered_stats = true
else
@stats = dbviewer_logger.stats
@filtered_stats = false
end
end
|