]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-list/rgw-user-list.component.ts
import ceph 16.2.6
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / ceph / rgw / rgw-user-list / rgw-user-list.component.ts
index e7f47298ecffb14d58a6139d1fee904b7356b0c6..e48aaa7c406409de9f70440c9a81244ca1d2790e 100644 (file)
@@ -5,7 +5,6 @@ import { forkJoin as observableForkJoin, Observable, Subscriber } from 'rxjs';
 
 import { RgwUserService } from '~/app/shared/api/rgw-user.service';
 import { ListWithDetails } from '~/app/shared/classes/list-with-details.class';
-import { TableStatus } from '~/app/shared/classes/table-status';
 import { CriticalConfirmationModalComponent } from '~/app/shared/components/critical-confirmation-modal/critical-confirmation-modal.component';
 import { ActionLabelsI18n } from '~/app/shared/constants/app.constants';
 import { TableComponent } from '~/app/shared/datatable/table/table.component';
@@ -40,7 +39,6 @@ export class RgwUserListComponent extends ListWithDetails implements OnInit {
   columns: CdTableColumn[] = [];
   users: object[] = [];
   selection: CdTableSelection = new CdTableSelection();
-  tableStatus = new TableStatus();
   staleTimeout: number;
 
   constructor(
@@ -49,9 +47,9 @@ export class RgwUserListComponent extends ListWithDetails implements OnInit {
     private modalService: ModalService,
     private urlBuilder: URLBuilderService,
     public actionLabels: ActionLabelsI18n,
-    private ngZone: NgZone
+    protected ngZone: NgZone
   ) {
-    super();
+    super(ngZone);
   }
 
   ngOnInit() {
@@ -131,26 +129,11 @@ export class RgwUserListComponent extends ListWithDetails implements OnInit {
       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.tableStatus = new TableStatus(
-            'warning',
-            $localize`The user list data might be stale. If needed, you can manually reload it.`
-          );
-        });
-      }, 10000);
-    });
+    this.setTableRefreshTimeout();
   }
 
   getUserList(context: CdTableFetchDataContext) {
-    this.tableStatus = new TableStatus();
-    this.timeConditionReached();
+    this.setTableRefreshTimeout();
     this.rgwUserService.list().subscribe(
       (resp: object[]) => {
         this.users = resp;