fix(ui): handle missing or empty local version values and standardize defaults

This commit is contained in:
dw-0
2026-01-18 14:17:34 +01:00
parent f951936b20
commit acb3a45018
2 changed files with 3 additions and 3 deletions

View File

@@ -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

View File

@@ -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)