From 33f6d61b2414490bb62371888936b7dbae28df02 Mon Sep 17 00:00:00 2001 From: Avan Thakkar Date: Tue, 24 Mar 2020 18:14:02 +0530 Subject: [PATCH] mgr/dashboard: RGW auto refresh is not working Fixes: https://tracker.ceph.com/issues/44667 Signed-off-by: Avan Thakkar --- .../rgw-bucket-list.component.html | 4 ++++ .../rgw-bucket-list.component.ts | 21 ++++++++++++++++-- .../rgw-user-list.component.html | 4 ++++ .../rgw-user-list/rgw-user-list.component.ts | 22 ++++++++++++++++--- 4 files changed, 46 insertions(+), 5 deletions(-) diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-list/rgw-bucket-list.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-list/rgw-bucket-list.component.html index 37797e96e00..1a2fbaeba02 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-list/rgw-bucket-list.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-list/rgw-bucket-list.component.html @@ -1,3 +1,7 @@ +The bucket list data might be stale. If needed, you can manually reload it. selection.hasMultiSelection }; this.tableActions = [addAction, editAction, deleteAction]; + this.timeConditionReached(); + } + + timeConditionReached() { + clearTimeout(this.staleTimeout); + this.ngZone.runOutsideAngular(() => { + this.staleTimeout = window.setTimeout(() => { + this.ngZone.run(() => { + this.isStale = true; + }); + }, 10000); + }); } getBucketList(context: CdTableFetchDataContext) { + this.isStale = false; + this.timeConditionReached(); this.rgwBucketService.list().subscribe( (resp: object[]) => { this.buckets = resp; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-list/rgw-user-list.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-list/rgw-user-list.component.html index a154f1182e3..f1d603536d4 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-list/rgw-user-list.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-list/rgw-user-list.component.html @@ -1,3 +1,7 @@ +The user list data might be stale. If needed, you can manually reload it. selection.hasMultiSelection }; this.tableActions = [addAction, editAction, deleteAction]; + this.timeConditionReached(); + } + + timeConditionReached() { + clearTimeout(this.staleTimeout); + this.ngZone.runOutsideAngular(() => { + this.staleTimeout = window.setTimeout(() => { + this.ngZone.run(() => { + this.isStale = true; + }); + }, 10000); + }); } getUserList(context: CdTableFetchDataContext) { + this.isStale = false; + this.timeConditionReached(); this.rgwUserService.list().subscribe( (resp: object[]) => { this.users = resp;