feat: enhance UI, refactor services, improve templates and tests

- Replace image_extractor with pdf_image_extractor service
- Enhance pi_client with expanded API capabilities
- Improve summarizer service with additional features
- Update admin routes with more endpoints
- Add login page template
- Enhance detail page with comprehensive layout
- Improve search and trends pages
- Update base template with additional elements
- Refactor tests for better coverage
- Add validate_summary script
- Update project configuration and dependencies
This commit is contained in:
2026-06-07 19:38:58 +08:00
parent 4a72c35452
commit 0d293422ac
32 changed files with 2003 additions and 586 deletions
+34 -16
View File
@@ -36,9 +36,17 @@
</td>
<td>
<span class="status-badge status-{{ log.status }}">
{% if log.status == 'success' %}✓ 成功 {% elif log.status ==
'running' %}⟳ 运行中 {% elif log.status == 'failed' %}✗ 失败 {%
else %}{{ log.status }}{% endif %}
{# djlint:off #}
{% if log.status == 'success' %}
✓ 成功
{% elif log.status == 'running' %}
⟳ 运行中
{% elif log.status == 'failed' %}
✗ 失败
{% else %}
{{ log.status }}
{% endif %}
{# djlint:on #}
</span>
</td>
<td>{{ log.date or '-' }}</td>
@@ -97,9 +105,17 @@
<td>{{ job.paper_count or 0 }}</td>
<td>
<span class="status-badge status-{{ job.status }}">
{% if job.status == 'success' %}✓ 成功 {% elif job.status ==
'running' %}⟳ 运行中 {% elif job.status == 'failed' %}✗ 失败 {%
else %}{{ job.status }}{% endif %}
{# djlint:off #}
{% if job.status == 'success' %}
✓ 成功
{% elif job.status == 'running' %}
⟳ 运行中
{% elif job.status == 'failed' %}
✗ 失败
{% else %}
{{ job.status }}
{% endif %}
{# djlint:on #}
</span>
</td>
<td class="time-cell">
@@ -345,21 +361,23 @@
{% endblock %} {% block scripts %}
<script>
function adminAction(action) {
const token = prompt("请输入 Admin Token:");
if (!token) return;
const url = "/admin/" + action;
fetch(url, {
method: "POST",
headers: {
Authorization: "Bearer " + token,
"Content-Type": "application/json",
},
headers: { "Content-Type": "application/json" },
})
.then((r) => r.json())
.then((r) => {
if (r.status === 303 || r.status === 401) {
window.location.href = "/admin/login";
return;
}
return r.json();
})
.then((data) => {
alert(JSON.stringify(data, null, 2));
location.reload();
if (data) {
alert(JSON.stringify(data, null, 2));
location.reload();
}
})
.catch((err) => {
alert("请求失败: " + err.message);