Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | 97x 97x 97x 97x 97x 97x | import { Component, Input, OnChanges } from '@angular/core';
@Component({
selector: 'cd-usage-bar',
template: require('./usage-bar.component.html'),
styles: []
})
export class UsageBarComponent implements OnChanges {
@Input()
totalBytes: number;
@Input()
usedBytes: number;
usedPercentage: number;
freePercentage: number;
freeBytes: number;
constructor() {}
ngOnChanges() {
this.usedPercentage = Math.round((this.usedBytes / this.totalBytes) * 100);
this.freePercentage = 100 - this.usedPercentage;
this.freeBytes = this.totalBytes - this.usedBytes;
}
}
|