Skip to content

Commit 9fe3291

Browse files
committed
refactor: miglioria grafica logs
1 parent 1f2f146 commit 9fe3291

1 file changed

Lines changed: 38 additions & 18 deletions

File tree

‎log.php‎

Lines changed: 38 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,24 +26,25 @@
2626
include_once App::filepath('include|custom|', 'top.php');
2727

2828
echo '
29-
<div class="card">
30-
<div class="card-header">
31-
<h3 class="card-title"><i class="fa fa-book"></i> '.tr('Ultimi 100 accessi').'</h3>
29+
<div class="card card-outline card-info shadow-sm">
30+
<div class="card-header with-border bg-info text-white">
31+
<h3 class="card-title mb-0"><i class="fa fa-book mr-2"></i> '.tr('Ultimi 100 accessi').'</h3>
3232
</div>
3333
3434
<!-- /.card-header -->
35-
<div class="card-body table-responsive no-padding">
36-
<table class="datatables table table-hover">
37-
<thead>
38-
<tr>
39-
<th width="200">'.tr('Username').'</th>
40-
<th width="150">'.tr('Data').'</th>
41-
<th width="100">'.tr('Indirizzo IP').'</th>
42-
<th>'.tr('Dispositivo').'</th>
43-
<th width="180">'.tr('Stato').'</th>
44-
</tr>
45-
</thead>
46-
<tbody>';
35+
<div class="card-body p-3">
36+
<div class="table-responsive">
37+
<table class="datatables table table-hover table-sm">
38+
<thead class="bg-light">
39+
<tr>
40+
<th width="200">'.tr('Username').'</th>
41+
<th width="150">'.tr('Data').'</th>
42+
<th width="100">'.tr('Indirizzo IP').'</th>
43+
<th>'.tr('Dispositivo').'</th>
44+
<th width="180">'.tr('Stato').'</th>
45+
</tr>
46+
</thead>
47+
<tbody>';
4748

4849
/*
4950
LEGGO DALLA TABELLA ZZ_LOG
@@ -77,9 +78,9 @@
7778

7879
echo '
7980
<tr class="'.$type.'">
80-
<td>'.$log['username'].'</td>
81-
<td class="tip" title="'.$created_at->format('d/m/Y H:i:s').'">'.$created_at->diffForHumans().'</td>
82-
<td>'.$log['ip'].'</td>
81+
<td><strong>'.$log['username'].'</strong></td>
82+
<td class="tip" title="'.$created_at->format('d/m/Y H:i:s').'"><i class="fa fa-clock-o mr-1 text-muted"></i>'.$created_at->diffForHumans().'</td>
83+
<td><code>'.$log['ip'].'</code></td>
8384
<td class="user-agent tip" title="'.strip_tags($log['user_agent'] ?: '').'">'.$log['user_agent'].'</td>
8485
<td><span class="badge badge-'.$type.'">'.$stato.'</span></td>
8586
</tr>';
@@ -89,12 +90,31 @@
8990
9091
</tbody>
9192
</table>
93+
</div>
9294
</div>
9395
<!-- /.card-body -->
9496
</div>
9597
<!-- /.card -->';
9698
?>
9799

100+
<style>
101+
/* Margine per il campo di ricerca di DataTables */
102+
.dataTables_wrapper .dataTables_filter {
103+
margin-bottom: 15px !important;
104+
}
105+
106+
/* Margine per il totale elementi a piè di pagina */
107+
.dataTables_wrapper .dataTables_info {
108+
margin-top: 15px !important;
109+
}
110+
111+
/* Margine per la paginazione */
112+
.dataTables_wrapper .dataTables_paginate {
113+
margin-top: 15px !important;
114+
}
115+
</style>
116+
117+
98118
<script>
99119
$(document).ready(function() {
100120
var parser = new UAParser();

0 commit comments

Comments
 (0)