File tree Expand file tree Collapse file tree 2 files changed +13
-11
lines changed
src/app/(dashboard)/dashboard Expand file tree Collapse file tree 2 files changed +13
-11
lines changed Original file line number Diff line number Diff line change 22# Backend API URL (Cloudflare Tunnel)
33NEXT_PUBLIC_API_BASE_URL = https://whats-inflation-signing-take.trycloudflare.com/api/v1
44
5- # Fuseki SPARQL Endpoint (Cloudflare Tunnel)
6- NEXT_PUBLIC_FUSEKI_URL = https://whats-inflation-signing-take .trycloudflare.com/fuseki
5+ # Fuseki SPARQL Endpoint (Cloudflare Tunnel - Separate tunnel for Fuseki )
6+ NEXT_PUBLIC_FUSEKI_URL = https://carol-select-sending-independent .trycloudflare.com
77
88# MongoDB Atlas Connection (if needed in frontend)
99# NEXT_PUBLIC_MONGODB_ATLAS_URI=your_atlas_uri_here
Original file line number Diff line number Diff line change @@ -174,18 +174,20 @@ export default function DashboardPage() {
174174 setApiStatus ( 'offline' ) ;
175175 }
176176
177- // Fetch MongoDB Atlas reports stats
177+ // Fetch MongoDB Atlas reports stats using the stats endpoint
178178 try {
179- const appReportsResponse = await fetch ( 'http://localhost:8000/api/v1/app/reports?limit=1000' ) ;
179+ const apiBaseUrl = process . env . NEXT_PUBLIC_API_BASE_URL || 'http://localhost:8000/api/v1' ;
180+ const appReportsResponse = await fetch ( `${ apiBaseUrl } /app/reports/stats/summary` ) ;
180181 if ( appReportsResponse . ok ) {
181182 const appReportsData = await appReportsResponse . json ( ) ;
182- const reports = appReportsData . reports || [ ] ;
183- setAppReports ( {
184- total : reports . length ,
185- pending : reports . filter ( ( r : any ) => r . status === 'pending' ) . length ,
186- processing : reports . filter ( ( r : any ) => r . status === 'processing' ) . length ,
187- resolved : reports . filter ( ( r : any ) => r . status === 'resolved' ) . length ,
188- } ) ;
183+ if ( appReportsData . success && appReportsData . data ) {
184+ setAppReports ( {
185+ total : appReportsData . data . total || 0 ,
186+ pending : appReportsData . data . pending || 0 ,
187+ processing : appReportsData . data . processing || 0 ,
188+ resolved : appReportsData . data . resolved || 0 ,
189+ } ) ;
190+ }
189191 }
190192 } catch ( error ) {
191193 console . error ( 'Failed to fetch app reports:' , error ) ;
You can’t perform that action at this time.
0 commit comments