Files
guarddog-nexus/guarddog_nexus/web/templates/dashboard_stats.html
Marker689 dea9e0a6e4 a11y: Web Interface Guidelines — 19 правок доступности и семантики
- base.html: lang динамический, meta theme-color, skip-link, убран дубль Dashboard
- Фильтры: labels на search/select, type=search, placeholder с …, autocomplete=off
- llm-retry: <span> → <button> во всех шаблонах (_llm_report, scan, package)
- sortable th: tabindex=0, role=button через JS + keyboard handler
- sort-icon: aria-hidden=true
- style.css: color-scheme:dark, prefers-reduced-motion, tabular-nums, touch-action
- app.js: clipboard fallback для не-HTTPS
2026-05-10 11:45:41 +03:00

66 lines
3.3 KiB
HTML

{% if total_findings %}
<div style="display:flex; gap:1.5rem; padding:0.3rem 0; margin-bottom:1rem; border-bottom:1px solid #2a3140; font-size:0.82rem; opacity:0.8; flex-wrap:wrap;">
<span>{{ t('total_scans_label', request.state.lang) }}: <strong>{{ total_scans }}</strong></span>
<span>{{ t('flagged_scans_label', request.state.lang) }}: <strong>{{ flagged_scans }}</strong></span>
<span>{{ t('col_findings', request.state.lang) }}: <strong>{{ total_findings }}</strong></span>
<span>{{ t('llm_analyzed', request.state.lang) }}: <strong>{{ llm_analyzed }}</strong></span>
<span>{{ t('llm_pending', request.state.lang) }}: <strong>{{ llm_pending }}</strong></span>
</div>
{% endif %}
{% if top_rules %}
<article class="dash-block" style="margin-bottom:1rem;">
<h3>{{ t('heading_top_rules', request.state.lang) }}</h3>
<table class="compact">
<tbody>
{% for r in top_rules %}
<tr><td><strong>{{ r.rule }}</strong></td><td>{{ r.count }}</td></tr>
{% endfor %}
</tbody>
</table>
</article>
{% endif %}
{% if latest_flagged %}
<article class="dash-block dash-block-warn">
<h3>{{ t('heading_latest_flagged', request.state.lang) }}</h3>
<table class="compact">
<thead><tr><th>{{ t('col_package', request.state.lang) }}</th><th>{{ t('col_version', request.state.lang) }}</th><th>{{ t('col_findings', request.state.lang) }}</th><th>{{ t('col_time', request.state.lang) }}</th></tr></thead>
<tbody>
{% for s in latest_flagged %}
<tr>
<td><a href="/scans/{{ s.id }}"><strong class="flagged">{{ s.package_name }}</strong></a></td>
<td>{{ s.package_version }}</td>
<td><span class="flagged">{{ s.total_findings }}</span></td>
<td>{{ s.started_at.strftime('%m-%d %H:%M') if s.started_at }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</article>
{% endif %}
<article class="dash-block" style="margin-top: 0;">
<h3>{{ t('heading_latest_scans', request.state.lang) }}</h3>
<table class="compact">
<thead>
<tr><th>{{ t('col_package', request.state.lang) }}</th><th>{{ t('col_version', request.state.lang) }}</th><th>{{ t('col_repo', request.state.lang) }}</th><th>{{ t('col_status', request.state.lang) }}</th><th></th><th>{{ t('col_time', request.state.lang) }}</th></tr>
</thead>
<tbody>
{% for s in latest_scans %}
<tr>
<td><a href="/packages/{{ s.package_name | urlencode }}/{{ s.package_version | urlencode }}">{{ s.package_name }}</a></td>
<td>{{ s.package_version }}</td>
<td><small>{{ s.repository }}</small></td>
<td>
{% with status=s.status %}{% include "_status_badge.html" %}{% endwith %}
</td>
<td>{% if s.flagged %}<span class="flagged">⚠ {{ s.total_findings }}</span>{% elif s.status == 'completed' %}<span class="clean"></span>{% else %}<span>-</span>{% endif %}</td>
<td>{{ s.started_at.strftime('%m-%d %H:%M') if s.started_at }}</td>
</tr>
{% endfor %}
</tbody>
</table>
<small><a href="/scans">{{ t('view_all_scans', request.state.lang) }}</a></small>
</article>
<small style="opacity: 0.4;">{{ t('refresh_hint', request.state.lang, now.strftime('%H:%M:%S')) }}</small>