]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Reduce requests in Mirroring page 34992/head
authorTiago Melo <tmelo@suse.com>
Tue, 5 May 2020 11:48:10 +0000 (11:48 +0000)
committerTiago Melo <tmelo@suse.com>
Mon, 11 May 2020 15:40:21 +0000 (15:40 +0000)
Fixes: https://tracker.ceph.com/issues/45385
Signed-off-by: Tiago Melo <tmelo@suse.com>
(cherry picked from commit f1a020eaf5644d9c7b43c40445a74f89e0e8b536)

src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/daemon-list/daemon-list.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/image-list/image-list.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/pool-list/pool-list.component.html
src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.ts

index 037393882d1fdc50e99ef51dd06fed766e220fcd..b7e42d6baa5843328a820e7d1f222b5401a9a160 100644 (file)
@@ -1,7 +1,7 @@
 <cd-table [data]="data"
           columnMode="flex"
           [columns]="columns"
-          [autoReload]="0"
+          [autoReload]="-1"
           (fetchData)="refresh()">
 </cd-table>
 
index d3d862fd86fc8c7fd12f2766b6af4e60efcc3e48..b8278b486536cbd9b18d37f7d1442146bd0a6d4f 100644 (file)
@@ -1,28 +1,31 @@
-<tabset>
+<tabset #tabset>
   <tab heading="Issues"
        i18n-heading>
-    <cd-table [data]="image_error.data"
+    <cd-table *ngIf="tabset.tabs[0]?.active"
+              [data]="image_error.data"
               columnMode="flex"
               [columns]="image_error.columns"
-              [autoReload]="0"
+              [autoReload]="-1"
               (fetchData)="refresh()">
     </cd-table>
   </tab>
   <tab heading="Syncing"
        i18n-heading>
-    <cd-table [data]="image_syncing.data"
+    <cd-table *ngIf="tabset.tabs[1]?.active"
+              [data]="image_syncing.data"
               columnMode="flex"
               [columns]="image_syncing.columns"
-              [autoReload]="0"
+              [autoReload]="-1"
               (fetchData)="refresh()">
     </cd-table>
   </tab>
   <tab heading="Ready"
        i18n-heading>
-    <cd-table [data]="image_ready.data"
+    <cd-table *ngIf="tabset.tabs[2]?.active"
+              [data]="image_ready.data"
               columnMode="flex"
               [columns]="image_ready.columns"
-              [autoReload]="0"
+              [autoReload]="-1"
               (fetchData)="refresh()">
     </cd-table>
   </tab>
index 0b7cf91776505489a5b21e264111cdddda59bd7b..755da08342b6d434ea138fbe79b06070ceaf0d15 100644 (file)
@@ -3,7 +3,7 @@
           [columns]="columns"
           identifier="name"
           forceIdentifier="true"
-          [autoReload]="0"
+          [autoReload]="-1"
           (fetchData)="refresh()"
           selectionType="single"
           (updateSelection)="updateSelection($event)">
index 1eb859e18f1617536257434990e3b7eca7bec6ec..518e8c7d1529c5640c757b75d76a23aa7a5aec7b 100644 (file)
@@ -99,6 +99,8 @@ export class TableComponent implements AfterContentChecked, OnInit, OnChanges, O
    * Auto reload time in ms - per default every 5s
    * You can set it to 0, undefined or false to disable the auto reload feature in order to
    * trigger 'fetchData' if the reload button is clicked.
+   * You can set it to a negative number to, on top of disabling the auto reload,
+   * prevent triggering fetchData when initializing the table.
    */
   @Input()
   autoReload: any = 5000;
@@ -269,8 +271,10 @@ export class TableComponent implements AfterContentChecked, OnInit, OnChanges, O
           });
         });
       });
-    } else {
+    } else if (!this.autoReload) {
       this.reloadData();
+    } else {
+      this.useData();
     }
   }