feat(dashboard): 增加首页工作台并调整聊天入口
This commit is contained in:
@@ -9,8 +9,8 @@
|
||||
<header class="topbar">
|
||||
<div class="topbar-left">
|
||||
<div class="tabbar" role="tablist" aria-label="页面切换">
|
||||
<a class="tab" href="/" role="tab" aria-selected="false">首页</a>
|
||||
<a class="tab" href="/" role="tab" aria-selected="false">审核智能体</a>
|
||||
<a class="tab" href="{% url 'home' %}" role="tab" aria-selected="false">首页</a>
|
||||
<a class="tab" href="{% url 'chat' %}" role="tab" aria-selected="false">审核智能体</a>
|
||||
<a class="tab" href="{% url 'knowledge_base_manager' %}" role="tab" aria-selected="false">知识库管理</a>
|
||||
<a class="tab active" href="{% url 'attachment_manager' %}" role="tab" aria-selected="true">附件管理</a>
|
||||
</div>
|
||||
@@ -52,7 +52,7 @@
|
||||
{% endfor %}
|
||||
</select>
|
||||
{% if selected_conversation %}
|
||||
<a class="return-chat-link" href="{% url 'home' %}?conversation={{ selected_conversation.pk }}">返回对话</a>
|
||||
<a class="return-chat-link" href="{% url 'chat' %}?conversation={{ selected_conversation.pk }}">返回对话</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</header>
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
<header class="topbar">
|
||||
<div class="topbar-left">
|
||||
<div class="tabbar" role="tablist" aria-label="页面切换">
|
||||
<a class="tab" href="/" role="tab" aria-selected="false">首页</a>
|
||||
<a class="tab active" href="/" role="tab" aria-selected="true">审核智能体</a>
|
||||
<a class="tab" href="{% url 'home' %}" role="tab" aria-selected="false">首页</a>
|
||||
<a class="tab active" href="{% url 'chat' %}" role="tab" aria-selected="true">审核智能体</a>
|
||||
<a class="tab" href="{% url 'knowledge_base_manager' %}" role="tab" aria-selected="false">知识库管理</a>
|
||||
<a class="tab" href="{% url 'attachment_manager' %}" role="tab" aria-selected="false">附件管理</a>
|
||||
</div>
|
||||
@@ -79,7 +79,7 @@
|
||||
>
|
||||
<a
|
||||
class="history-link"
|
||||
href="/?conversation={{ conversation.pk }}{% if search_query %}&q={{ search_query|urlencode }}{% endif %}"
|
||||
href="{% url 'chat' %}?conversation={{ conversation.pk }}{% if search_query %}&q={{ search_query|urlencode }}{% endif %}"
|
||||
>
|
||||
<span class="history-title">{{ conversation.title|default:"新对话" }}</span>
|
||||
<span class="history-meta">{{ conversation.updated_at|date:"m月d日 H:i" }}</span>
|
||||
@@ -202,7 +202,7 @@
|
||||
</div>
|
||||
|
||||
<div class="composer-wrap">
|
||||
<form class="composer" action="/" method="post" id="chatComposer">
|
||||
<form class="composer" action="{% url 'chat' %}" method="post" id="chatComposer">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="action" value="send_message">
|
||||
<input type="hidden" name="conversation_id" id="conversationIdInput" value="{% if current_conversation %}{{ current_conversation.pk }}{% endif %}">
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
<header class="topbar">
|
||||
<div class="topbar-left">
|
||||
<div class="tabbar" role="tablist" aria-label="页面切换">
|
||||
<a class="tab" href="/" role="tab" aria-selected="false">首页</a>
|
||||
<a class="tab" href="/" role="tab" aria-selected="false">审核智能体</a>
|
||||
<a class="tab" href="{% url 'home' %}" role="tab" aria-selected="false">首页</a>
|
||||
<a class="tab" href="{% url 'chat' %}" role="tab" aria-selected="false">审核智能体</a>
|
||||
<a class="tab active" href="{% url 'knowledge_base_manager' %}" role="tab" aria-selected="true">知识库管理</a>
|
||||
<a class="tab" href="{% url 'attachment_manager' %}" role="tab" aria-selected="false">附件管理</a>
|
||||
</div>
|
||||
@@ -41,7 +41,7 @@
|
||||
</div>
|
||||
<div class="knowledge-hero-actions">
|
||||
<span class="knowledge-status status-{{ knowledge_base.status.code }}">{{ knowledge_base.status.label }}</span>
|
||||
<a class="return-chat-link" href="{% url 'home' %}">返回对话</a>
|
||||
<a class="return-chat-link" href="{% url 'chat' %}">返回对话</a>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
|
||||
173
templates/workbench.html
Normal file
173
templates/workbench.html
Normal file
@@ -0,0 +1,173 @@
|
||||
{% extends "base.html" %}
|
||||
{% load static %}
|
||||
|
||||
{% block title %}首页 - DEMO-AGENT V2{% endblock %}
|
||||
{% block body_class %}app-body{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<main class="app-shell">
|
||||
<header class="topbar">
|
||||
<div class="topbar-left">
|
||||
<div class="tabbar" role="tablist" aria-label="页面切换">
|
||||
<a class="tab active" href="{% url 'home' %}" role="tab" aria-selected="true">首页</a>
|
||||
<a class="tab" href="{% url 'chat' %}" role="tab" aria-selected="false">审核智能体</a>
|
||||
<a class="tab" href="{% url 'knowledge_base_manager' %}" role="tab" aria-selected="false">知识库管理</a>
|
||||
<a class="tab" href="{% url 'attachment_manager' %}" role="tab" aria-selected="false">附件管理</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="topbar-right">
|
||||
<div class="user-menu">
|
||||
<button class="user-menu-trigger" type="button">
|
||||
<span class="avatar large">{{ request.user.username|slice:":1"|upper }}</span>
|
||||
<div class="user-copy">
|
||||
<strong>{{ request.user.username }}</strong>
|
||||
<span>当前登录用户</span>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<section class="dashboard-page">
|
||||
<header class="dashboard-hero attachment-manager-toolbar">
|
||||
<div>
|
||||
<p class="eyebrow">首页</p>
|
||||
<h1>注册资料审核工作台</h1>
|
||||
<p>当前账号资料、知识库、附件与审核处理数据总览。</p>
|
||||
</div>
|
||||
<a class="return-chat-link dashboard-primary-action" href="{% url 'chat' %}">进入审核智能体</a>
|
||||
</header>
|
||||
|
||||
<section class="metric-grid" aria-label="首页关键指标">
|
||||
<article class="metric-card">
|
||||
<span>对话总数</span>
|
||||
<strong>{{ dashboard.metrics.conversation_count }}</strong>
|
||||
<em>已处理 {{ dashboard.metrics.recent_conversation_count }}</em>
|
||||
</article>
|
||||
<article class="metric-card">
|
||||
<span>附件总数</span>
|
||||
<strong>{{ dashboard.metrics.attachment_count }}</strong>
|
||||
<em>启用 {{ dashboard.metrics.active_attachment_count }}</em>
|
||||
</article>
|
||||
<article class="metric-card">
|
||||
<span>知识库材料</span>
|
||||
<strong>{{ dashboard.metrics.knowledge_document_count }}</strong>
|
||||
<em>管理 {{ dashboard.knowledge.document_count }} · 内置 {{ dashboard.knowledge.builtin_source_count }}</em>
|
||||
</article>
|
||||
<article class="metric-card">
|
||||
<span>执行中批次</span>
|
||||
<strong>{{ dashboard.metrics.running_batch_count }}</strong>
|
||||
<em>总批次 {{ dashboard.metrics.total_batch_count }}</em>
|
||||
</article>
|
||||
<article class="metric-card">
|
||||
<span>已处理批次</span>
|
||||
<strong>{{ dashboard.metrics.handled_batch_count }}</strong>
|
||||
<em>成功 {{ dashboard.metrics.success_batch_count }}</em>
|
||||
</article>
|
||||
<article class="metric-card">
|
||||
<span>等待确认</span>
|
||||
<strong>{{ dashboard.metrics.waiting_batch_count }}</strong>
|
||||
<em>需人工处理</em>
|
||||
</article>
|
||||
<article class="metric-card">
|
||||
<span>失败批次</span>
|
||||
<strong>{{ dashboard.metrics.failed_batch_count }}</strong>
|
||||
<em>需排查</em>
|
||||
</article>
|
||||
<article class="metric-card">
|
||||
<span>申报填表</span>
|
||||
<strong>{{ dashboard.workflow.application_form_fill_count }}</strong>
|
||||
<em>自动填表批次</em>
|
||||
</article>
|
||||
</section>
|
||||
|
||||
<div class="dashboard-split">
|
||||
<section class="attachment-manager-panel dashboard-panel">
|
||||
<div class="summary-subheading">
|
||||
<h3>知识库概览</h3>
|
||||
</div>
|
||||
<dl class="dashboard-stat-list">
|
||||
<div>
|
||||
<dt>管理文档</dt>
|
||||
<dd>{{ dashboard.knowledge.document_count }}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt>内置材料</dt>
|
||||
<dd>{{ dashboard.knowledge.builtin_source_count }}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt>已索引</dt>
|
||||
<dd>{{ dashboard.knowledge.indexed_document_count }}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt>向量片段</dt>
|
||||
<dd>{{ dashboard.knowledge.chunk_count }}</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</section>
|
||||
|
||||
<section class="attachment-manager-panel dashboard-panel">
|
||||
<div class="summary-subheading">
|
||||
<h3>附件与文档概览</h3>
|
||||
</div>
|
||||
<dl class="dashboard-stat-list">
|
||||
<div>
|
||||
<dt>附件总数</dt>
|
||||
<dd>{{ dashboard.attachments.attachment_count }}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt>启用附件</dt>
|
||||
<dd>{{ dashboard.attachments.active_attachment_count }}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt>最近上传</dt>
|
||||
<dd>{{ dashboard.attachments.recent_attachment_count }}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt>关联对话</dt>
|
||||
<dd>{{ dashboard.attachments.conversation_count }}</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<section class="attachment-manager-panel dashboard-panel">
|
||||
<div class="summary-subheading">
|
||||
<h3>最近处理记录</h3>
|
||||
<span>最近 8 条</span>
|
||||
</div>
|
||||
<div class="attachment-table-wrap">
|
||||
<table class="attachment-table recent-activity-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>类型</th>
|
||||
<th>名称或批次号</th>
|
||||
<th>状态</th>
|
||||
<th>更新时间</th>
|
||||
<th>入口</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for record in dashboard.recent_records %}
|
||||
<tr>
|
||||
<td>{{ record.type }}</td>
|
||||
<td class="attachment-name">{{ record.title }}</td>
|
||||
<td>{{ record.status }}</td>
|
||||
<td>{{ record.updated_at|date:"Y-m-d H:i" }}</td>
|
||||
<td class="attachment-actions">
|
||||
<a href="{{ record.url }}">查看</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% empty %}
|
||||
<tr>
|
||||
<td colspan="5" class="table-empty">暂无处理记录</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
</main>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user