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:
parent
0dee311457
commit
f85741c993
4 changed files with 33 additions and 11 deletions
|
|
@ -46,7 +46,8 @@ export default function SyncHistoryTable({ refreshKey }: SyncHistoryTableProps)
|
|||
const fetchHistory = async () => {
|
||||
try {
|
||||
setLoading(true);
|
||||
const response = await fetch(`/api/sync/history?limit=${limit}`);
|
||||
const offset = (page - 1) * limit;
|
||||
const response = await fetch(`/api/sync/history?limit=${limit}&offset=${offset}`);
|
||||
if (response.ok) {
|
||||
const data = await response.json();
|
||||
setHistory(data.history || []);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue