Skip to content

Commit

Permalink
Adds a refresh button to log pages, minor column tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
daftspunk committed Nov 28, 2015
1 parent 2ced2f8 commit 30025a6
Show file tree
Hide file tree
Showing 10 changed files with 51 additions and 7 deletions.
5 changes: 5 additions & 0 deletions modules/backend/controllers/AccessLogs.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,9 @@ public function __construct()
BackendMenu::setContext('October.System', 'system', 'settings');
SettingsManager::setContext('October.Backend', 'access_logs');
}

public function index_onRefresh()
{
return $this->listRefresh();
}
}
12 changes: 9 additions & 3 deletions modules/backend/controllers/accesslogs/_list_toolbar.htm
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
<div data-control="toolbar">

</div>
<div data-control="toolbar" class="loading-indicator-container">
<a
href="javascript:;"
data-request="onRefresh"
data-load-indicator="<?= e(trans('backend::lang.list.updating')) ?>"
class="btn btn-primary oc-icon-refresh">
<?= e(trans('backend::lang.list.refresh')) ?>
</a>
</div>
2 changes: 2 additions & 0 deletions modules/backend/lang/en/lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@
'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.',
Expand Down
2 changes: 2 additions & 0 deletions modules/backend/models/accesslog/columns.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion modules/system/controllers/EventLogs.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@ public function __construct()
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'));
Expand Down
7 changes: 6 additions & 1 deletion modules/system/controllers/RequestLogs.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@ public function __construct()
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'));
Expand Down
9 changes: 8 additions & 1 deletion modules/system/controllers/eventlogs/_list_toolbar.htm
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
<div data-control="toolbar" class="loading-indicator-container">
<a
href="javascript:;"
data-request="onRefresh"
data-load-indicator="<?= e(trans('backend::lang.list.updating')) ?>"
class="btn btn-primary oc-icon-refresh">
<?= e(trans('backend::lang.list.refresh')) ?>
</a>
<a
href="javascript:;"
data-request="onEmptyLog"
Expand All @@ -21,4 +28,4 @@
data-stripe-load-indicator>
<?= e(trans('backend::lang.list.delete_selected')) ?>
</button>
</div>
</div>
9 changes: 8 additions & 1 deletion modules/system/controllers/requestlogs/_list_toolbar.htm
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
<div data-control="toolbar" class="loading-indicator-container">
<a
href="javascript:;"
data-request="onRefresh"
data-load-indicator="<?= e(trans('backend::lang.list.updating')) ?>"
class="btn btn-primary oc-icon-refresh">
<?= e(trans('backend::lang.list.refresh')) ?>
</a>
<a
href="javascript:;"
data-request="onEmptyLog"
Expand All @@ -21,4 +28,4 @@
data-stripe-load-indicator>
<?= e(trans('backend::lang.list.delete_selected')) ?>
</button>
</div>
</div>
3 changes: 3 additions & 0 deletions modules/system/models/eventlog/columns.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions modules/system/models/requestlog/columns.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -14,3 +15,4 @@ columns:

count:
label: system::lang.request_log.count
width: 150px

0 comments on commit 30025a6

Please sign in to comment.