]> git.proxmox.com Git - ceph.git/blob - ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/classes/list-with-details.class.ts
import ceph 16.2.6
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / shared / classes / list-with-details.class.ts
1 import { NgZone } from '@angular/core';
2
3 import { TableStatus } from './table-status';
4
5 export class ListWithDetails {
6 expandedRow: any;
7 staleTimeout: number;
8 tableStatus: TableStatus;
9
10 constructor(protected ngZone?: NgZone) {}
11
12 setExpandedRow(expandedRow: any) {
13 this.expandedRow = expandedRow;
14 }
15
16 setTableRefreshTimeout() {
17 clearTimeout(this.staleTimeout);
18 this.ngZone.runOutsideAngular(() => {
19 this.staleTimeout = window.setTimeout(() => {
20 this.ngZone.run(() => {
21 this.tableStatus = new TableStatus(
22 'warning',
23 $localize`The user list data might be stale. If needed, you can manually reload it.`
24 );
25 });
26 }, 10000);
27 });
28 }
29 }