87 lines
3.7 KiB
HTML
87 lines
3.7 KiB
HTML
{% extends "base.html" %}
|
|
{% block title %}{{ t('title_package_detail', request.state.lang, pkg_name, pkg_version) }}{% endblock %}
|
|
{% block breadcrumbs %}
|
|
<div class="breadcrumbs">
|
|
<a href="/">{{ t('breadcrumb_home', request.state.lang) }}</a>
|
|
<span class="separator">/</span>
|
|
<a href="/packages">{{ t('breadcrumb_packages', request.state.lang) }}</a>
|
|
<span class="separator">/</span>
|
|
<span>{{ pkg_name }} v{{ pkg_version }}</span>
|
|
</div>
|
|
{% endblock %}
|
|
{% block content %}
|
|
<h1>{{ pkg_name }} <small>v{{ pkg_version }}</small></h1>
|
|
|
|
<article class="scan-info-block">
|
|
<h2>{{ t('heading_scans_count', request.state.lang, scans|length) }}</h2>
|
|
<table class="compact">
|
|
<thead>
|
|
<tr><th>{{ t('col_id', request.state.lang) }}</th><th>{{ t('col_repo', request.state.lang) }}</th><th>{{ t('col_status', 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 scans %}
|
|
<tr>
|
|
<td><a href="/scans/{{ s.id }}">#{{ s.id }}</a></td>
|
|
<td>{{ s.repository }}</td>
|
|
<td>
|
|
{% with status=s.status %}{% include "_status_badge.html" %}{% endwith %}
|
|
</td>
|
|
<td>{% if s.flagged %}<span class="flagged">{{ s.total_findings }}</span>{% else %}<span class="clean">0</span>{% endif %}</td>
|
|
<td>{{ s.started_at.strftime('%Y-%m-%d %H:%M') if s.started_at }}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</article>
|
|
|
|
<h2 style="margin-bottom: 0.75rem;">{{ t('heading_findings_count', request.state.lang, findings|length) }}</h2>
|
|
|
|
{% if findings %}
|
|
<div id="findings-container">
|
|
{% for f in findings %}
|
|
<div class="finding-block finding-{{ f.data.severity|lower }}">
|
|
<div class="finding-summary">
|
|
<strong class="severity-{{ f.data.severity }}">[{{ f.data.severity }}]</strong>
|
|
<strong>{{ f.data.rule }}</strong>
|
|
{% if f.data.location %}<small> @ {{ f.data.location }}</small>{% endif %}
|
|
</div>
|
|
<div class="finding-body">
|
|
<p>{{ f.data.message }}</p>
|
|
{% if f.data.code %}
|
|
<div class="code-toolbar">
|
|
<button class="copy-btn" onclick="copyCode(this, 'code-{{ f.id }}')">{{ t('btn_copy', request.state.lang) }}</button>
|
|
</div>
|
|
<pre><code id="code-{{ f.id }}">{{ f.data.code }}</code></pre>
|
|
{% endif %}
|
|
|
|
{% if f.report and f.report.status == "analyzing" %}
|
|
{% with finding_id=f.id %}
|
|
{% include "_llm_spinner.html" %}
|
|
{% endwith %}
|
|
{% elif f.report and f.report.verdict %}
|
|
{% with report=f.report, finding_id=f.id %}
|
|
{% include "_llm_report_fragment.html" %}
|
|
{% endwith %}
|
|
{% elif config.llm_enabled and not config.llm_auto_analyze %}
|
|
<div class="llm-actions" id="llm-{{ f.id }}">
|
|
<button class="outline"
|
|
hx-post="/api/v1/findings/{{ f.id }}/analyze"
|
|
hx-target="#llm-{{ f.id }}"
|
|
hx-swap="outerHTML"
|
|
hx-indicator="#llm-spinner-{{ f.id }}">
|
|
<span id="llm-spinner-{{ f.id }}" class="htmx-indicator">
|
|
<span class="spinner"></span>
|
|
</span>
|
|
{{ t('btn_analyze_llm', request.state.lang) }}
|
|
</button>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
{% else %}
|
|
<p class="empty-state">{{ t('empty_no_findings', request.state.lang) }}</p>
|
|
{% endif %}
|
|
{% endblock %}
|