fix(kb): 完善知识库入库和重建索引

This commit is contained in:
2026-06-08 23:45:34 +08:00
parent d8cd95e590
commit 2b5093040d
9 changed files with 355 additions and 9 deletions

View File

@@ -32,6 +32,7 @@
class="knowledge-page"
data-document-url="{% url 'knowledge_base_document_list' %}"
data-search-url="{% url 'knowledge_base_search' %}"
data-rebuild-url="{% url 'knowledge_base_rebuild_index' %}"
>
<header class="attachment-manager-hero attachment-manager-toolbar">
<div>
@@ -96,9 +97,10 @@
</div>
</dl>
<p class="knowledge-panel-note">{{ knowledge_base.status.message }}</p>
<p class="upload-status" id="knowledgeRebuildStatus"></p>
<div class="knowledge-form-actions">
<button type="button" onclick="window.location.reload()">刷新状态</button>
<button type="button" disabled>重建索引</button>
<button type="button" id="knowledgeRebuildIndexButton">重建索引</button>
</div>
</section>
@@ -182,6 +184,7 @@
<th>类型</th>
<th>大小</th>
<th>索引</th>
<th>操作</th>
</tr>
</thead>
<tbody>
@@ -192,10 +195,13 @@
<td>{{ source.suffix }}</td>
<td>{{ source.size }} bytes</td>
<td>{{ source.indexed_label }}</td>
<td class="attachment-actions">
<button type="button" data-source-action="index">手动入库</button>
</td>
</tr>
{% empty %}
<tr>
<td colspan="5" class="table-empty">暂无法规材料</td>
<td colspan="6" class="table-empty">暂无法规材料</td>
</tr>
{% endfor %}
</tbody>
@@ -209,5 +215,5 @@
{% endblock %}
{% block scripts %}
<script src="{% static 'js/knowledge_base.js' %}?v=20260608-kb5"></script>
<script src="{% static 'js/knowledge_base.js' %}?v=20260608-kb6"></script>
{% endblock %}