Files
guarddog-nexus/guarddog_nexus/web/templates/dashboard_stats.html

57 lines
1.7 KiB
HTML

<div class="stats-grid">
<article class="stat-card">
<h5>{{ total_scans }}</h5>
<small>Total Scans</small>
</article>
<article class="stat-card">
<h5 class="flagged">{{ flagged_scans }}</h5>
<small>Flagged</small>
</article>
<article class="stat-card">
<h5 class="flagged">{{ recent_flagged }}</h5>
<small>Flagged (7 days)</small>
</article>
<article class="stat-card">
<h5>{{ total_findings }}</h5>
<small>Total Findings</small>
</article>
</div>
<h2>Latest Scans</h2>
<table>
<thead>
<tr>
<th>Package</th>
<th>Version</th>
<th>Ecosystem</th>
<th>Status</th>
<th>Findings</th>
<th>Time</th>
</tr>
</thead>
<tbody>
{% for s in latest_scans %}
<tr>
<td><a href="/packages/{{ s.package_name }}/{{ s.package_version }}">{{ s.package_name }}</a></td>
<td>{{ s.package_version }}</td>
<td>{{ s.ecosystem }}</td>
<td><span class="status-{{ s.status }}">{{ s.status }}</span></td>
<td>{% if s.flagged %}<span class="flagged">{{ s.total_findings }}</span>{% else %}<span class="clean">{{ s.total_findings }}</span>{% endif %}</td>
<td>{{ s.started_at.strftime('%Y-%m-%d %H:%M') if s.started_at }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% if top_rules %}
<h2>Top Rules Triggered</h2>
<table>
<thead><tr><th>Rule</th><th>Count</th></tr></thead>
<tbody>
{% for rule, cnt in top_rules %}
<tr><td><code>{{ rule }}</code></td><td>{{ cnt }}</td></tr>
{% endfor %}
</tbody>
</table>
{% endif %}