diff --git a/app/Http/Controllers/DashboardController.php b/app/Http/Controllers/DashboardController.php index 668cc8d..f569764 100644 --- a/app/Http/Controllers/DashboardController.php +++ b/app/Http/Controllers/DashboardController.php @@ -1608,19 +1608,38 @@ class DashboardController extends Controller $result = $this->buildRecapData($unitIds, $keyword); // paginate manually $total = count($result); + $lastPage = max(1, (int) ceil($total / max(1, $perPage))); + $page = min($page, $lastPage); $chunks = array_chunk($result, $perPage); $currentData = $chunks[$page-1] ?? []; + $grandTotalFiles = 0; + foreach ($result as $unitRecap) { + foreach (($unitRecap['data'] ?? []) as $folderRecap) { + $grandTotalFiles += (int) ($folderRecap['count'] ?? 0); + } + } + $currentPageTotalFiles = 0; + foreach ($currentData as $unitRecap) { + foreach (($unitRecap['data'] ?? []) as $folderRecap) { + $currentPageTotalFiles += (int) ($folderRecap['count'] ?? 0); + } + } return response()->json([ 'status' => true, 'data' => $currentData, 'message' => 'Berhasil mendapatkan data', + 'summary' => [ + 'total_units' => $total, + 'grand_total_files' => $grandTotalFiles, + 'current_page_total_files' => $currentPageTotalFiles, + ], 'pagination' => [ 'current_page' => $page, 'per_page' => $perPage, 'total' => $total, - 'last_page' => max(1, ceil($total / $perPage)), - 'has_more' => $page < max(1, ceil($total / $perPage)), + 'last_page' => $lastPage, + 'has_more' => $page < $lastPage, ] ]); } catch (\Throwable $th) { diff --git a/resources/views/dataUmum/index.blade.php b/resources/views/dataUmum/index.blade.php index 3f96c78..cffe564 100644 --- a/resources/views/dataUmum/index.blade.php +++ b/resources/views/dataUmum/index.blade.php @@ -51,6 +51,30 @@ .table-fixed-height { min-height: 70vh; } +.table-responsive.table-fixed-height { + scroll-behavior: smooth; + scrollbar-width: thin; + scrollbar-color: #b8c7db transparent; +} +.table-responsive.table-fixed-height::-webkit-scrollbar { + width: 8px; + height: 8px; +} +.table-responsive.table-fixed-height::-webkit-scrollbar-track { + background: transparent; + border-radius: 999px; +} +.table-responsive.table-fixed-height::-webkit-scrollbar-thumb { + background: rgba(148, 163, 184, 0.72); + border-radius: 999px; + border: 2px solid transparent; + background-clip: padding-box; +} +.table-responsive.table-fixed-height::-webkit-scrollbar-thumb:hover { + background: rgba(100, 116, 139, 0.86); + border: 2px solid transparent; + background-clip: padding-box; +} /* --- Warna kategori baris --- */ .row-shade { diff --git a/resources/views/dataUnit/index.blade.php b/resources/views/dataUnit/index.blade.php index 38f60b1..863afbc 100644 --- a/resources/views/dataUnit/index.blade.php +++ b/resources/views/dataUnit/index.blade.php @@ -49,6 +49,30 @@ .table-fixed-height { min-height: 70vh; } +.table-responsive.table-fixed-height { + scroll-behavior: smooth; + scrollbar-width: thin; + scrollbar-color: #b8c7db transparent; +} +.table-responsive.table-fixed-height::-webkit-scrollbar { + width: 8px; + height: 8px; +} +.table-responsive.table-fixed-height::-webkit-scrollbar-track { + background: transparent; + border-radius: 999px; +} +.table-responsive.table-fixed-height::-webkit-scrollbar-thumb { + background: rgba(148, 163, 184, 0.72); + border-radius: 999px; + border: 2px solid transparent; + background-clip: padding-box; +} +.table-responsive.table-fixed-height::-webkit-scrollbar-thumb:hover { + background: rgba(100, 116, 139, 0.86); + border: 2px solid transparent; + background-clip: padding-box; +} /* --- Warna kategori baris --- */ .row-shade { diff --git a/resources/views/dataUnit/section/recap.blade.php b/resources/views/dataUnit/section/recap.blade.php index 9607b34..4b30c64 100644 --- a/resources/views/dataUnit/section/recap.blade.php +++ b/resources/views/dataUnit/section/recap.blade.php @@ -1,4 +1,32 @@ @php($showRecapTitle = $showRecapTitle ?? true) +
@if ($showRecapTitle)
@@ -25,7 +53,7 @@
-
+
@@ -42,13 +70,16 @@
+
Memuat ringkasan rekap...