Implement get_services_status in cli_api & Remove

get_webpanel_services_status
This commit is contained in:
Iam54r1n4
2025-02-07 18:44:23 +00:00
parent afab1653df
commit 0980919eaa

View File

@ -43,6 +43,7 @@ class Command(Enum):
UNINSTALL_WARP = os.path.join(SCRIPT_DIR, 'warp', 'uninstall.sh')
CONFIGURE_WARP = os.path.join(SCRIPT_DIR, 'warp', 'configure.sh')
STATUS_WARP = os.path.join(SCRIPT_DIR, 'warp', 'status.sh')
SERVICES_STATUS = os.path.join(SCRIPT_DIR, 'services_status.sh')
# region Custom Exceptions
@ -463,9 +464,9 @@ def get_webpanel_api_token() -> str | None:
return run_cmd(['bash', Command.SHELL_WEBPANEL.value, 'api-token'])
def get_webpanel_services_status() -> dict[str, bool] | None:
'''Gets the status of WebPanel services.'''
if res := run_cmd(['bash', Command.SHELL_WEBPANEL.value, 'status']):
def get_services_status() -> dict[str, bool] | None:
'''Gets the status of all project services.'''
if res := run_cmd(['bash', Command.SERVICES_STATUS.value]):
return json.loads(res)
# endregion
# endregion