merge: 合并 shadcn 风格 UI 优化
This commit is contained in:
+431
-97
@@ -1,203 +1,537 @@
|
||||
:root {
|
||||
--background: #f8fafc;
|
||||
--foreground: #0f172a;
|
||||
--muted: #f1f5f9;
|
||||
--muted-foreground: #64748b;
|
||||
--card: #ffffff;
|
||||
--card-foreground: #0f172a;
|
||||
--border: #e2e8f0;
|
||||
--input: #cbd5e1;
|
||||
--primary: #0f172a;
|
||||
--primary-foreground: #ffffff;
|
||||
--secondary: #f1f5f9;
|
||||
--secondary-foreground: #0f172a;
|
||||
--accent: #f8fafc;
|
||||
--accent-foreground: #0f172a;
|
||||
--destructive: #dc2626;
|
||||
--success: #16a34a;
|
||||
--warning: #d97706;
|
||||
--ring: rgba(15, 23, 42, 0.18);
|
||||
--radius: 8px;
|
||||
}
|
||||
|
||||
body {
|
||||
background:
|
||||
linear-gradient(180deg, #f4f7fb 0%, #eef3f8 42%, #f8fafc 100%);
|
||||
color: #182235;
|
||||
background: var(--background);
|
||||
color: var(--foreground);
|
||||
font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
||||
letter-spacing: 0;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
a {
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 1180px;
|
||||
}
|
||||
|
||||
.app-navbar {
|
||||
background: rgba(255, 255, 255, 0.94) !important;
|
||||
border-bottom: 1px solid #dfe7f1;
|
||||
box-shadow: 0 10px 30px rgba(19, 34, 56, 0.04);
|
||||
background: rgba(255, 255, 255, 0.92) !important;
|
||||
border-bottom: 1px solid var(--border);
|
||||
backdrop-filter: blur(14px);
|
||||
}
|
||||
|
||||
.app-navbar .container {
|
||||
min-height: 56px;
|
||||
}
|
||||
|
||||
.navbar-brand {
|
||||
color: #102033;
|
||||
color: var(--foreground);
|
||||
font-size: 15px;
|
||||
letter-spacing: 0;
|
||||
}
|
||||
|
||||
.nav-link {
|
||||
color: #526173;
|
||||
border-radius: 6px;
|
||||
color: var(--muted-foreground);
|
||||
font-size: 14px;
|
||||
padding: 6px 10px;
|
||||
}
|
||||
|
||||
.nav-link:hover {
|
||||
background: var(--secondary);
|
||||
color: var(--foreground);
|
||||
}
|
||||
|
||||
.breadcrumb {
|
||||
color: var(--muted-foreground);
|
||||
font-size: 13px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.breadcrumb a {
|
||||
color: var(--muted-foreground);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.breadcrumb a:hover {
|
||||
color: var(--foreground);
|
||||
}
|
||||
|
||||
.tool-card,
|
||||
.card {
|
||||
background: rgba(255, 255, 255, 0.96);
|
||||
border-radius: 8px;
|
||||
border: 1px solid #dbe4ef;
|
||||
box-shadow: 0 16px 42px rgba(31, 42, 68, 0.07);
|
||||
.card,
|
||||
.accordion-item {
|
||||
background: var(--card);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius);
|
||||
box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
|
||||
color: var(--card-foreground);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.card-body {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.card-header,
|
||||
.section-heading {
|
||||
background: linear-gradient(180deg, #ffffff, #f8fafc);
|
||||
border-bottom: 1px solid #e4ebf3;
|
||||
padding: 18px 20px;
|
||||
background: var(--card);
|
||||
border-bottom: 1px solid var(--border);
|
||||
padding: 16px 20px;
|
||||
}
|
||||
|
||||
.section-heading {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
gap: 16px;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.section-heading h2,
|
||||
.page-heading h1 {
|
||||
.page-heading h1,
|
||||
.page-title {
|
||||
color: var(--foreground);
|
||||
font-size: 22px;
|
||||
font-weight: 700;
|
||||
font-weight: 650;
|
||||
letter-spacing: 0;
|
||||
line-height: 1.25;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.page-heading {
|
||||
align-items: flex-start;
|
||||
display: flex;
|
||||
gap: 16px;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 18px;
|
||||
}
|
||||
|
||||
.section-kicker,
|
||||
.eyebrow {
|
||||
color: #0e766e;
|
||||
color: var(--muted-foreground);
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
font-weight: 650;
|
||||
letter-spacing: 0;
|
||||
margin: 0 0 4px;
|
||||
margin: 0 0 6px;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.hero-band {
|
||||
background: var(--card);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius);
|
||||
box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
|
||||
color: var(--foreground);
|
||||
padding: 30px;
|
||||
}
|
||||
|
||||
.hero-shell {
|
||||
align-items: flex-end;
|
||||
background:
|
||||
linear-gradient(135deg, rgba(12, 22, 40, 0.92), rgba(29, 80, 108, 0.78)),
|
||||
url("https://images.unsplash.com/photo-1551288049-bebda4e38f71?auto=format&fit=crop&w=1600&q=80");
|
||||
background-position: center;
|
||||
background-size: cover;
|
||||
border: 1px solid rgba(255, 255, 255, 0.18);
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 24px 60px rgba(15, 36, 62, 0.18);
|
||||
color: #fff;
|
||||
display: flex;
|
||||
gap: 28px;
|
||||
justify-content: space-between;
|
||||
min-height: 300px;
|
||||
padding: 42px;
|
||||
}
|
||||
|
||||
.hero-copy {
|
||||
max-width: 680px;
|
||||
max-width: 700px;
|
||||
}
|
||||
|
||||
.hero-copy h1 {
|
||||
font-size: 48px;
|
||||
color: var(--foreground);
|
||||
font-size: 34px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0;
|
||||
margin-bottom: 14px;
|
||||
line-height: 1.15;
|
||||
margin: 0 0 12px;
|
||||
}
|
||||
|
||||
.hero-copy p:not(.eyebrow) {
|
||||
color: rgba(255, 255, 255, 0.84);
|
||||
font-size: 18px;
|
||||
line-height: 1.7;
|
||||
color: var(--muted-foreground);
|
||||
font-size: 15px;
|
||||
line-height: 1.75;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.hero-actions {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 12px;
|
||||
.hero-metrics {
|
||||
display: grid;
|
||||
gap: 10px;
|
||||
grid-template-columns: repeat(3, minmax(84px, 1fr));
|
||||
min-width: 320px;
|
||||
}
|
||||
|
||||
.page-heading {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
gap: 16px;
|
||||
.hero-metric {
|
||||
background: var(--muted);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius);
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
.metric-box {
|
||||
background: linear-gradient(180deg, #f9fbfd, #f3f7fb);
|
||||
border: 1px solid #e3e9f2;
|
||||
border-radius: 8px;
|
||||
.hero-metric strong {
|
||||
display: block;
|
||||
font-size: 18px;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.hero-metric span {
|
||||
color: var(--muted-foreground);
|
||||
display: block;
|
||||
font-size: 12px;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.btn {
|
||||
border-radius: 6px;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
background: var(--primary);
|
||||
border-color: var(--primary);
|
||||
color: var(--primary-foreground);
|
||||
}
|
||||
|
||||
.btn-primary:hover,
|
||||
.btn-primary:focus {
|
||||
background: #1e293b;
|
||||
border-color: #1e293b;
|
||||
}
|
||||
|
||||
.btn-outline-primary,
|
||||
.btn-outline-secondary {
|
||||
background: var(--card);
|
||||
border-color: var(--border);
|
||||
color: var(--foreground);
|
||||
}
|
||||
|
||||
.btn-outline-primary:hover,
|
||||
.btn-outline-secondary:hover {
|
||||
background: var(--secondary);
|
||||
border-color: var(--border);
|
||||
color: var(--foreground);
|
||||
}
|
||||
|
||||
.form-label {
|
||||
color: var(--foreground);
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.form-control,
|
||||
.form-select {
|
||||
border-color: var(--input);
|
||||
border-radius: 6px;
|
||||
color: var(--foreground);
|
||||
font-size: 14px;
|
||||
min-height: 40px;
|
||||
}
|
||||
|
||||
.form-control:focus,
|
||||
.form-select:focus {
|
||||
border-color: var(--foreground);
|
||||
box-shadow: 0 0 0 3px var(--ring);
|
||||
}
|
||||
|
||||
.form-text {
|
||||
color: var(--muted-foreground) !important;
|
||||
}
|
||||
|
||||
.badge {
|
||||
border-radius: 999px;
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
letter-spacing: 0;
|
||||
padding: 5px 9px;
|
||||
}
|
||||
|
||||
.bg-success,
|
||||
.text-bg-success {
|
||||
background-color: #dcfce7 !important;
|
||||
color: #166534 !important;
|
||||
}
|
||||
|
||||
.bg-danger,
|
||||
.text-bg-danger {
|
||||
background-color: #fee2e2 !important;
|
||||
color: #991b1b !important;
|
||||
}
|
||||
|
||||
.bg-warning,
|
||||
.text-bg-warning {
|
||||
background-color: #fef3c7 !important;
|
||||
color: #92400e !important;
|
||||
}
|
||||
|
||||
.bg-secondary,
|
||||
.text-bg-secondary {
|
||||
background-color: var(--secondary) !important;
|
||||
color: var(--secondary-foreground) !important;
|
||||
}
|
||||
|
||||
.text-bg-light {
|
||||
background: var(--secondary) !important;
|
||||
color: var(--foreground) !important;
|
||||
}
|
||||
|
||||
.alert {
|
||||
border-radius: var(--radius);
|
||||
font-size: 14px;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.alert-info {
|
||||
background: #eff6ff;
|
||||
border-color: #bfdbfe;
|
||||
color: #1e3a8a;
|
||||
}
|
||||
|
||||
.alert-warning {
|
||||
background: #fffbeb;
|
||||
border-color: #fde68a;
|
||||
color: #92400e;
|
||||
}
|
||||
|
||||
.alert-danger {
|
||||
background: #fef2f2;
|
||||
border-color: #fecaca;
|
||||
color: #991b1b;
|
||||
}
|
||||
|
||||
.alert-secondary {
|
||||
background: var(--secondary);
|
||||
border-color: var(--border);
|
||||
color: var(--foreground);
|
||||
}
|
||||
|
||||
.metric-box,
|
||||
.stat-card {
|
||||
background: var(--card);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius);
|
||||
height: 100%;
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.metric-box strong {
|
||||
color: #132033;
|
||||
.metric-box strong,
|
||||
.stat-card strong {
|
||||
color: var(--foreground);
|
||||
display: block;
|
||||
font-size: 18px;
|
||||
font-weight: 650;
|
||||
line-height: 1.35;
|
||||
margin: 4px 0;
|
||||
}
|
||||
|
||||
.app-table {
|
||||
color: var(--foreground);
|
||||
min-width: 760px;
|
||||
}
|
||||
|
||||
.app-table thead th {
|
||||
background: #f8fafc;
|
||||
color: #536174;
|
||||
background: var(--muted);
|
||||
border-bottom: 1px solid var(--border);
|
||||
color: var(--muted-foreground);
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
text-transform: uppercase;
|
||||
font-weight: 650;
|
||||
height: 42px;
|
||||
letter-spacing: 0;
|
||||
text-transform: none;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.app-table tbody tr {
|
||||
border-color: #e8eef5;
|
||||
.app-table td {
|
||||
border-color: var(--border);
|
||||
padding-bottom: 14px;
|
||||
padding-top: 14px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.app-table tbody tr:hover {
|
||||
background: #f7fbff;
|
||||
background: var(--accent);
|
||||
}
|
||||
|
||||
.task-number {
|
||||
align-items: center;
|
||||
background: #e7f0ff;
|
||||
border: 1px solid #cfe0ff;
|
||||
background: var(--secondary);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 999px;
|
||||
color: #0b5ed7;
|
||||
color: var(--foreground);
|
||||
display: inline-flex;
|
||||
font-weight: 700;
|
||||
height: 32px;
|
||||
font-weight: 650;
|
||||
height: 30px;
|
||||
justify-content: center;
|
||||
min-width: 32px;
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
.task-overview {
|
||||
border-top: 3px solid #0d6efd;
|
||||
}
|
||||
|
||||
.hotspot-item {
|
||||
border-color: #e3eaf2;
|
||||
margin-bottom: 10px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.status-panel {
|
||||
background: #fff;
|
||||
border: 1px solid #dfe5ef;
|
||||
border-radius: 8px;
|
||||
padding: 32px;
|
||||
}
|
||||
|
||||
.status-panel-danger {
|
||||
border-color: #f1b8b8;
|
||||
min-width: 30px;
|
||||
padding: 0 9px;
|
||||
}
|
||||
|
||||
.task-progress {
|
||||
height: 10px;
|
||||
background: var(--secondary);
|
||||
border-radius: 999px;
|
||||
height: 8px;
|
||||
}
|
||||
|
||||
.progress-bar {
|
||||
background-color: var(--primary);
|
||||
}
|
||||
|
||||
.report-progress {
|
||||
height: 10px;
|
||||
background: var(--secondary);
|
||||
height: 8px;
|
||||
}
|
||||
|
||||
.task-overview {
|
||||
border-top: 0;
|
||||
}
|
||||
|
||||
.progress-summary {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.hotspot-item {
|
||||
border-color: var(--border);
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.accordion-button {
|
||||
background: var(--card);
|
||||
color: var(--foreground);
|
||||
font-size: 15px;
|
||||
font-weight: 600;
|
||||
gap: 10px;
|
||||
padding: 16px 18px;
|
||||
}
|
||||
|
||||
.accordion-button:not(.collapsed) {
|
||||
background: var(--muted);
|
||||
box-shadow: none;
|
||||
color: var(--foreground);
|
||||
}
|
||||
|
||||
.accordion-button:focus {
|
||||
border-color: var(--border);
|
||||
box-shadow: 0 0 0 3px var(--ring);
|
||||
}
|
||||
|
||||
.content-item-row {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
gap: 14px;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.content-item-title {
|
||||
color: var(--foreground);
|
||||
display: block;
|
||||
font-weight: 600;
|
||||
line-height: 1.45;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.content-item-meta {
|
||||
color: var(--muted-foreground);
|
||||
display: block;
|
||||
font-size: 12px;
|
||||
margin-top: 3px;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.report-summary {
|
||||
background: var(--muted);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius);
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.comment-card {
|
||||
background: var(--card);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius);
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
.empty-state,
|
||||
.status-panel {
|
||||
background: var(--card);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius);
|
||||
padding: 32px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.status-panel-danger {
|
||||
border-color: #fecaca;
|
||||
}
|
||||
|
||||
@media (max-width: 992px) {
|
||||
.hero-shell {
|
||||
align-items: flex-start;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.hero-metrics {
|
||||
min-width: 0;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
main.container {
|
||||
padding-left: 14px;
|
||||
padding-right: 14px;
|
||||
}
|
||||
|
||||
.hero-band {
|
||||
align-items: flex-start;
|
||||
flex-direction: column;
|
||||
min-height: 360px;
|
||||
padding: 28px;
|
||||
padding: 22px;
|
||||
}
|
||||
|
||||
.hero-copy h1 {
|
||||
font-size: 36px;
|
||||
font-size: 28px;
|
||||
}
|
||||
|
||||
.hero-metrics {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.section-heading,
|
||||
.page-heading {
|
||||
.page-heading,
|
||||
.content-item-row {
|
||||
align-items: flex-start;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.card-body {
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.content-item-row .btn {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.accordion-button {
|
||||
align-items: flex-start;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>{% block title %}热榜评论分析工具{% endblock %}</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="/static/app.css" rel="stylesheet">
|
||||
<link href="/static/app.css?v=shadcn-ui-refresh" rel="stylesheet">
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script src="/static/app.js" defer></script>
|
||||
</head>
|
||||
|
||||
@@ -8,15 +8,19 @@
|
||||
</ol></nav>
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
<div class="d-flex justify-content-between align-items-center mb-3">
|
||||
<h1 class="h3 mb-0">{{ hotspot.title }} 汇总报告</h1>
|
||||
<div class="page-heading">
|
||||
<div>
|
||||
<p class="section-kicker">热点报告</p>
|
||||
<h1>{{ hotspot.title }} 汇总报告</h1>
|
||||
</div>
|
||||
<span class="badge text-bg-light border">热点 #{{ hotspot.rank }}</span>
|
||||
</div>
|
||||
{% if report %}
|
||||
{% include "partials/report_panel.html" %}
|
||||
{% else %}
|
||||
<div class="text-center text-muted py-5">
|
||||
<div class="empty-state text-muted py-5">
|
||||
<div class="spinner-border text-warning mb-3" role="status"></div>
|
||||
<p>报告生成中,请稍候...</p>
|
||||
<p class="mb-0">报告生成中,请稍候...</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
@@ -3,10 +3,26 @@
|
||||
{% block title %}热榜评论雷达 - 热榜评论分析工具{% endblock %}
|
||||
{% block content %}
|
||||
<section class="hero-band mb-4">
|
||||
<div class="hero-copy">
|
||||
<p class="eyebrow">Hot Comment Radar</p>
|
||||
<h1>热榜评论雷达</h1>
|
||||
<p>从小红书和抖音热点出发,抓取真实评论,生成 AI 情绪、标签和可导出的分析报告。</p>
|
||||
<div class="hero-shell">
|
||||
<div class="hero-copy">
|
||||
<p class="eyebrow">Hot Comment Radar</p>
|
||||
<h1>热榜评论雷达</h1>
|
||||
<p>从小红书和抖音热点出发,抓取真实评论,生成 AI 情绪、标签和可导出的分析报告。</p>
|
||||
</div>
|
||||
<div class="hero-metrics" aria-label="默认任务规模">
|
||||
<div class="hero-metric">
|
||||
<strong>5</strong>
|
||||
<span>默认热点</span>
|
||||
</div>
|
||||
<div class="hero-metric">
|
||||
<strong>25</strong>
|
||||
<span>默认内容</span>
|
||||
</div>
|
||||
<div class="hero-metric">
|
||||
<strong>1,250</strong>
|
||||
<span>评论上限</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -16,7 +32,7 @@
|
||||
<p class="section-kicker">采集配置</p>
|
||||
<h2>创建抓取任务</h2>
|
||||
</div>
|
||||
<span class="text-muted small">默认规模 5 × 5 × 50</span>
|
||||
<span class="badge text-bg-light border">默认规模 5 × 5 × 50</span>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div id="form-error" class="alert alert-danger d-none" role="alert"></div>
|
||||
|
||||
@@ -9,21 +9,25 @@
|
||||
</ol></nav>
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
<div class="d-flex justify-content-between align-items-center mb-3">
|
||||
<h1 class="h3 mb-0">{{ item.title or item.source_item_id }}</h1>
|
||||
<div class="page-heading">
|
||||
<div>
|
||||
<p class="section-kicker">内容详情</p>
|
||||
<h1>{{ item.title or item.source_item_id }}</h1>
|
||||
</div>
|
||||
<span class="badge text-bg-light border">{{ item.status }}</span>
|
||||
</div>
|
||||
{% if report %}
|
||||
{% include "partials/report_panel.html" %}
|
||||
{% else %}
|
||||
<div class="text-center text-muted py-5">
|
||||
<div class="empty-state text-muted py-5">
|
||||
<div class="spinner-border text-warning mb-3" role="status"></div>
|
||||
<p>报告生成中,请稍候...</p>
|
||||
<p class="mb-0">报告生成中,请稍候...</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
<section class="card"><div class="card-header">评论明细</div><div class="table-responsive">
|
||||
<table class="table mb-0"><thead><tr><th>评论内容</th><th>情绪</th><th>标签</th><th>点赞</th></tr></thead><tbody>
|
||||
<table class="table app-table mb-0"><thead><tr><th>评论内容</th><th>情绪</th><th>标签</th><th>点赞</th></tr></thead><tbody>
|
||||
{% for comment in comments %}
|
||||
<tr><td>{{ comment.content }}</td><td>{{ comment.sentiment }}</td><td>{% for label in comment.labels | from_json %}<span class="badge bg-secondary me-1">{{ label }}</span>{% else %}-{% endfor %}</td><td>{{ comment.like_count or 0 }}</td></tr>
|
||||
<tr><td>{{ comment.content }}</td><td><span class="badge text-bg-light border">{{ comment.sentiment }}</span></td><td>{% for label in comment.labels | from_json %}<span class="badge text-bg-light border me-1">{{ label }}</span>{% else %}<span class="text-muted">-</span>{% endfor %}</td><td>{{ comment.like_count or 0 }}</td></tr>
|
||||
{% else %}
|
||||
<tr><td colspan="4" class="text-center text-muted">暂无评论数据(该内容无评论或评论抓取为空)</td></tr>
|
||||
{% endfor %}
|
||||
|
||||
@@ -13,28 +13,28 @@
|
||||
|
||||
<div class="row g-3 mb-4">
|
||||
<div class="col-md-3">
|
||||
<div class="border rounded p-3 h-100">
|
||||
<div class="stat-card">
|
||||
<div class="text-muted small">评论样本</div>
|
||||
<div class="h4 mb-0">{{ sample_count }}</div>
|
||||
</div>
|
||||
</div>
|
||||
{% if item_count is not none %}
|
||||
<div class="col-md-3">
|
||||
<div class="border rounded p-3 h-100">
|
||||
<div class="stat-card">
|
||||
<div class="text-muted small">关联内容</div>
|
||||
<div class="h4 mb-0">{{ item_count }}</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="col-md-3">
|
||||
<div class="border rounded p-3 h-100">
|
||||
<div class="stat-card">
|
||||
<div class="text-muted small">AI 成功率</div>
|
||||
<div class="h4 mb-0">{{ rate_percent(task.analysis_success_rate) }}%</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="p-3 bg-info-subtle border border-info-subtle rounded mb-4">
|
||||
<div class="report-summary mb-4">
|
||||
<div class="fw-semibold mb-2">AI 总结</div>
|
||||
<p class="mb-0">{{ report.summary or "总结生成失败,请查看上方统计数据。" }}</p>
|
||||
</div>
|
||||
@@ -77,7 +77,7 @@
|
||||
<div class="col-md-4">
|
||||
<h3 class="h6">{{ sentiment_label(key) }}</h3>
|
||||
{% for comment in typical.get(key, []) %}
|
||||
<div class="border rounded p-2 mb-2">
|
||||
<div class="comment-card mb-2">
|
||||
<p class="mb-1">{{ comment.get("content") }}</p>
|
||||
<small class="text-muted">点赞 {{ comment.get("like_count", 0) }}</small>
|
||||
</div>
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
<td>
|
||||
<span class="task-number">{{ task.display_id or loop.index }}</span>
|
||||
</td>
|
||||
<td>{{ task.platform | platform_label }}</td>
|
||||
<td>{{ task.created_at_label }}</td>
|
||||
<td><small class="text-muted">{{ task.scale_label }}</small></td>
|
||||
<td><span class="badge text-bg-light border">{{ task.platform | platform_label }}</span></td>
|
||||
<td><span class="text-muted small">{{ task.created_at_label }}</span></td>
|
||||
<td><span class="text-muted small">{{ task.scale_label }}</span></td>
|
||||
<td class="task-progress-cell">
|
||||
<div class="d-flex justify-content-between align-items-center gap-2">
|
||||
<span class="small">已处理 {{ task.processed_items_count }} / 共 {{ task.total_items_count }} 条内容</span>
|
||||
@@ -17,9 +17,12 @@
|
||||
<div class="progress task-progress mt-1" role="progressbar" aria-label="任务进度" aria-valuenow="{{ percent }}" aria-valuemin="0" aria-valuemax="100">
|
||||
<div class="progress-bar" style="width: {{ percent }}%"></div>
|
||||
</div>
|
||||
<div class="small text-muted mt-1">成功 {{ task.successful_items_count }} / 失败 {{ task.failed_items_count }}</div>
|
||||
<div class="progress-summary mt-2">
|
||||
<span class="small text-muted">成功 {{ task.successful_items_count }} / 失败 {{ task.failed_items_count }}</span>
|
||||
<span class="small text-muted">评论 {{ task.comments_count or 0 }}</span>
|
||||
<span class="small text-muted">报告 {{ task.reports_count or 0 }}</span>
|
||||
</div>
|
||||
<div class="small text-muted mt-1">阶段:{{ task.current_stage_label or "等待启动" }}</div>
|
||||
<div class="small text-muted mt-1">评论 {{ task.comments_count or 0 }} / 报告 {{ task.reports_count or 0 }}</div>
|
||||
<div class="small {% if task.analysis_status == 'insufficient' %}text-warning{% else %}text-muted{% endif %}">
|
||||
AI 成功率 {{ ai_percent }}%
|
||||
{% if task.analysis_status == "insufficient" %}
|
||||
@@ -33,7 +36,7 @@
|
||||
<br><small class="text-danger">{{ task.error_summary }}</small>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td><a class="btn btn-sm btn-primary" href="/tasks/{{ task.id }}">查看</a></td>
|
||||
<td><a class="btn btn-sm btn-outline-secondary" href="/tasks/{{ task.id }}">查看</a></td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
|
||||
@@ -15,15 +15,19 @@
|
||||
{% set label, cls = status_badge_config(task.status) %}
|
||||
<span class="badge {{ cls }}">{{ label }}</span>
|
||||
</div>
|
||||
<section class="tool-card task-overview mb-4" {% if task.status == "running" %}data-task-id="{{ task.id }}" data-auto-poll="true"{% endif %}><div class="card-body">
|
||||
<section class="tool-card task-overview mb-4" {% if task.status == "running" %}data-task-id="{{ task.id }}" data-auto-poll="true"{% endif %}>
|
||||
<div class="card-body">
|
||||
{% set percent = progress_percent(task.processed_items_count, task.total_items_count) %}
|
||||
{% set ai_percent = rate_percent(task.analysis_success_rate) %}
|
||||
{% set target_comments = task.hotspot_limit * task.item_limit_per_hotspot * task.comment_limit_per_item %}
|
||||
<div class="d-flex flex-wrap justify-content-between gap-3 mb-3">
|
||||
<p class="mb-0">平台:{{ task.platform | platform_label }}</p>
|
||||
<p class="mb-0 text-muted">创建时间 {{ task.created_at_label }} · 阶段 {{ task.current_stage_label or "等待启动" }}</p>
|
||||
<div class="d-flex flex-wrap justify-content-between align-items-start gap-3 mb-4">
|
||||
<div>
|
||||
<span class="badge text-bg-light border">{{ task.platform | platform_label }}</span>
|
||||
<span class="badge text-bg-light border ms-1">{{ task.current_stage_label or "等待启动" }}</span>
|
||||
</div>
|
||||
<p class="mb-0 text-muted small">创建时间 {{ task.created_at_label }} · 阶段 {{ task.current_stage_label or "等待启动" }}</p>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<div class="mb-4">
|
||||
<div class="d-flex justify-content-between align-items-center gap-2">
|
||||
<span>已处理 {{ task.processed_items_count }} / 共 {{ task.total_items_count }} 条内容</span>
|
||||
<span class="text-muted">{{ percent }}%</span>
|
||||
@@ -31,7 +35,10 @@
|
||||
<div class="progress task-progress mt-2" role="progressbar" aria-label="任务进度" aria-valuenow="{{ percent }}" aria-valuemin="0" aria-valuemax="100">
|
||||
<div class="progress-bar" style="width: {{ percent }}%"></div>
|
||||
</div>
|
||||
<div class="small text-muted mt-2">成功 {{ task.successful_items_count }} / 失败 {{ task.failed_items_count }}</div>
|
||||
<div class="progress-summary mt-2">
|
||||
<span class="small text-muted">成功 {{ task.successful_items_count }} / 失败 {{ task.failed_items_count }}</span>
|
||||
<span class="small text-muted">AI 成功率 {{ ai_percent }}%</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row g-3 mb-3">
|
||||
<div class="col-md-4">
|
||||
@@ -69,33 +76,40 @@
|
||||
{% if task.status == "success" and (task.comments_count or 0) < target_comments %}
|
||||
<div class="alert alert-info">少于理论上限通常是内容本身评论不足或平台返回不足,不直接代表任务失败。若失败内容数大于 0,请结合失败原因判断。</div>
|
||||
{% endif %}
|
||||
<div class="mb-2">
|
||||
<span class="{% if task.analysis_status == 'insufficient' %}text-warning{% else %}text-muted{% endif %}">AI 成功率 {{ ai_percent }}%</span>
|
||||
{% if task.analysis_status == "insufficient" %}
|
||||
<span class="badge text-bg-warning ms-1">AI 样本不足</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if task.analysis_status == "insufficient" %}
|
||||
<div class="alert alert-warning">AI 成功率 {{ ai_percent }}%,当前样本可能不足,报告结论请结合评论明细判断。</div>
|
||||
{% endif %}
|
||||
{% if task.error_summary %}<div class="alert alert-danger">{{ task.error_summary }}</div>{% endif %}
|
||||
</div></section>
|
||||
</div>
|
||||
</section>
|
||||
{% if task.status == "running" and not hotspots %}
|
||||
<div class="text-center text-muted py-5"><div class="spinner-border text-warning mb-3"></div><p>正在抓取热点数据,请稍候...</p></div>
|
||||
<div class="empty-state text-muted py-5"><div class="spinner-border text-warning mb-3"></div><p class="mb-0">正在抓取热点数据,请稍候...</p></div>
|
||||
{% endif %}
|
||||
<div class="accordion" id="hotspot-list">
|
||||
{% for hotspot in hotspots %}
|
||||
<div class="accordion-item hotspot-item">
|
||||
<h2 class="accordion-header">
|
||||
<button class="accordion-button {% if not loop.first %}collapsed{% endif %}" type="button" data-bs-toggle="collapse" data-bs-target="#hotspot-{{ hotspot.id }}">
|
||||
热点 {{ hotspot.rank }}:{{ hotspot.title }}
|
||||
<span class="badge text-bg-light border">#{{ hotspot.rank }}</span>
|
||||
<span>热点 {{ hotspot.rank }}:{{ hotspot.title }}</span>
|
||||
</button>
|
||||
</h2>
|
||||
<div id="hotspot-{{ hotspot.id }}" class="accordion-collapse collapse {% if loop.first %}show{% endif %}" data-bs-parent="#hotspot-list">
|
||||
<div class="accordion-body">
|
||||
<a class="btn btn-sm btn-outline-primary mb-2" href="/hotspots/{{ hotspot.id }}/report">查看热点级汇总报告</a>
|
||||
<ul class="list-group">
|
||||
<div class="d-flex justify-content-between align-items-center gap-3 mb-3">
|
||||
<span class="text-muted small">内容条目 {{ hotspot.content_items | length }}</span>
|
||||
<a class="btn btn-sm btn-outline-primary" href="/hotspots/{{ hotspot.id }}/report">查看汇总报告</a>
|
||||
</div>
|
||||
<ul class="list-group list-group-flush">
|
||||
{% for item in hotspot.content_items %}
|
||||
<li class="list-group-item d-flex justify-content-between">
|
||||
<span>{{ item.title or item.summary or item.source_item_id }} <small class="text-muted">{{ item.status }}</small></span>
|
||||
<a class="btn btn-sm btn-outline-secondary" href="/items/{{ item.id }}">查看详情</a>
|
||||
<li class="list-group-item px-0">
|
||||
<div class="content-item-row">
|
||||
<span>
|
||||
<span class="content-item-title">{{ item.title or item.summary or item.source_item_id }}</span>
|
||||
<span class="content-item-meta">状态 {{ item.status }} · ID {{ item.source_item_id }}</span>
|
||||
</span>
|
||||
<a class="btn btn-sm btn-outline-secondary" href="/items/{{ item.id }}">查看详情</a>
|
||||
</div>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
Reference in New Issue
Block a user