feat: фаза 3 (часть 1) — disclaimer, очередь, initiator + IP

3.6 UI: убрать stat-minibar и heatmap с дашборда
3.2 AI disclaimer под каждым LLM-вердиктом
3.4 LLM_MAX_CONCURRENT_ANALYSES + Semaphore в llm.py
3.1 Scan.initiator + source_ip, webhook захватывает, UI показывает
This commit is contained in:
Marker689
2026-05-10 07:32:14 +03:00
parent 0069331119
commit 4ae893a025
13 changed files with 69 additions and 52 deletions

View File

@@ -1,47 +1,21 @@
<div class="stat-minibar">
<span><strong>{{ total_scans }}</strong> scans</span>
<span><strong class="flagged">{{ flagged_scans }}</strong> flagged</span>
<span><strong>{{ total_findings }}</strong> findings</span>
<span class="severity-ERROR"><strong>{{ errors_count }}</strong> errors</span>
<span class="severity-WARNING"><strong>{{ warnings_count }}</strong> warnings</span>
</div>
<div class="dashboard-grid">
{% if days %}
<article class="dash-block">
<h3>Scan activity (14 days)</h3>
<div class="heatmap">
{% set max_cnt = days | map(attribute=1) | max %}
{% for day, cnt, fl in days %}
<div class="heatmap-day" title="{{ day }}: {{ cnt }} scans, {{ fl }} flagged">
{% set h = (cnt / max_cnt * 38) | int if max_cnt > 0 else 0 %}
<div class="bar" style="height: {{ h }}px; background: {% if fl > 0 %}var(--pico-color-red-500){% else %}var(--pico-color-zinc-500){% endif %};"></div>
<div class="tooltip">{{ day }}: {{ cnt }} scans, {{ fl }} flagged</div>
</div>
{% endfor %}
</div>
</article>
{% endif %}
{% if latest_flagged %}
<article class="dash-block dash-block-warn">
<h3>Latest Flagged</h3>
<table class="compact">
<thead><tr><th>Package</th><th>Version</th><th>Findings</th><th>Time</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 %}
</div>
{% if latest_flagged %}
<article class="dash-block dash-block-warn">
<h3>Latest Flagged</h3>
<table class="compact">
<thead><tr><th>Package</th><th>Version</th><th>Findings</th><th>Time</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>Latest Scans</h3>