// PAGINATION REPLACEMENT CODE FOR dashboard.html // Replace lines 1439-1625 with this code // File Quality Analysis with Pagination let selectedFiles = new Set(); let currentAttributeFilter = null; // Track the current attribute filter let currentStatusFilter = 'all'; // Track the current status filter let currentPage = 1; let totalPages = 1; let filesPerPage = 100; let totalFiles = 0; async function loadFileQuality() { const tbody = document.getElementById('qualityTableBody'); // Clear selections when reloading (not when paginating) // selectedFiles stays intact during pagination try { // Calculate offset from current page const offset = (currentPage - 1) * filesPerPage; // Build URL with state filter and attribute filter let url = `/api/files?limit=${filesPerPage}&offset=${offset}`; if (currentStatusFilter !== 'all') { url += `&state=${currentStatusFilter}`; } if (currentAttributeFilter && currentAttributeFilter !== 'all') { url += `&filter=${currentAttributeFilter}`; } const response = await fetch(url); const result = await response.json(); if (result.success) { const files = result.data; let html = ''; if (files.length === 0 && currentPage === 1) { html = '