{% import "macros.html" as ui %} {# The dashboard at /: one block per section, in the tree's order (AGENT, CODE, DATABASES, GIT), each number a link to the page it sums up (web.dashboard gives them, from the same functions as the pages). #} {% macro stat(number, label, url, level="") -%} {{ "{:,}".format(number) }}{{ label }} {%- endmacro %} {% macro head(icon, title, url) -%}

{{ ui.icon(icon) }}{{ title }}

{%- endmacro %}
{{ ui.view_header("project", "DOCTRACKER", "What each section holds now: a number opens the page it comes from.") }}
{% set agent = board.agent %}
{{ head("notes", "AGENT", "/agent") }}
{{ stat(agent.plans | length, "open plan" ~ ("" if agent.plans | length == 1 else "s"), "/agent/planner") }} {{ stat(agent.reviews.waiting, "commit" ~ ("" if agent.reviews.waiting == 1 else "s") ~ " waiting for review", "/agent/planner?plans=" ~ agent.reviews.id) }}
{% set code = board.code %}
{{ head("code", "CODE", "/code") }}
{{ stat(code.modules, "modules", "/code/diagrams/architecture") }} {{ stat(code.classes, "classes", "/code/diagrams/classes") }} {{ stat(code.functions, "functions", "/code/diagrams/calls") }} {{ stat(code.dead, "found in Dead Code", "/code/dead-code") }}
{% set db = board.databases %}
{{ head("database", "DATABASES", "/databases") }}
{{ stat(db.allowed, "connections allowed", db_urls.connections) }} {{ stat(db.blocked, "blocked", db_urls.connections) }} {{ stat(db.failing, "failing", db_urls.connections) }} {{ stat(db.differing, "of " ~ db.origins ~ " origins differ (Diff)", db_urls.diff) }}
{% for level, count in db.lint %}{{ stat(count, "lint " ~ level ~ ("" if count == 1 else "s"), db_urls.lint ~ "?f_level=" ~ level, level) }}{% endfor %}
{% set git = board.git %}
{{ head("git", "GIT", "/git") }}
{{ git.branch or "-" }}current branch {{ stat(git.changed, "file" ~ ("" if git.changed == 1 else "s") ~ " changed, not committed", "/git") }}