import { TabsModule } from 'ngx-bootstrap/tabs';
+import { ComponentsModule } from '../../../../shared/components/components.module';
import { DataTableModule } from '../../../../shared/datatable/datatable.module';
import { DimlessPipe } from '../../../../shared/pipes/dimless.pipe';
import { FormatterService } from '../../../../shared/services/formatter.service';
HttpClientModule,
PerformanceCounterModule,
TabsModule.forRoot(),
- DataTableModule
+ DataTableModule,
+ ComponentsModule
],
declarations: [
OsdListComponent,
import { CellTemplate } from '../../../../shared/enum/cell-template.enum';
import { CdTableColumn } from '../../../../shared/models/cd-table-column';
import { CdTableSelection } from '../../../../shared/models/cd-table-selection';
-import { DimlessPipe } from '../../../../shared/pipes/dimless.pipe';
+import { DimlessBinaryPipe } from '../../../../shared/pipes/dimless-binary.pipe';
import { OsdService } from '../osd.service';
@Component({
export class OsdListComponent implements OnInit {
@ViewChild('statusColor') statusColor: TemplateRef<any>;
+ @ViewChild('osdUsageTpl') osdUsageTpl: TemplateRef<any>;
osds = [];
columns: CdTableColumn[];
constructor(
private osdService: OsdService,
- private dimlessPipe: DimlessPipe
+ private dimlessBinaryPipe: DimlessBinaryPipe
) { }
ngOnInit() {
{prop: 'id', name: 'ID', cellTransformation: CellTemplate.bold},
{prop: 'collectedStates', name: 'Status', cellTemplate: this.statusColor},
{prop: 'stats.numpg', name: 'PGs'},
- {prop: 'usedPercent', name: 'Usage'},
+ {prop: 'stats.stat_bytes', name: 'Size', pipe: this.dimlessBinaryPipe},
+ {name: 'Usage', cellTemplate: this.osdUsageTpl},
{
prop: 'stats_history.out_bytes',
name: 'Read bytes',
osd.collectedStates = this.collectStates(osd);
osd.stats_history.out_bytes = osd.stats_history.op_out_bytes.map(i => i[1]);
osd.stats_history.in_bytes = osd.stats_history.op_in_bytes.map(i => i[1]);
- osd.usedPercent = this.dimlessPipe.transform(osd.stats.stat_bytes_used) + ' / ' +
- this.dimlessPipe.transform(osd.stats.stat_bytes);
return osd;
});
});