From acb3a4501857403956eb1199ac5721e21f86e70a Mon Sep 17 00:00:00 2001 From: dw-0 Date: Sun, 18 Jan 2026 14:17:34 +0100 Subject: [PATCH] fix(ui): handle missing or empty local version values and standardize defaults --- kiauh/components/webui_client/client_utils.py | 2 +- kiauh/core/menus/update_menu.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/kiauh/components/webui_client/client_utils.py b/kiauh/components/webui_client/client_utils.py index 84ecca5..a01c4e0 100644 --- a/kiauh/components/webui_client/client_utils.py +++ b/kiauh/components/webui_client/client_utils.py @@ -152,7 +152,7 @@ def symlink_webui_nginx_log( def get_local_client_version(client: BaseWebClient) -> str | None: relinfo_file = client.client_dir.joinpath("release_info.json") version_file = client.client_dir.joinpath(".version") - default = "n/a" + default = "-" if not client.client_dir.exists(): return default diff --git a/kiauh/core/menus/update_menu.py b/kiauh/core/menus/update_menu.py index c8f3555..036474a 100644 --- a/kiauh/core/menus/update_menu.py +++ b/kiauh/core/menus/update_menu.py @@ -257,14 +257,14 @@ class UpdateMenu(BaseMenu): def _format_local_status(self, local_version, remote_version) -> str: color = Color.RED - if not local_version: + if not local_version or local_version == '-': color = Color.RED elif local_version == remote_version: color = Color.GREEN elif local_version != remote_version: color = Color.YELLOW - return Color.apply(local_version or "-", color) + return str(Color.apply(local_version or '-', color)) def _set_status_data(self, name: str, status_fn: Callable, *args) -> None: comp_status: ComponentStatus = status_fn(*args)