0.36.0: per-stack image-update indicator on the Stacks overview
Shows an amber "Update" pill next to a stack's status (and highlights the
inline Update button) when any of the stack's images has a newer digest in
the registry. Reuses the existing background image-update check — a new
update_service.stacks_update_summary() reads the cached digests in a single
container sweep (no extra registry calls), exposed as GET /api/stacks/updates
and proxied per agent at GET /api/agents/{id}/stacks/updates. The Stacks page
and each remote-host section poll it every 60s.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
a4b1bbcdd1
commit
cd15cdc75e
@@ -226,6 +226,16 @@ async def agent_stacks_stats(
|
||||
return await _proxy(session, agent, "GET", "/agent/stacks/stats")
|
||||
|
||||
|
||||
@router.get("/{agent_id}/stacks/updates")
|
||||
async def agent_stacks_updates(
|
||||
agent_id: int,
|
||||
session: Session = Depends(get_session),
|
||||
_user: User = Depends(get_current_user),
|
||||
) -> dict:
|
||||
agent = _get_or_404(session, agent_id)
|
||||
return await _proxy(session, agent, "GET", "/agent/stacks/updates")
|
||||
|
||||
|
||||
@router.get("/{agent_id}/stacks/{stack_id}")
|
||||
async def agent_stack_detail(
|
||||
agent_id: int,
|
||||
|
||||
@@ -27,7 +27,7 @@ from models.setting import (
|
||||
)
|
||||
from models.auto_update import AutoUpdateRead, AutoUpdateWrite
|
||||
from models.user import User
|
||||
from services import audit_service, auto_update_service, compose_service, notify_service, stats_service
|
||||
from services import audit_service, auto_update_service, compose_service, notify_service, stats_service, update_service
|
||||
from services.convert_service import convert_docker_run
|
||||
|
||||
router = APIRouter(prefix="/api/stacks", tags=["stacks"])
|
||||
@@ -144,6 +144,13 @@ def stacks_stats(_user: User = Depends(get_current_user)) -> dict:
|
||||
return stats_service.stack_stats()
|
||||
|
||||
|
||||
@router.get("/updates")
|
||||
def stacks_updates(_user: User = Depends(get_current_user)) -> dict:
|
||||
"""Per-stack image-update availability, read from the cached registry
|
||||
digests (no live registry calls — safe for the list to poll)."""
|
||||
return update_service.stacks_update_summary()
|
||||
|
||||
|
||||
@router.get("/{stack_id}")
|
||||
def get_stack(
|
||||
stack_id: str,
|
||||
|
||||
Reference in New Issue
Block a user