Migliorata visualizzazione stato servizi

This commit is contained in:
Luca 2021-03-16 16:31:58 +01:00
parent 499b3c4da1
commit f8d1d5d7d8
2 changed files with 14 additions and 2 deletions

View File

@ -199,11 +199,15 @@ switch (filter('op')) {
$history = (array) $informazioni['history'];
foreach ($history as $key => $value) {
$history[$key]['size'] = Filesystem::formatBytes($value['size']);
$history[$key]['invoices_size'] = Filesystem::formatBytes($value['invoices_size']);
$history[$key]['notifies_size'] = Filesystem::formatBytes($value['notifies_size']);
}
echo json_encode([
'invoice_number' => $informazioni['invoice_number'],
'size' => Filesystem::formatBytes($informazioni['size']),
'invoices_size' => Filesystem::formatBytes($informazioni['invoices_size']),
'notifies_size' => Filesystem::formatBytes($informazioni['notifies_size']),
'history' => $history,
]);
break;

View File

@ -105,8 +105,10 @@ if (Services::isEnabled()) {
<thead>
<tr>
<th>'.tr('Anno').'</th>
<th>'.tr('Fatture transitate').'</th>
<th>'.tr('Spazio occupato').'</th>
<th>'.tr('Documenti transitati').'</th>
<th>'.tr('Spazio fatture').'</th>
<th>'.tr('Spazio ricevute').'</th>
<th>'.tr('Spazio totale occupato').'</th>
</tr>
</thead>
@ -114,6 +116,8 @@ if (Services::isEnabled()) {
<tr class="info">
<td>'.tr('Totale').'</td>
<td id="fe_numero"></td>
<td id="fe_spazio_fatture"></td>
<td id="fe_spazio_ricevute"></td>
<td id="fe_spazio"></td>
</tr>
</tbody>
@ -133,6 +137,8 @@ if (Services::isEnabled()) {
},
success: function (response) {
$("#fe_numero").html(response.invoice_number);
$("#fe_spazio_fatture").html(response.invoices_size);
$("#fe_spazio_ricevute").html(response.notifies_size);
$("#fe_spazio").html(response.size);
if (response.history.length) {
@ -142,6 +148,8 @@ if (Services::isEnabled()) {
$("#elenco-fe").append(`<tr>
<td>` + data["year"] + `</td>
<td>` + data["number"] + `</td>
<td>` + data["invoices_size"] + `</td>
<td>` + data["notifies_size"] + `</td>
<td>` + data["size"] + `</td>
</tr>`);
}