X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=ceph%2Fsrc%2Fpybind%2Fmgr%2Fdashboard%2Ffrontend%2Fsrc%2Fapp%2Fceph%2Frgw%2Frgw-bucket-list%2Frgw-bucket-list.component.ts;h=8573c7395570d38eff8597a2b4c7bd46a81c06a5;hb=1911f103e16ae0d04db10fb41db8217ef4c320d3;hp=24050ebb74aa46d55e78e788f41362b57a97dc04;hpb=78f773100ed5d2ebc9d99e65a3d7e3a6f541a97e;p=ceph.git diff --git a/ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-list/rgw-bucket-list.component.ts b/ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-list/rgw-bucket-list.component.ts index 24050ebb7..8573c7395 100644 --- a/ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-list/rgw-bucket-list.component.ts +++ b/ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-list/rgw-bucket-list.component.ts @@ -1,4 +1,4 @@ -import { Component, ViewChild } from '@angular/core'; +import { Component, NgZone, ViewChild } from '@angular/core'; import { I18n } from '@ngx-translate/i18n-polyfill'; import { BsModalService } from 'ngx-bootstrap/modal'; @@ -34,6 +34,8 @@ export class RgwBucketListComponent { columns: CdTableColumn[] = []; buckets: object[] = []; selection: CdTableSelection = new CdTableSelection(); + isStale = false; + staleTimeout: number; constructor( private authStorageService: AuthStorageService, @@ -41,7 +43,8 @@ export class RgwBucketListComponent { private bsModalService: BsModalService, private i18n: I18n, private urlBuilder: URLBuilderService, - public actionLabels: ActionLabelsI18n + public actionLabels: ActionLabelsI18n, + private ngZone: NgZone ) { this.permission = this.authStorageService.getPermissions().rgw; this.columns = [ @@ -80,9 +83,23 @@ export class RgwBucketListComponent { canBePrimary: (selection: CdTableSelection) => 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;