Skip to content

Commit d243a84

Browse files
committed
Fixed the Size Unit in Graph
Signed-off-by: Aravinda Vishwanathapura <[email protected]>
1 parent 0b66832 commit d243a84

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

gdash/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
"""Version"""
2-
VERSION = "1.0.3"
2+
VERSION = "1.0.4"

ui/src/components/helpers.jsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ export function capitalize(string) {
4747
}).join(' ');
4848
}
4949

50-
export function utilization(free, total, suffix) {
51-
let sizeP = free * 100 / total;
50+
export function utilization(used, total, suffix) {
51+
let sizeP = used * 100 / total;
5252

5353
let cls = "h-1 "
5454
if (sizeP > 90) {
@@ -65,7 +65,7 @@ export function utilization(free, total, suffix) {
6565
<div className="bg-gray-300 mb-1 w-3/4">
6666
<div style={{width: sizeP.toFixed(2) + "%"}} className={cls}></div>
6767
</div>
68-
<div className="text-gray-700">{humanReadable(free, suffix)} / {humanReadable(total, suffix)}</div>
68+
<div className="text-gray-700">{humanReadable(used, suffix)} / {humanReadable(total, suffix)}</div>
6969
</div>
7070
);
7171
}
@@ -79,7 +79,7 @@ export function sizeUtilization(volume) {
7979
return <>N/A</>
8080
}
8181

82-
return utilization(volume.size_free, volume.size_total, 'B');
82+
return utilization(volume.size_used, volume.size_total, 'B');
8383
}
8484

8585
export function inodesUtilization(volume) {
@@ -91,7 +91,7 @@ export function inodesUtilization(volume) {
9191
return <>N/A</>
9292
}
9393

94-
return utilization(volume.inodes_free, volume.inodes_total, '');
94+
return utilization(volume.inodes_used, volume.inodes_total, '');
9595
}
9696

9797
export function humanReadable(input_size, suffix) {

0 commit comments

Comments
 (0)