Add comprehensive admin features and multi-system integration
- Add admin dashboard with sync controls and data browser - Implement RMM, Auvik, and Addigy organization mappings - Add chunked ticket sync with progress tracking - Implement entity sync service with rate limiting - Add analytics engine and performance optimizer - Create data browser for all PSA entities - Add navigation components and UI improvements - Implement background processing and sync services - Add comprehensive documentation and migration scripts - Update configuration items with multi-system support - Enhance contact management and purchase history - Add issue type assignment and LLM analyzer - Improve error handling and logging utilities
This commit is contained in:
parent
e8462ef301
commit
6eee14f8af
171 changed files with 32671 additions and 621 deletions
49
app/api/sync/progress/route.ts
Normal file
49
app/api/sync/progress/route.ts
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
import { NextRequest, NextResponse } from 'next/server';
|
||||
import { syncProgressTracker } from '@/lib/services/sync-progress-tracker';
|
||||
|
||||
/**
|
||||
* GET /api/sync/progress
|
||||
* Get sync progress for a specific sync or entity type
|
||||
*/
|
||||
export async function GET(request: NextRequest) {
|
||||
try {
|
||||
const searchParams = request.nextUrl.searchParams;
|
||||
const syncId = searchParams.get('syncId');
|
||||
const entityType = searchParams.get('entityType');
|
||||
|
||||
if (syncId) {
|
||||
// Get specific sync progress
|
||||
const progress = syncProgressTracker.getProgress(syncId);
|
||||
if (!progress) {
|
||||
return NextResponse.json(
|
||||
{ error: 'Sync not found' },
|
||||
{ status: 404 }
|
||||
);
|
||||
}
|
||||
return NextResponse.json({ progress });
|
||||
}
|
||||
|
||||
if (entityType) {
|
||||
// Get latest sync for entity type
|
||||
const progress = syncProgressTracker.getLatestSync(entityType);
|
||||
if (!progress) {
|
||||
return NextResponse.json(
|
||||
{ error: 'No sync found for entity type' },
|
||||
{ status: 404 }
|
||||
);
|
||||
}
|
||||
return NextResponse.json({ progress });
|
||||
}
|
||||
|
||||
// Get all active syncs
|
||||
const activeSyncs = syncProgressTracker.getActiveSyncs();
|
||||
return NextResponse.json({ activeSyncs });
|
||||
|
||||
} catch (error) {
|
||||
console.error('Error fetching sync progress:', error);
|
||||
return NextResponse.json(
|
||||
{ error: 'Failed to fetch sync progress' },
|
||||
{ status: 500 }
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue