Skip to content

Commit

Permalink
WIP: Enable pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
dcoric committed Dec 20, 2024
1 parent 9ce84c8 commit 10be69c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions web/src/app/services/scheduler/scheduler.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import { SchedulerResourceInfo } from '@app/models/resource-info.model';
import { SchedulerHealthInfo } from '@app/models/scheduler-health-info.model';
import { CommonUtil } from '@app/utils/common.util';
import { NOT_AVAILABLE } from '@app/utils/constants';
import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';
import { Observable, of } from 'rxjs';
import { map, catchError } from 'rxjs/operators';
import { EnvConfigService } from '../envconfig/envconfig.service';

@Injectable({
Expand Down Expand Up @@ -68,8 +68,8 @@ export class SchedulerService {
);
}

fetchAppList(partitionId: string, queueId: string): Observable<AppInfo[]> {
const appsUrl = `${this.envConfig.getUHSWebAddress()}/v1/partition/${partitionId}/queue/${queueId}/applications`;
fetchAppList(partitionId: string, queueId: string, limit: number = 10, offset: number = 0): Observable<AppInfo[]> {
const appsUrl = `${this.envConfig.getUHSWebAddress()}/v1/partition/${partitionId}/queue/${queueId}/applications?limit=${limit}&offset=${offset}`;
return this.httpClient.get(appsUrl).pipe(
map((data: any) => {
const result: AppInfo[] = [];
Expand Down Expand Up @@ -132,6 +132,10 @@ export class SchedulerService {
}

return result;
}),
catchError((error) => {
console.error('Error fetching app list:', error);
return of([]);
})
);
}
Expand Down

0 comments on commit 10be69c

Please sign in to comment.