import { DimlessBinaryPipe } from '~/app/shared/pipes/dimless-binary.pipe';
import { EmptyPipe } from '~/app/shared/pipes/empty.pipe';
import { AuthStorageService } from '~/app/shared/services/auth-storage.service';
+import { CdTableServerSideService } from '~/app/shared/services/cd-table-server-side.service';
import { ModalService } from '~/app/shared/services/modal.service';
import { NotificationService } from '~/app/shared/services/notification.service';
import { TaskWrapperService } from '~/app/shared/services/task-wrapper.service';
bsModalRef: NgbModalRef;
icons = Icons;
+ private tableContext: CdTableFetchDataContext = null;
+ count = 5;
messages = {
nonOrchHost: $localize`The feature is disabled because the selected host is not managed by Orchestrator.`
}
getHosts(context: CdTableFetchDataContext) {
+ if (context !== null) {
+ this.tableContext = context;
+ }
+ if (this.tableContext == null) {
+ this.tableContext = new CdTableFetchDataContext(() => undefined);
+ }
if (this.isLoadingHosts) {
return;
}
mergeMap((orchStatus) => {
this.orchStatus = orchStatus;
const factsAvailable = this.checkHostsFactsAvailable();
- return this.hostService.list(`${factsAvailable}`);
+ return this.hostService.list(this.tableContext?.toParams(), factsAvailable.toString());
})
)
.subscribe(
- (hostList) => {
+ (hostList: any[]) => {
this.hosts = hostList;
this.hosts.forEach((host: object) => {
if (host['status'] === '') {
});
this.transformHostsData();
this.isLoadingHosts = false;
+ if (this.hosts.length > 0) {
+ this.count = CdTableServerSideService.getCount(hostList[0]);
+ } else {
+ this.count = 0;
+ }
},
() => {
this.isLoadingHosts = false;