Admin pages: one shared specification, builders, fragments, caps and live refresh
Adds admin_sections registry, shared admin partials, WorkspaceList, admin CLAUDE.md spec, capped node/flag listings, and api/unit tests enforcing the spec. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -592,14 +592,23 @@ def raise_flag(kind: str, *, device_uid: str = "", user_uid: str = "", detail: s
|
||||
return table.find_one(uid=uid)
|
||||
|
||||
|
||||
def list_flags(status: str = FLAG_OPEN) -> list[dict]:
|
||||
def list_flags(status: str = FLAG_OPEN, limit: int | None = None) -> list[dict]:
|
||||
window = {} if limit is None else {"_limit": limit}
|
||||
return list(
|
||||
get_table("node_flags").find(
|
||||
status=status, deleted_at=None, order_by=["-created_at"]
|
||||
status=status, deleted_at=None, order_by=["-created_at"], **window
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
def count_flags(status: str = FLAG_OPEN) -> int:
|
||||
return get_table("node_flags").count(status=status, deleted_at=None)
|
||||
|
||||
|
||||
def count_all_devices() -> int:
|
||||
return get_table("node_devices").count(deleted_at=None)
|
||||
|
||||
|
||||
def resolve_flag(flag_uid: str, actor_uid: str) -> bool:
|
||||
return (
|
||||
_execute(
|
||||
|
||||
Reference in New Issue
Block a user