mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2025-03-14 10:44:13 +00:00
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:
parent
f90eb3fb4c
commit
5602c96056
2 changed files with 9 additions and 1 deletions
|
@ -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)
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Add table
Reference in a new issue