Update pagination logic and refine controller calculations

This commit is contained in:
Luca Haid
2024-05-08 21:31:01 +02:00
parent 1f477a4b2f
commit 18ee289509
4 changed files with 5 additions and 5 deletions

View File

@@ -128,7 +128,7 @@ class DomainController extends mfBaseController {
"rows" => $domains,
"pagination" => [
"page" => $page,
"total_pages" => ceil($totalRows / $perPage),
"total_pages" => ceil($filtered_available / $perPage),
"per_page" => $perPage,
"filtered_available" => intval($filtered_available),
"total_rows" => intval($totalRows)

View File

@@ -66,7 +66,7 @@ class HistoricTicketController extends mfBaseController {
"rows" => $historicTickets,
"pagination" => [
"page" => $page,
"total_pages" => ceil($totalRows / $perPage),
"total_pages" => ceil($filtered_available / $perPage),
"per_page" => $perPage,
"filtered_available" => intval($filtered_available),
"total_rows" => intval($totalRows)

View File

@@ -81,7 +81,7 @@ class VoiceCallHistoryController extends mfBaseController {
"rows" => $calls,
"pagination" => [
"page" => $page,
"total_pages" => ceil($totalRows / $perPage),
"total_pages" => ceil($filtered_available / $perPage),
"per_page" => $perPage,
"filtered_available" => intval($filtered_available),
"total_rows" => intval($totalRows)

View File

@@ -107,7 +107,7 @@ Vue.component('tt-table', {
<tbody>
<tr v-if="pagination?.total_rows === 0" style="height: 150px">
<tr v-if="pagination?.filtered_available === 0" style="height: 150px">
<td :colspan="Object.keys(columns).length" :rowspan="5" class="text-center">Keine Ergebnisse!</td>
</tr>
@@ -406,7 +406,7 @@ Vue.component('tt-table', {
pagesArray.push(i);
}
return pagesArray;
return pagesArray.length === 0 ? [1] : pagesArray;
},
computedRows() {
if (!this.rawRows || this.ssr === true) return null;