From: Avan Thakkar Date: Tue, 24 Mar 2020 12:44:02 +0000 (+0530) Subject: mgr/dashboard: RGW auto refresh is not working X-Git-Tag: v15.2.2~37^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c670d579ea515ab09897f426391359d8d3ab7dd9;p=ceph.git mgr/dashboard: RGW auto refresh is not working Fixes: https://tracker.ceph.com/issues/44667 Signed-off-by: Avan Thakkar (cherry picked from commit 33f6d61b2414490bb62371888936b7dbae28df02) --- 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 37797e96e003..1a2fbaeba02c 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 a154f1182e34..f1d603536d4f 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;