feat: display version numbers on all Hub service tiles
Previously only bitcoind.service showed a version on the tile. Now every service with a parsable Nix store path gets its version displayed (electrs, btcpayserver, lnd, rtl, mempool, vaultwarden, matrix-synapse, caddy, tor, etc.). The existing _get_service_version() helper reads systemctl show <unit> --property=ExecStart and extracts the version from the Nix store path. Results are cached for 5 minutes per unit. Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
This commit is contained in:
co-authored by
arena-agent
parent
adde78320d
commit
43764e8c8d
@@ -3097,6 +3097,11 @@ async def api_services():
|
|||||||
service_data["version"] = btc_ver
|
service_data["version"] = btc_ver
|
||||||
if icon == "bip110":
|
if icon == "bip110":
|
||||||
service_data["bip110"] = await loop.run_in_executor(None, _get_bip110_status)
|
service_data["bip110"] = await loop.run_in_executor(None, _get_bip110_status)
|
||||||
|
# ── Generic version for all services (Nix store path) ──────────
|
||||||
|
if enabled and unit and "version" not in service_data:
|
||||||
|
ver = await loop.run_in_executor(None, _get_service_version, unit)
|
||||||
|
if ver is not None:
|
||||||
|
service_data["version"] = ver
|
||||||
return service_data
|
return service_data
|
||||||
|
|
||||||
results = await asyncio.gather(*[get_status(s) for s in services])
|
results = await asyncio.gather(*[get_status(s) for s in services])
|
||||||
@@ -3371,6 +3376,11 @@ async def api_service_detail(unit: str, icon: str | None = None):
|
|||||||
service_detail["version"] = btc_ver
|
service_detail["version"] = btc_ver
|
||||||
if icon == "bip110":
|
if icon == "bip110":
|
||||||
service_detail["bip110"] = await loop.run_in_executor(None, _get_bip110_status)
|
service_detail["bip110"] = await loop.run_in_executor(None, _get_bip110_status)
|
||||||
|
# ── Generic version for all services (Nix store path) ──────────
|
||||||
|
if enabled and unit and "version" not in service_detail:
|
||||||
|
ver = await loop.run_in_executor(None, _get_service_version, unit)
|
||||||
|
if ver is not None:
|
||||||
|
service_detail["version"] = ver
|
||||||
return service_detail
|
return service_detail
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user