54 lines
1.8 KiB
HTML
54 lines
1.8 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block title %}文档中心{% endblock %}
|
|
|
|
{% block content %}
|
|
<header class="page-header">
|
|
<span class="eyebrow">知识库资料</span>
|
|
<h1 class="page-title">文档中心</h1>
|
|
<p class="page-lead">上传题目材料后,可以在这里管理文件状态,并手动触发入库。</p>
|
|
<p style="margin-top: 14px;"><a class="button button-primary" href="{% url 'documents:upload' %}">上传新文件</a></p>
|
|
</header>
|
|
|
|
<article class="panel">
|
|
<table class="kv-table">
|
|
<thead>
|
|
<tr>
|
|
<th>文件名</th>
|
|
<th>场景</th>
|
|
<th>类型</th>
|
|
<th>大小</th>
|
|
<th>状态</th>
|
|
<th>操作</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for document in documents %}
|
|
<tr>
|
|
<td>{{ document.original_name }}</td>
|
|
<td>{{ document.scenario_id }}</td>
|
|
<td>{{ document.file_type }}</td>
|
|
<td>{{ document.size }}</td>
|
|
<td>{{ document.status }}</td>
|
|
<td>
|
|
{% if document.status != "indexed" %}
|
|
<form action="{% url 'documents:index' document.id %}" method="post">
|
|
{% csrf_token %}
|
|
<button type="submit">执行入库</button>
|
|
</form>
|
|
{% else %}
|
|
<span class="status status-success">已可用于检索</span>
|
|
{% endif %}
|
|
{% if document.error_message %}
|
|
<pre class="code-block" style="margin-top: 10px;">{{ document.error_message }}</pre>
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|
|
{% empty %}
|
|
<tr><td colspan="6">暂无文件,请先上传题目材料。</td></tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</article>
|
|
{% endblock %}
|