]> git.proxmox.com Git - ceph.git/blame - ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/components/usage-bar/usage-bar.component.ts
bump version to 15.2.4-pve1
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / shared / components / usage-bar / usage-bar.component.ts
CommitLineData
11fdf7f2
TL
1import { Component, Input, OnChanges } from '@angular/core';
2
3@Component({
4 selector: 'cd-usage-bar',
5 templateUrl: './usage-bar.component.html',
6 styleUrls: ['./usage-bar.component.scss']
7})
8export class UsageBarComponent implements OnChanges {
9 @Input()
10 totalBytes: number;
11 @Input()
12 usedBytes: number;
13
14 usedPercentage: number;
15 freePercentage: number;
16 freeBytes: number;
17
18 constructor() {}
19
20 ngOnChanges() {
21 this.usedPercentage = Math.round((this.usedBytes / this.totalBytes) * 100);
22 this.freePercentage = 100 - this.usedPercentage;
23 this.freeBytes = this.totalBytes - this.usedBytes;
24 }
25}