feat: add tabs to sync page and fix pagination

- Separate Sync Status and Sync History into tabs with icons
- Fix pagination in sync history by adding offset parameter
- Update getSyncHistory to support offset for proper pagination
- Update API endpoint to pass offset parameter
- Previous/Next buttons now work correctly to navigate pages

This improves UX by organizing the sync page into logical sections
and enables users to browse through historical sync records.
This commit is contained in:
root 2026-01-24 07:57:09 -05:00
parent 0dee311457
commit f85741c993
4 changed files with 33 additions and 11 deletions

View file

@ -352,11 +352,13 @@ export class SyncService {
* Get sync history
* @param limit Number of records to return
* @param entityType Optional entity type filter
* @param offset Offset for pagination
* @returns Array of sync history records
*/
async getSyncHistory(
limit: number = 50,
entityType?: EntityType
entityType?: EntityType,
offset: number = 0
): Promise<SyncHistoryRecord[]> {
let query = `
SELECT *
@ -370,8 +372,8 @@ export class SyncService {
params.push(entityType);
}
query += ` ORDER BY started_at DESC LIMIT $${params.length + 1}`;
params.push(limit);
query += ` ORDER BY started_at DESC LIMIT $${params.length + 1} OFFSET $${params.length + 2}`;
params.push(limit, offset);
const result = await postgresClient.query<SyncHistoryRecord>(query, params);
return result.rows;