Skip to content

Commit dc4ad93

Browse files
authored
Merge pull request ceph#51589 from rhcs-dashboard/services-running
mgr/dashboard: merge running and size columns in services page Reviewed-by: Aashish Sharma <[email protected]> Reviewed-by: Nizamudeen A <[email protected]>
2 parents 89fe1fe + 3eeca5c commit dc4ad93

File tree

2 files changed

+19
-8
lines changed

2 files changed

+19
-8
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,15 @@
2525
</cd-table>
2626
</ng-container>
2727
<router-outlet name="modal"></router-outlet>
28+
29+
30+
<ng-template #runningTpl
31+
let-value="value">
32+
<span ngbTooltip="Service instances running out of the total number of services requested.">
33+
{{ value.running }} / {{ value.size }}
34+
</span>
35+
<i *ngIf="value.running == 0 || value.size == 0"
36+
class="icon-warning-color"
37+
[ngClass]="[icons.warning]">
38+
</i>
39+
</ng-template>

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

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, Input, OnChanges, OnInit, ViewChild } from '@angular/core';
1+
import { Component, Input, OnChanges, OnInit, TemplateRef, ViewChild } from '@angular/core';
22
import { Router } from '@angular/router';
33

44
import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
@@ -39,6 +39,8 @@ const BASE_URL = 'services';
3939
export class ServicesComponent extends ListWithDetails implements OnChanges, OnInit {
4040
@ViewChild(TableComponent, { static: true })
4141
table: TableComponent;
42+
@ViewChild('runningTpl', { static: true })
43+
public runningTpl: TemplateRef<any>;
4244

4345
@Input() hostname: string;
4446

@@ -68,6 +70,7 @@ export class ServicesComponent extends ListWithDetails implements OnChanges, OnI
6870
services: Array<CephServiceSpec> = [];
6971
isLoadingServices = false;
7072
selection: CdTableSelection = new CdTableSelection();
73+
icons = Icons;
7174

7275
constructor(
7376
private actionLabels: ActionLabelsI18n,
@@ -155,13 +158,9 @@ export class ServicesComponent extends ListWithDetails implements OnChanges, OnI
155158
},
156159
{
157160
name: $localize`Running`,
158-
prop: 'status.running',
159-
flexGrow: 1
160-
},
161-
{
162-
name: $localize`Size`,
163-
prop: 'status.size',
164-
flexGrow: 1
161+
prop: 'status',
162+
flexGrow: 1,
163+
cellTemplate: this.runningTpl
165164
},
166165
{
167166
name: $localize`Last Refreshed`,

0 commit comments

Comments
 (0)