]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: merge running and size columns in services page
authorPere Diaz Bou <pere-altea@hotmail.com>
Fri, 19 May 2023 09:54:38 +0000 (11:54 +0200)
committerNizamudeen A <nia@redhat.com>
Fri, 26 May 2023 06:30:58 +0000 (12:00 +0530)
Fixes: https://tracker.ceph.com/issues/61295
Signed-off-by: Pere Diaz Bou <pere-altea@hotmail.com>
(cherry picked from commit 3eeca5c5c42c85d1925828a2e9ac3d87c83a401b)

src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/services.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/services.component.ts

index fbcc8583cf1d258b41120a74f025a3ac1f7a048c..d84449e237eebc9e394984b0c58e16a9ec8c9542 100644 (file)
   </cd-table>
 </ng-container>
 <router-outlet name="modal"></router-outlet>
+
+
+<ng-template #runningTpl
+             let-value="value">
+  <span ngbTooltip="Service instances running out of the total number of services requested.">
+    {{ value.running }} / {{ value.size }}
+  </span>
+  <i *ngIf="value.running == 0 || value.size == 0"
+     class="icon-warning-color"
+     [ngClass]="[icons.warning]">
+  </i>
+</ng-template>
index 55638de24de81fa258fb62e1133f91b960383800..1234a684e6c9d16fac11de4da2a5af33dc3438ad 100644 (file)
@@ -1,4 +1,4 @@
-import { Component, Input, OnChanges, OnInit, ViewChild } from '@angular/core';
+import { Component, Input, OnChanges, OnInit, TemplateRef, ViewChild } from '@angular/core';
 import { Router } from '@angular/router';
 
 import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
@@ -39,6 +39,8 @@ const BASE_URL = 'services';
 export class ServicesComponent extends ListWithDetails implements OnChanges, OnInit {
   @ViewChild(TableComponent, { static: true })
   table: TableComponent;
+  @ViewChild('runningTpl', { static: true })
+  public runningTpl: TemplateRef<any>;
 
   @Input() hostname: string;
 
@@ -68,6 +70,7 @@ export class ServicesComponent extends ListWithDetails implements OnChanges, OnI
   services: Array<CephServiceSpec> = [];
   isLoadingServices = false;
   selection: CdTableSelection = new CdTableSelection();
+  icons = Icons;
 
   constructor(
     private actionLabels: ActionLabelsI18n,
@@ -155,13 +158,9 @@ export class ServicesComponent extends ListWithDetails implements OnChanges, OnI
       },
       {
         name: $localize`Running`,
-        prop: 'status.running',
-        flexGrow: 1
-      },
-      {
-        name: $localize`Size`,
-        prop: 'status.size',
-        flexGrow: 1
+        prop: 'status',
+        flexGrow: 1,
+        cellTemplate: this.runningTpl
       },
       {
         name: $localize`Last Refreshed`,