Fix tool install-state, inherit program description, declutter Tools cards
- Tool detail showed installed tools as 'Not installed': /deployments/{name}
populated 'installed' for path deployments but left 'active' null, and
ToolDetail keyed off 'active'. Now the endpoint sets active=installed for path,
and ToolDetail reads 'installed' directly (verified: on-PATH ⇒ True, else False).
- A deployment now inherits its program's description by default: copied at
creation (CLI create + API _save_deployment on new deployments) + a one-time
patchup of existing ones (29 deployments).
- Tools page cards no longer list deployments (ProgramCard showDeployments=false) —
the lens already scopes to the tool; the deployment list is a Programs-catalog thing.
This commit is contained in:
@@ -77,10 +77,13 @@ def _summary_from_deployed(name: str, deployed: object) -> DeploymentSummary:
|
||||
timer=has_timer,
|
||||
)
|
||||
|
||||
# A PATH-managed deployment (a tool) is "installed" when it's on PATH.
|
||||
# A PATH-managed deployment (a tool) is "installed" — and thus active — when
|
||||
# it's on PATH. (systemd/caddy liveness comes from the health/status stream.)
|
||||
installed: bool | None = None
|
||||
active: bool | None = None
|
||||
if deployed.manager == "path":
|
||||
installed = shutil.which(name) is not None
|
||||
active = installed
|
||||
|
||||
category = "job" if deployed.schedule else "service"
|
||||
|
||||
@@ -99,6 +102,7 @@ def _summary_from_deployed(name: str, deployed: object) -> DeploymentSummary:
|
||||
systemd=systemd_info,
|
||||
schedule=deployed.schedule,
|
||||
installed=installed,
|
||||
active=active,
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user