From 8f429e592a9042f91b87b7c6ac59d511f0c215c8 Mon Sep 17 00:00:00 2001 From: Tiago Melo Date: Tue, 5 May 2020 11:48:10 +0000 Subject: [PATCH] mgr/dashboard: Reduce requests in Mirroring page Fixes: https://tracker.ceph.com/issues/45385 Signed-off-by: Tiago Melo (cherry picked from commit f1a020eaf5644d9c7b43c40445a74f89e0e8b536) --- .../daemon-list/daemon-list.component.html | 2 +- .../image-list/image-list.component.html | 17 ++++++++++------- .../pool-list/pool-list.component.html | 2 +- .../shared/datatable/table/table.component.ts | 6 +++++- 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/daemon-list/daemon-list.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/daemon-list/daemon-list.component.html index 037393882d1fd..b7e42d6baa584 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/daemon-list/daemon-list.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/daemon-list/daemon-list.component.html @@ -1,7 +1,7 @@ diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/image-list/image-list.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/image-list/image-list.component.html index d3d862fd86fc8..b8278b486536c 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/image-list/image-list.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/image-list/image-list.component.html @@ -1,28 +1,31 @@ - + - - - diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/pool-list/pool-list.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/pool-list/pool-list.component.html index 0b7cf91776505..755da08342b6d 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/pool-list/pool-list.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/pool-list/pool-list.component.html @@ -3,7 +3,7 @@ [columns]="columns" identifier="name" forceIdentifier="true" - [autoReload]="0" + [autoReload]="-1" (fetchData)="refresh()" selectionType="single" (updateSelection)="updateSelection($event)"> diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.ts index 1eb859e18f161..518e8c7d1529c 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.ts @@ -99,6 +99,8 @@ export class TableComponent implements AfterContentChecked, OnInit, OnChanges, O * Auto reload time in ms - per default every 5s * You can set it to 0, undefined or false to disable the auto reload feature in order to * trigger 'fetchData' if the reload button is clicked. + * You can set it to a negative number to, on top of disabling the auto reload, + * prevent triggering fetchData when initializing the table. */ @Input() autoReload: any = 5000; @@ -269,8 +271,10 @@ export class TableComponent implements AfterContentChecked, OnInit, OnChanges, O }); }); }); - } else { + } else if (!this.autoReload) { this.reloadData(); + } else { + this.useData(); } } -- 2.39.5