in src/app/components/apps-view/apps-view.component.ts [72:141]
ngOnInit() {
this.appDataSource.paginator = this.appPaginator;
this.allocDataSource.paginator = this.allocPaginator;
this.appDataSource.sort = this.appSort;
this.appSort.sort({ id: 'submissionTime', start: 'desc', disableClear: false });
this.appColumnDef = [
{ colId: 'applicationId', colName: 'Application ID' },
{ colId: 'queueName', colName: 'Queue Name' },
{ colId: 'applicationState', colName: 'Application State' },
{
colId: 'lastStateChangeTime',
colName: 'Last State Change Time',
colFormatter: CommonUtil.timeColumnFormatter,
},
{
colId: 'usedResource',
colName: 'Used Resource',
colFormatter: CommonUtil.resourceColumnFormatter,
},
{ colId: 'partition', colName: 'Partition' },
{
colId: 'submissionTime',
colName: 'Submission Time',
colFormatter: CommonUtil.timeColumnFormatter,
},
];
this.appColumnIds = this.appColumnDef.map((col) => col.colId).concat('indicatorIcon');
this.allocColumnDef = [
{ colId: 'displayName', colName: 'Display Name' },
{ colId: 'allocationKey', colName: 'Allocation Key' },
{ colId: 'nodeId', colName: 'Node ID' },
{ colId: 'resource', colName: 'Resource', colFormatter: CommonUtil.resourceColumnFormatter },
{ colId: 'priority', colName: 'Priority' },
];
this.allocColumnIds = this.allocColumnDef.map((col) => col.colId);
fromEvent(this.searchInput.nativeElement, 'keyup')
.pipe(debounceTime(500), distinctUntilChanged())
.subscribe(() => {
this.onSearchAppData();
});
this.scheduler
.fetchPartitionList()
.pipe(
finalize(() => {
this.spinner.hide();
})
)
.subscribe((list) => {
if (list && list.length > 0) {
list.forEach((part) => {
this.partitionList.push(new PartitionInfo(part.name, part.name));
});
this.partitionSelected = list[0].name;
this.fetchQueuesForPartition(this.partitionSelected);
} else {
this.partitionList = [new PartitionInfo('-- Select --', '')];
this.partitionSelected = '';
this.leafQueueList = [new DropdownItem('-- Select --', '')];
this.leafQueueSelected = '';
this.appDataSource.data = [];
}
});
}