feat(services): rename "sda1" to "system disk" and etc (#122)

Closes #51

Reviewed-on: https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api/pulls/122
Reviewed-by: Inex Code <inex.code@selfprivacy.org>
Co-authored-by: Maxim Leshchenko <cnmaks90@gmail.com>
Co-committed-by: Maxim Leshchenko <cnmaks90@gmail.com>
This commit is contained in:
Maxim Leshchenko 2024-06-27 17:41:46 +03:00 committed by Inex Code
parent f90eb3fb4c
commit 5602c96056
2 changed files with 9 additions and 1 deletions

View File

@ -27,7 +27,7 @@ def move_service(service_id: str, volume_name: str) -> Job:
job = Jobs.add(
type_id=f"services.{service.get_id()}.move",
name=f"Move {service.get_display_name()}",
description=f"Moving {service.get_display_name()} data to {volume.name}",
description=f"Moving {service.get_display_name()} data to {volume.get_display_name().lower()}",
)
move_service_task(service, volume, job)

View File

@ -90,6 +90,14 @@ class BlockDevice:
def __hash__(self):
return hash(self.name)
def get_display_name(self) -> str:
if self.is_root():
return "System disk"
elif self.model == "Volume":
return "Expandable volume"
else:
return self.name
def is_root(self) -> bool:
"""
Return True if the block device is the root device.