mirror of
https://github.com/dw-0/kiauh.git
synced 2026-02-02 23:47:46 +05:00
Compare commits
1 Commits
45fde808d2
...
refactor/K
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
acb3a45018 |
@@ -152,7 +152,7 @@ def symlink_webui_nginx_log(
|
|||||||
def get_local_client_version(client: BaseWebClient) -> str | None:
|
def get_local_client_version(client: BaseWebClient) -> str | None:
|
||||||
relinfo_file = client.client_dir.joinpath("release_info.json")
|
relinfo_file = client.client_dir.joinpath("release_info.json")
|
||||||
version_file = client.client_dir.joinpath(".version")
|
version_file = client.client_dir.joinpath(".version")
|
||||||
default = "n/a"
|
default = "-"
|
||||||
|
|
||||||
if not client.client_dir.exists():
|
if not client.client_dir.exists():
|
||||||
return default
|
return default
|
||||||
|
|||||||
@@ -257,14 +257,14 @@ class UpdateMenu(BaseMenu):
|
|||||||
|
|
||||||
def _format_local_status(self, local_version, remote_version) -> str:
|
def _format_local_status(self, local_version, remote_version) -> str:
|
||||||
color = Color.RED
|
color = Color.RED
|
||||||
if not local_version:
|
if not local_version or local_version == '-':
|
||||||
color = Color.RED
|
color = Color.RED
|
||||||
elif local_version == remote_version:
|
elif local_version == remote_version:
|
||||||
color = Color.GREEN
|
color = Color.GREEN
|
||||||
elif local_version != remote_version:
|
elif local_version != remote_version:
|
||||||
color = Color.YELLOW
|
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:
|
def _set_status_data(self, name: str, status_fn: Callable, *args) -> None:
|
||||||
comp_status: ComponentStatus = status_fn(*args)
|
comp_status: ComponentStatus = status_fn(*args)
|
||||||
|
|||||||
Reference in New Issue
Block a user