Adds a refresh button to log pages, minor column tweaks

This commit is contained in:
Samuel Georges 2015-11-28 11:10:06 +11:00
parent 2ced2f8c73
commit 30025a6ada
10 changed files with 51 additions and 7 deletions

View File

@ -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();
}
}

View File

@ -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>

View File

@ -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.',

View File

@ -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

View File

@ -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'));

View File

@ -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'));

View File

@ -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"
@ -21,4 +28,4 @@
data-stripe-load-indicator>
<?= e(trans('backend::lang.list.delete_selected')) ?>
</button>
</div>
</div>

View File

@ -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"
@ -21,4 +28,4 @@
data-stripe-load-indicator>
<?= e(trans('backend::lang.list.delete_selected')) ?>
</button>
</div>
</div>

View File

@ -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

View File

@ -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