fix pagination info for all tanstak-tables

This commit is contained in:
smanylov
2026-05-25 14:22:41 +07:00
parent 1a3f5277d9
commit 491adb4090
9 changed files with 17 additions and 10 deletions
-2
View File
@@ -211,7 +211,6 @@ export async function fetchViolationAnalyticStatistic(group: 'domain' | 'tld') {
export async function fetchViolationStatistic(id: string) { export async function fetchViolationStatistic(id: string) {
const token = await getSessionData('token'); const token = await getSessionData('token');
console.log(`fileId => ${id}`)
try { try {
const response = await fetch(`${API_BASE_URL}/api/v1/data`, { const response = await fetch(`${API_BASE_URL}/api/v1/data`, {
@@ -232,7 +231,6 @@ export async function fetchViolationStatistic(id: string) {
if (response.ok) { if (response.ok) {
let parsed = await response.json(); let parsed = await response.json();
console.log(parsed);
if (parsed?.message_body) { if (parsed?.message_body) {
return parsed?.message_body; return parsed?.message_body;
@@ -1014,7 +1014,7 @@ export default function TanstakFilesTable({ fileType, showFileLink }: { fileType
{t('page')}{' '} {t('page')}{' '}
<strong> <strong>
{pagination.pageIndex + 1} {t('out-of')} {totalPages || 1} {pagination.pageIndex + 1} {t('out-of')} {totalPages || 1}
</strong> </strong> | {t('total-files')}: {totalItems}
</span> </span>
</div> </div>
@@ -232,7 +232,7 @@ export default function FilePageViolationsList({
className="sources-list-pagination" className="sources-list-pagination"
> >
<span> <span>
{t('total-violations')}: {fileViolations?.total_elements} | {t('page')} {fileViolations?.current_page} {t('out-of')} {fileViolations?.total_pages} {t('page')} <strong>{fileViolations?.current_page + 1} {t('out-of')} {fileViolations?.total_pages}</strong> | {t('total-violations')}: {fileViolations?.total_elements}
</span> </span>
{fileViolations?.total_pages > 1 && ( {fileViolations?.total_pages > 1 && (
<div className="pagination-controls"> <div className="pagination-controls">
@@ -47,6 +47,7 @@ export function TrackingHistoryView() {
refetch refetch
} = useHistoryView(pagination.pageIndex, pagination.pageSize, locale, getSortParams.sortOrder, getSortParams.sortBy); } = useHistoryView(pagination.pageIndex, pagination.pageSize, locale, getSortParams.sortOrder, getSortParams.sortBy);
const totalElements = apiResponse?.totalElements || 0
const tableData = apiResponse?.history || []; const tableData = apiResponse?.history || [];
const totalPages = apiResponse?.totalPages || 0; const totalPages = apiResponse?.totalPages || 0;
@@ -381,7 +382,7 @@ export function TrackingHistoryView() {
{t('page')}{' '} {t('page')}{' '}
<strong> <strong>
{pagination.pageIndex + 1} {t('out-of')} {totalPages || 1} {pagination.pageIndex + 1} {t('out-of')} {totalPages || 1}
</strong> </strong> | {t('total-document-openings')}: {totalElements}
</span> </span>
</div> </div>
@@ -270,7 +270,7 @@ export function ViolationsMyClaimsTable() {
{t('page')}{' '} {t('page')}{' '}
<strong> <strong>
{pagination.pageIndex + 1} {t('out-of')} {totalPages || 1} {pagination.pageIndex + 1} {t('out-of')} {totalPages || 1}
</strong> </strong> | {t('total-claims')}: {totalItems}
</span> </span>
</div> </div>
@@ -270,7 +270,7 @@ export function ViolationsMyComplaintsTable() {
{t('page')}{' '} {t('page')}{' '}
<strong> <strong>
{pagination.pageIndex + 1} {t('out-of')} {totalPages || 1} {pagination.pageIndex + 1} {t('out-of')} {totalPages || 1}
</strong> </strong> | {t('total-complaints')}: {totalItems}
</span> </span>
</div> </div>
+1 -1
View File
@@ -477,7 +477,7 @@ export default function ViolationsTable() {
{t('page')}{' '} {t('page')}{' '}
<strong> <strong>
{table.getState().pagination.pageIndex + 1} {t('out-of')} {violationData?.totalPages || 1} {table.getState().pagination.pageIndex + 1} {t('out-of')} {violationData?.totalPages || 1}
</strong> </strong> | {t('total-matches')}: {violationData?.totalElements}
</span> </span>
</div> </div>
+5 -1
View File
@@ -474,7 +474,11 @@
"history-of-opened": "History of opened", "history-of-opened": "History of opened",
"not-defined": "Not defined", "not-defined": "Not defined",
"not-defined-city": "The city is not defined", "not-defined-city": "The city is not defined",
"not-defined-country": "Country not defined" "not-defined-country": "Country not defined",
"total-document-openings": "Total document openings",
"total-matches": "Total matches",
"total-complaints": "Total complaints",
"total-claims": "Total claims"
}, },
"Login-register-form": { "Login-register-form": {
"and": "and", "and": "and",
+5 -1
View File
@@ -474,7 +474,11 @@
"history-of-opened": "История открытий", "history-of-opened": "История открытий",
"not-defined": "Не определено", "not-defined": "Не определено",
"not-defined-city": "Город не определен", "not-defined-city": "Город не определен",
"not-defined-country": "Страна не определена" "not-defined-country": "Страна не определена",
"total-document-openings": "Всего открытий документов",
"total-matches": "Всего совпадений",
"total-complaints": "Всего нарушений",
"total-claims": "Всего претензий"
}, },
"Login-register-form": { "Login-register-form": {
"and": "и", "and": "и",