Skip to content

Commit 157c708

Browse files
author
Naman Munet
committed
mgr/dashboard: replace individual cluster's capacity info with Usage bar in Multi-Cluster
fixes: https://tracker.ceph.com/issues/67193 Signed-off-by: Naman Munet <[email protected]>
1 parent 6edfcab commit 157c708

File tree

2 files changed

+14
-19
lines changed

2 files changed

+14
-19
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,3 +266,10 @@ <h3>{{ queriesResults['TOTAL_HOSTS'][0][1] }}</h3>
266266
</ng-container>
267267
</div>
268268
</ng-container>
269+
270+
<ng-template #clusterUsageTpl
271+
let-row="row">
272+
<cd-usage-bar [total]="row.total_capacity"
273+
[used]="row.used_capacity">
274+
</cd-usage-bar>
275+
</ng-template>

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

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, OnDestroy, OnInit, ViewChild } from '@angular/core';
1+
import { Component, OnDestroy, OnInit, TemplateRef, ViewChild } from '@angular/core';
22
import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
33
import { Observable, Subscription } from 'rxjs';
44
import { MultiClusterService } from '~/app/shared/api/multi-cluster.service';
@@ -8,7 +8,6 @@ import { MultiClusterFormComponent } from './multi-cluster-form/multi-cluster-fo
88
import { PrometheusService } from '~/app/shared/api/prometheus.service';
99
import { CdTableColumn } from '~/app/shared/models/cd-table-column';
1010
import { CellTemplate } from '~/app/shared/enum/cell-template.enum';
11-
import { DimlessBinaryPipe } from '~/app/shared/pipes/dimless-binary.pipe';
1211
import { Router } from '@angular/router';
1312

1413
import {
@@ -26,6 +25,8 @@ import { SettingsService } from '~/app/shared/api/settings.service';
2625
export class MultiClusterComponent implements OnInit, OnDestroy {
2726
COUNT_OF_UTILIZATION_CHARTS = 5;
2827

28+
@ViewChild('clusterUsageTpl', { static: true })
29+
clusterUsageTpl: TemplateRef<any>;
2930
@ViewChild('nameTpl', { static: true })
3031
nameTpl: any;
3132

@@ -95,8 +96,7 @@ export class MultiClusterComponent implements OnInit, OnDestroy {
9596
private settingsService: SettingsService,
9697
private modalService: ModalService,
9798
private router: Router,
98-
private prometheusService: PrometheusService,
99-
private dimlessBinaryPipe: DimlessBinaryPipe
99+
private prometheusService: PrometheusService
100100
) {
101101
this.multiClusterQueries = {
102102
cluster: {
@@ -151,21 +151,9 @@ export class MultiClusterComponent implements OnInit, OnDestroy {
151151
{ prop: 'alert', name: $localize`Alerts`, flexGrow: 1 },
152152
{ prop: 'version', name: $localize`Version`, flexGrow: 2 },
153153
{
154-
prop: 'total_capacity',
155-
name: $localize`Total Capacity`,
156-
pipe: this.dimlessBinaryPipe,
157-
flexGrow: 1
158-
},
159-
{
160-
prop: 'used_capacity',
161-
name: $localize`Used Capacity`,
162-
pipe: this.dimlessBinaryPipe,
163-
flexGrow: 1
164-
},
165-
{
166-
prop: 'available_capacity',
167-
name: $localize`Available Capacity`,
168-
pipe: this.dimlessBinaryPipe,
154+
prop: 'usage',
155+
name: $localize`Usage`,
156+
cellTemplate: this.clusterUsageTpl,
169157
flexGrow: 1
170158
},
171159
{ prop: 'pools', name: $localize`Pools`, flexGrow: 1 },

0 commit comments

Comments
 (0)