1- import { Component , OnDestroy , OnInit , ViewChild } from '@angular/core' ;
1+ import { Component , OnDestroy , OnInit , TemplateRef , ViewChild } from '@angular/core' ;
22import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap' ;
33import { Observable , Subscription } from 'rxjs' ;
44import { MultiClusterService } from '~/app/shared/api/multi-cluster.service' ;
@@ -8,7 +8,6 @@ import { MultiClusterFormComponent } from './multi-cluster-form/multi-cluster-fo
88import { PrometheusService } from '~/app/shared/api/prometheus.service' ;
99import { CdTableColumn } from '~/app/shared/models/cd-table-column' ;
1010import { CellTemplate } from '~/app/shared/enum/cell-template.enum' ;
11- import { DimlessBinaryPipe } from '~/app/shared/pipes/dimless-binary.pipe' ;
1211import { Router } from '@angular/router' ;
1312
1413import {
@@ -26,6 +25,8 @@ import { SettingsService } from '~/app/shared/api/settings.service';
2625export 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