From 30025a6ada1344e451aa52ca6345e957aac53e73 Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Sat, 28 Nov 2015 11:10:06 +1100 Subject: [PATCH] Adds a refresh button to log pages, minor column tweaks --- modules/backend/controllers/AccessLogs.php | 5 +++++ .../backend/controllers/accesslogs/_list_toolbar.htm | 12 +++++++++--- modules/backend/lang/en/lang.php | 2 ++ modules/backend/models/accesslog/columns.yaml | 2 ++ modules/system/controllers/EventLogs.php | 7 ++++++- modules/system/controllers/RequestLogs.php | 7 ++++++- .../system/controllers/eventlogs/_list_toolbar.htm | 9 ++++++++- .../system/controllers/requestlogs/_list_toolbar.htm | 9 ++++++++- modules/system/models/eventlog/columns.yaml | 3 +++ modules/system/models/requestlog/columns.yaml | 2 ++ 10 files changed, 51 insertions(+), 7 deletions(-) diff --git a/modules/backend/controllers/AccessLogs.php b/modules/backend/controllers/AccessLogs.php index 6d790df88..a5b701c30 100644 --- a/modules/backend/controllers/AccessLogs.php +++ b/modules/backend/controllers/AccessLogs.php @@ -36,4 +36,9 @@ class AccessLogs extends Controller BackendMenu::setContext('October.System', 'system', 'settings'); SettingsManager::setContext('October.Backend', 'access_logs'); } + + public function index_onRefresh() + { + return $this->listRefresh(); + } } diff --git a/modules/backend/controllers/accesslogs/_list_toolbar.htm b/modules/backend/controllers/accesslogs/_list_toolbar.htm index 449ba7d85..5f9c7802e 100644 --- a/modules/backend/controllers/accesslogs/_list_toolbar.htm +++ b/modules/backend/controllers/accesslogs/_list_toolbar.htm @@ -1,3 +1,9 @@ -
- -
\ No newline at end of file +
+ + + +
diff --git a/modules/backend/lang/en/lang.php b/modules/backend/lang/en/lang.php index 01c4a1c67..be32df335 100644 --- a/modules/backend/lang/en/lang.php +++ b/modules/backend/lang/en/lang.php @@ -130,6 +130,8 @@ return [ 'pagination' => 'Displayed records: :from-:to of :total', 'prev_page' => 'Previous page', 'next_page' => 'Next page', + 'refresh' => 'Refresh', + 'updating' => 'Updating...', 'loading' => 'Loading...', 'setup_title' => 'List Setup', 'setup_help' => 'Use checkboxes to select columns you want to see in the list. You can change position of columns by dragging them up or down.', diff --git a/modules/backend/models/accesslog/columns.yaml b/modules/backend/models/accesslog/columns.yaml index 65c7133c8..e27e84d59 100644 --- a/modules/backend/models/accesslog/columns.yaml +++ b/modules/backend/models/accesslog/columns.yaml @@ -6,6 +6,8 @@ columns: created_at: label: backend::lang.access_log.created_at searchable: yes + type: timetense + width: 160px login: label: backend::lang.access_log.login diff --git a/modules/system/controllers/EventLogs.php b/modules/system/controllers/EventLogs.php index 2bccedb57..99d1d5ae3 100644 --- a/modules/system/controllers/EventLogs.php +++ b/modules/system/controllers/EventLogs.php @@ -40,7 +40,12 @@ class EventLogs extends Controller SettingsManager::setContext('October.System', 'event_logs'); } - public function onEmptyLog() + public function index_onRefresh() + { + return $this->listRefresh(); + } + + public function index_onEmptyLog() { EventLog::truncate(); Flash::success(Lang::get('system::lang.event_log.empty_success')); diff --git a/modules/system/controllers/RequestLogs.php b/modules/system/controllers/RequestLogs.php index f7f77472b..79d06e49e 100644 --- a/modules/system/controllers/RequestLogs.php +++ b/modules/system/controllers/RequestLogs.php @@ -40,7 +40,12 @@ class RequestLogs extends Controller SettingsManager::setContext('October.System', 'request_logs'); } - public function onEmptyLog() + public function index_onRefresh() + { + return $this->listRefresh(); + } + + public function index_onEmptyLog() { RequestLog::truncate(); Flash::success(Lang::get('system::lang.request_log.empty_success')); diff --git a/modules/system/controllers/eventlogs/_list_toolbar.htm b/modules/system/controllers/eventlogs/_list_toolbar.htm index 0adec73c7..3846ac05a 100644 --- a/modules/system/controllers/eventlogs/_list_toolbar.htm +++ b/modules/system/controllers/eventlogs/_list_toolbar.htm @@ -1,4 +1,11 @@
+ + + -
\ No newline at end of file + diff --git a/modules/system/controllers/requestlogs/_list_toolbar.htm b/modules/system/controllers/requestlogs/_list_toolbar.htm index b86e80a1b..720aa4a9d 100644 --- a/modules/system/controllers/requestlogs/_list_toolbar.htm +++ b/modules/system/controllers/requestlogs/_list_toolbar.htm @@ -1,4 +1,11 @@
+ + + -
\ No newline at end of file + diff --git a/modules/system/models/eventlog/columns.yaml b/modules/system/models/eventlog/columns.yaml index 24b10bed7..386a42c03 100644 --- a/modules/system/models/eventlog/columns.yaml +++ b/modules/system/models/eventlog/columns.yaml @@ -6,10 +6,13 @@ columns: id: label: system::lang.event_log.id searchable: yes + width: 75px created_at: label: system::lang.event_log.created_at searchable: yes + width: 160px + type: timetense message: label: system::lang.event_log.message diff --git a/modules/system/models/requestlog/columns.yaml b/modules/system/models/requestlog/columns.yaml index 77522fba0..23abfed72 100644 --- a/modules/system/models/requestlog/columns.yaml +++ b/modules/system/models/requestlog/columns.yaml @@ -6,6 +6,7 @@ columns: status_code: label: system::lang.request_log.status_code searchable: yes + width: 100px url: label: system::lang.request_log.url @@ -14,3 +15,4 @@ columns: count: label: system::lang.request_log.count + width: 150px