Files
vps_web/templates/admin/forum_tracking_daily.html
ddrwode d454699f50 哈哈
2026-02-11 17:38:06 +08:00

289 lines
14 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>论坛埋点日报 - 后台</title>
<link rel="stylesheet" href="/static/css/style.css">
<link rel="stylesheet" href="/static/css/admin.css">
</head>
<body class="admin-page">
<header class="admin-header">
<h1>论坛埋点日报</h1>
<nav>
<a href="{{ url_for('admin_forum_tracking_daily') }}">埋点日报</a>
<a href="{{ url_for('admin_forum_tracking_weekly', day=day_value.isoformat() if day_value else '', days=7, variant=selected_variant, device=selected_device) }}">埋点周报</a>
<a href="{{ url_for('admin_forum_tracking') }}">埋点看板</a>
<a href="{{ url_for('admin_forum_posts') }}">帖子管理</a>
<a href="{{ url_for('admin_dashboard') }}">返回总览</a>
<a href="{{ url_for('admin_logout') }}">退出</a>
</nav>
</header>
<main class="admin-main">
{% if msg %}
<p class="hint success-msg">{{ msg }}</p>
{% endif %}
{% if error %}
<p class="error-msg">{{ error }}</p>
{% endif %}
<section class="dashboard-section">
<div class="admin-topline">
<h2>日报筛选</h2>
</div>
<form method="get" class="admin-filter-form">
<div class="filter-row">
<div class="filter-item">
<label for="day">日期</label>
<input id="day" name="day" type="date" value="{{ day_value.isoformat() if day_value else '' }}">
</div>
<div class="filter-item">
<label for="variant">CTA 变体</label>
<select id="variant" name="variant">
{% for opt in variant_options %}
<option value="{{ opt }}" {{ 'selected' if selected_variant == opt else '' }}>{{ opt }}</option>
{% endfor %}
</select>
</div>
<div class="filter-item">
<label for="device">设备类型</label>
<select id="device" name="device">
{% for opt in device_options %}
<option value="{{ opt }}" {{ 'selected' if selected_device == opt else '' }}>{{ opt }}</option>
{% endfor %}
</select>
</div>
<div class="filter-actions">
<button type="submit">查看日报</button>
<a href="{{ url_for('admin_forum_tracking_daily') }}">重置</a>
</div>
</div>
</form>
<div class="tracking-export-row">
<a href="{{ url_for('admin_forum_tracking_weekly', day=day_value.isoformat() if day_value else '', days=7, variant=selected_variant, device=selected_device) }}" class="admin-btn-link">查看近 7 天周报页</a>
<a href="{{ url_for('admin_forum_tracking_daily_export_markdown', day=day_value.isoformat() if day_value else '', variant=selected_variant, device=selected_device) }}" class="admin-btn-link">导出 Markdown 报告</a>
<a href="{{ url_for('admin_forum_tracking_export', mode='daily', days=2, variant=selected_variant, device=selected_device) }}" class="admin-btn-link">导出最近两天汇总 CSV</a>
<a href="{{ url_for('admin_forum_tracking_export', mode='variant_funnel', days=7, variant=selected_variant, device=selected_device) }}" class="admin-btn-link">导出近 7 天变体漏斗 CSV</a>
<a href="{{ url_for('admin_forum_tracking_weekly_export_markdown', day=day_value.isoformat() if day_value else '', days=7, variant=selected_variant, device=selected_device) }}" class="admin-btn-link">导出近 7 天周报 Markdown</a>
</div>
</section>
<section class="dashboard-section">
<h2>核心指标({{ day_value }}</h2>
<p class="admin-note">对比日期:{{ prev_day }}</p>
<div class="metric-grid">
<article class="metric-card">
<span class="metric-label">曝光</span>
<strong class="metric-value">{{ summary.impressions }}</strong>
<small class="metric-meta">CTR 基数</small>
</article>
<article class="metric-card">
<span class="metric-label">移动底栏曝光</span>
<strong class="metric-value">{{ summary.mobile_bar_impressions }}</strong>
<small class="metric-meta">移动端转化入口曝光</small>
</article>
<article class="metric-card">
<span class="metric-label">移动比价点击</span>
<strong class="metric-value">{{ summary.mobile_pricing_clicks }}</strong>
<small class="metric-meta">Rate {{ summary_rates.mobile_pricing_rate }}%</small>
</article>
<article class="metric-card">
<span class="metric-label">比价点击</span>
<strong class="metric-value">{{ summary.pricing_clicks }}</strong>
<small class="metric-meta">CTR {{ summary_rates.pricing_ctr }}%</small>
</article>
<article class="metric-card">
<span class="metric-label">发需求点击</span>
<strong class="metric-value">{{ summary.new_topic_clicks }}</strong>
<small class="metric-meta">Rate {{ summary_rates.new_topic_rate }}%</small>
</article>
<article class="metric-card">
<span class="metric-label">模板发帖点击</span>
<strong class="metric-value">{{ summary.template_clicks }}</strong>
<small class="metric-meta">Rate {{ summary_rates.template_rate }}%</small>
</article>
<article class="metric-card">
<span class="metric-label">模板发帖提交</span>
<strong class="metric-value">{{ summary.template_submits }}</strong>
<small class="metric-meta">Submit {{ summary_rates.template_submit_rate }}% · Completion {{ summary_rates.template_completion_rate }}%</small>
</article>
<article class="metric-card">
<span class="metric-label">评论提交</span>
<strong class="metric-value">{{ summary.comment_submits }}</strong>
<small class="metric-meta">Rate {{ summary_rates.comment_rate }}%</small>
</article>
<article class="metric-card">
<span class="metric-label">复制链接成功</span>
<strong class="metric-value">{{ summary.copy_success }}</strong>
<small class="metric-meta">Rate {{ summary_rates.copy_rate }}%</small>
</article>
<article class="metric-card">
<span class="metric-label">总事件</span>
<strong class="metric-value">{{ summary.events }}</strong>
</article>
</div>
</section>
<section class="dashboard-section">
<h2>环比变化(较 {{ prev_day }}</h2>
<table class="admin-table">
<thead>
<tr>
<th>指标</th>
<th>当日</th>
<th>前日</th>
<th>变化值</th>
<th>变化率</th>
</tr>
</thead>
<tbody>
{% for row in delta_rows %}
<tr>
<td>{{ row.label }}</td>
<td>{{ row.current }}</td>
<td>{{ row.previous }}</td>
<td><span class="delta-pill delta-{{ row.direction }}">{{ '+' if row.delta > 0 else '' }}{{ row.delta }}</span></td>
<td>{{ '+' if row.delta_pct > 0 else '' }}{{ row.delta_pct }}%</td>
</tr>
{% else %}
<tr><td colspan="5">暂无环比数据。</td></tr>
{% endfor %}
</tbody>
</table>
</section>
<section class="dashboard-section">
<h2>按变体对比({{ day_value }}</h2>
<table class="admin-table">
<thead>
<tr>
<th>变体</th>
<th>曝光</th>
<th>比价点击</th>
<th>CTR</th>
<th>发需求点击</th>
<th>需求率</th>
<th>模板发帖点击</th>
<th>模板率</th>
<th>模板发帖提交</th>
<th>模板完成率</th>
<th>评论提交</th>
<th>评论率</th>
</tr>
</thead>
<tbody>
{% for row in variant_rows %}
<tr>
<td><span class="status-pill {{ 'active' if row.variant in ['control', 'intent'] else 'inactive' }}">{{ row.variant }}</span></td>
<td>{{ row.impressions }}</td>
<td>{{ row.pricing_clicks }}</td>
<td>{{ row.pricing_ctr }}%</td>
<td>{{ row.new_topic_clicks }}</td>
<td>{{ row.new_topic_rate }}%</td>
<td>{{ row.template_clicks }}</td>
<td>{{ row.template_rate }}%</td>
<td>{{ row.template_submits }}</td>
<td>{{ row.template_completion_rate }}%</td>
<td>{{ row.comment_submits }}</td>
<td>{{ row.comment_rate }}%</td>
</tr>
{% else %}
<tr><td colspan="12">暂无变体日报数据。</td></tr>
{% endfor %}
</tbody>
</table>
</section>
<section class="dashboard-section">
<h2>Top 帖子({{ day_value }}</h2>
<table class="admin-table">
<thead>
<tr>
<th>帖子</th>
<th>曝光</th>
<th>比价点击</th>
<th>CTR</th>
<th>模板点击</th>
<th>模板提交</th>
<th>模板完成率</th>
<th>评论提交</th>
<th>评论率</th>
</tr>
</thead>
<tbody>
{% for row in top_posts %}
<tr>
<td><a href="{{ url_for('forum_post_detail', post_id=row.post_id) }}" target="_blank" rel="noopener">#{{ row.post_id }} {{ row.title }}</a></td>
<td>{{ row.impressions }}</td>
<td>{{ row.pricing_clicks }}</td>
<td>{{ row.pricing_ctr }}%</td>
<td>{{ row.template_clicks }}</td>
<td>{{ row.template_submits }}</td>
<td>{{ row.template_completion_rate }}%</td>
<td>{{ row.comment_submits }}</td>
<td>{{ row.comment_rate }}%</td>
</tr>
{% else %}
<tr><td colspan="9">暂无帖子日报数据。</td></tr>
{% endfor %}
</tbody>
</table>
</section>
<section class="dashboard-section">
<h2>Top 模板转化帖子({{ day_value }}</h2>
<table class="admin-table">
<thead>
<tr>
<th>帖子</th>
<th>模板点击</th>
<th>模板提交</th>
<th>模板完成率</th>
<th>模板点击率</th>
<th>模板提交率</th>
</tr>
</thead>
<tbody>
{% for row in template_top_posts %}
<tr>
<td><a href="{{ url_for('forum_post_detail', post_id=row.post_id) }}" target="_blank" rel="noopener">#{{ row.post_id }} {{ row.title }}</a></td>
<td>{{ row.template_clicks }}</td>
<td>{{ row.template_submits }}</td>
<td>{{ row.template_completion_rate }}%</td>
<td>{{ row.template_rate }}%</td>
<td>{{ row.template_submit_rate }}%</td>
</tr>
{% else %}
<tr><td colspan="6">暂无模板转化帖子数据。</td></tr>
{% endfor %}
</tbody>
</table>
</section>
<section class="dashboard-section">
<h2>Top 标签({{ day_value }}</h2>
<table class="admin-table">
<thead>
<tr>
<th>事件</th>
<th>标签</th>
<th>次数</th>
</tr>
</thead>
<tbody>
{% for row in top_labels %}
<tr>
<td><code>{{ row.event_name }}</code></td>
<td>{{ row.label }}</td>
<td>{{ row.total }}</td>
</tr>
{% else %}
<tr><td colspan="3">暂无标签日报数据。</td></tr>
{% endfor %}
</tbody>
</table>
</section>
</main>
</body>
</html>