]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Add 'executing' cell template
authorRicardo Marques <rimarques@suse.com>
Wed, 18 Apr 2018 09:48:19 +0000 (10:48 +0100)
committerRicardo Marques <rimarques@suse.com>
Wed, 18 Apr 2018 10:02:28 +0000 (11:02 +0100)
Signed-off-by: Ricardo Marques <rimarques@suse.com>
src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.html
src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/enum/cell-template.enum.ts

index d1686d558bd9ea37d9d603042a14edd531db3e2f..51dcb0b7f7df9895643df4b89ac69e1768477342 100644 (file)
              let-value="value">
   {{ value }} /s
 </ng-template>
+
+<ng-template #executingTpl
+             let-row="row"
+             let-value="value">
+  <i class="fa fa-spinner fa-spin fa-fw"
+     *ngIf="row.cdExecuting"></i>
+  {{ value }}
+  <span *ngIf="row.cdExecuting"
+        class="text-muted italic">({{ row.cdExecuting }}... )</span>
+</ng-template>
index 8d1470d3fa2a276cca573e9767f60593cbc51035..4e76195e0e178e011ffb5efca25306416ac8749a 100644 (file)
@@ -38,6 +38,7 @@ export class TableComponent implements AfterContentChecked, OnInit, OnChanges, O
   @ViewChild('sparklineTpl') sparklineTpl: TemplateRef<any>;
   @ViewChild('routerLinkTpl') routerLinkTpl: TemplateRef<any>;
   @ViewChild('perSecondTpl') perSecondTpl: TemplateRef<any>;
+  @ViewChild('executingTpl') executingTpl: TemplateRef<any>;
 
   // This is the array with the items to be shown.
   @Input() data: any[];
@@ -181,6 +182,7 @@ export class TableComponent implements AfterContentChecked, OnInit, OnChanges, O
     this.cellTemplates.sparkline = this.sparklineTpl;
     this.cellTemplates.routerLink = this.routerLinkTpl;
     this.cellTemplates.perSecond = this.perSecondTpl;
+    this.cellTemplates.executing = this.executingTpl;
   }
 
   ngOnChanges(changes) {
index 7c1c2162f58d114fa2b90a0dab3213ce50d17c0e..c02e7ff7de92f38cf4c0b54097ad0b0309d5c1f6 100644 (file)
@@ -2,5 +2,6 @@ export enum CellTemplate {
   bold = 'bold',
   sparkline = 'sparkline',
   perSecond = 'perSecond',
-  routerLink = 'routerLink'
+  routerLink = 'routerLink',
+  executing = 'executing'
 }