]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.ts
update ceph source to reef 18.2.1
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / ceph / cluster / hosts / hosts.component.ts
index 3bdda8aca3ef4d79ddfd2e35ed241969f105977a..0caeac9f2eb8f797bffc7d58f3dd89fa4bc777d1 100644 (file)
@@ -29,6 +29,7 @@ import { Permissions } from '~/app/shared/models/permissions';
 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';
@@ -89,6 +90,8 @@ export class HostsComponent extends ListWithDetails implements OnDestroy, OnInit
   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.`
@@ -483,6 +486,12 @@ export class HostsComponent extends ListWithDetails implements OnDestroy, OnInit
   }
 
   getHosts(context: CdTableFetchDataContext) {
+    if (context !== null) {
+      this.tableContext = context;
+    }
+    if (this.tableContext == null) {
+      this.tableContext = new CdTableFetchDataContext(() => undefined);
+    }
     if (this.isLoadingHosts) {
       return;
     }
@@ -493,11 +502,11 @@ export class HostsComponent extends ListWithDetails implements OnDestroy, OnInit
         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'] === '') {
@@ -506,6 +515,11 @@ export class HostsComponent extends ListWithDetails implements OnDestroy, OnInit
           });
           this.transformHostsData();
           this.isLoadingHosts = false;
+          if (this.hosts.length > 0) {
+            this.count = CdTableServerSideService.getCount(hostList[0]);
+          } else {
+            this.count = 0;
+          }
         },
         () => {
           this.isLoadingHosts = false;