- before_request guard: visitors browse + explore; writes need PHYSCOM_ADMIN_TOKEN login - SameSite=Lax/HttpOnly cookies, persisted secret key, debug off unless FLASK_DEBUG=1 - non-root gunicorn container with healthcheck; physcom demo --if-empty on first start - landing page Top Concepts, write controls hidden from visitors - CI workflow, pyproject metadata, compose Ollama parity, README rewrite - tests/test_web_access.py: access control + GET smoke test of every page Co-Authored-By: Claude <noreply@anthropic.com>
121 lines
4.1 KiB
HTML
121 lines
4.1 KiB
HTML
{% extends "base.html" %}
|
|
{% block title %}Results — PhysCom{% endblock %}
|
|
|
|
{% block content %}
|
|
<h1>Results</h1>
|
|
|
|
<div class="form-row" style="margin-bottom:1rem">
|
|
{% for d in domains %}
|
|
<a href="{{ url_for('results.results_domain', domain_name=d.name) }}"
|
|
class="btn {{ 'btn-primary' if domain and domain.name == d.name else '' }}">
|
|
{{ d.name }}
|
|
</a>
|
|
{% endfor %}
|
|
</div>
|
|
|
|
{% if domain and results is not none %}
|
|
<div class="card">
|
|
<div class="page-header">
|
|
<h2>{{ domain.name }} <span class="subtitle">{{ domain.description }}</span></h2>
|
|
<form method="post" action="{{ url_for('results.reset_results', domain_name=domain.name) }}"
|
|
class="inline-form"
|
|
onsubmit="return confirm('Delete all results for {{ domain.name }}? This cannot be undone.')">
|
|
<button type="submit" class="btn btn-danger btn-sm">Reset results</button>
|
|
</form>
|
|
</div>
|
|
|
|
{% if statuses %}
|
|
<div class="filter-row">
|
|
<span>Status:</span>
|
|
<a href="{{ url_for('results.results_domain', domain_name=domain.name, rating=rating_filter) }}"
|
|
class="btn btn-sm {{ '' if status_filter else 'btn-primary' }}">All ({{ total_results }})</a>
|
|
{% for s, cnt in statuses.items() %}
|
|
<a href="{{ url_for('results.results_domain', domain_name=domain.name, status=s, rating=rating_filter) }}"
|
|
class="btn btn-sm {{ 'btn-primary' if status_filter == s else '' }}">
|
|
{{ s }} ({{ cnt }})
|
|
</a>
|
|
{% endfor %}
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% if ratings %}
|
|
<div class="filter-row">
|
|
<span>Rating:</span>
|
|
<a href="{{ url_for('results.results_domain', domain_name=domain.name, status=status_filter) }}"
|
|
class="btn btn-sm {{ '' if not rating_filter else 'btn-primary' }}">All</a>
|
|
{% for rt in ['HIGH', 'MEDIUM', 'LOW'] %}
|
|
{% if rt in ratings %}
|
|
<a href="{{ url_for('results.results_domain', domain_name=domain.name, status=status_filter, rating=rt) }}"
|
|
class="btn btn-sm {{ 'btn-primary' if rating_filter == rt else '' }}">
|
|
{{ rt }} ({{ ratings[rt] }})
|
|
</a>
|
|
{% endif %}
|
|
{% endfor %}
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% if not results %}
|
|
{% if status_filter or rating_filter %}
|
|
<p class="empty">No results matching that filter in this domain.</p>
|
|
{% else %}
|
|
<p class="empty">No results for this domain yet.{% if is_admin() %} <a href="{{ url_for('pipeline.pipeline_form') }}">Run the pipeline</a> first.{% endif %}</p>
|
|
{% endif %}
|
|
{% else %}
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>#</th>
|
|
<th>Score</th>
|
|
<th>Entities</th>
|
|
<th>Status</th>
|
|
<th>Rating</th>
|
|
<th>Details</th>
|
|
<th></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for r in results %}
|
|
<tr>
|
|
<td>{{ loop.index }}</td>
|
|
<td class="score-cell">{{ "%.4f"|format(r.composite_score) if r.composite_score is not none else '—' }}</td>
|
|
<td>{{ r.combination.entities|map(attribute='name')|join(' + ') }}</td>
|
|
<td>
|
|
{%- if r.domain_block_reason -%}
|
|
<span class="badge badge-p1_fail">domain_blocked</span>
|
|
{%- else -%}
|
|
<span class="badge badge-{{ r.combination.status }}">{{ r.combination.status }}</span>
|
|
{%- endif -%}
|
|
</td>
|
|
<td>
|
|
{%- if r.qualitative_rating -%}
|
|
<span class="badge badge-rating-{{ r.qualitative_rating|lower }}">{{ r.qualitative_rating }}</span>
|
|
{%- else -%}
|
|
—
|
|
{%- endif -%}
|
|
</td>
|
|
<td class="block-reason-cell">
|
|
{%- if r.domain_block_reason -%}
|
|
{{ r.domain_block_reason }}
|
|
{%- elif r.combination.status.endswith('_fail') and r.combination.block_reason -%}
|
|
{{ r.combination.block_reason }}
|
|
{%- elif r.novelty_flag -%}
|
|
{{ r.novelty_flag }}
|
|
{%- else -%}
|
|
—
|
|
{%- endif -%}
|
|
</td>
|
|
<td>
|
|
<a href="{{ url_for('results.result_detail', domain_name=domain.name, combo_id=r.combination.id) }}"
|
|
class="btn btn-sm">View</a>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
{% endif %}
|
|
</div>
|
|
{% elif not domain %}
|
|
<p class="empty">Select a domain above to view results.</p>
|
|
{% endif %}
|
|
{% endblock %}
|