Bytes from int to str

This commit is contained in:
inexcode 2022-07-25 17:17:57 +03:00
parent 5532114668
commit a6fe72608f

View file

@ -7,9 +7,9 @@ from selfprivacy_api.utils.block_devices import BlockDevices
@strawberry.type
class StorageVolume:
total_space: int
free_space: int
used_space: int
total_space: str
free_space: str
used_space: str
root: bool
name: str
@ -21,9 +21,9 @@ class Storage:
"""Get list of volumes"""
return [
StorageVolume(
total_space=volume.fssize if volume.fssize is not None else volume.size,
free_space=volume.fsavail,
used_space=volume.fsused,
total_space=str(volume.fssize) if volume.fssize is not None else str(volume.size),
free_space=str(volume.fsavail),
used_space=str(volume.fsused),
root=volume.name == "sda1",
name=volume.name,
)