Update pagination logic and refine controller calculations
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user