81 lines
3.4 KiB
HTML
81 lines
3.4 KiB
HTML
{% extends "base.html" %}
|
|
{% set has_running_tasks = tasks | selectattr("status", "equalto", "running") | list | length > 0 %}
|
|
{% 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>
|
|
<div class="hero-actions">
|
|
<a class="btn btn-light" href="#create-task">创建新任务</a>
|
|
<a class="btn btn-outline-light" href="#task-history">查看 Demo 数据</a>
|
|
</div>
|
|
</section>
|
|
|
|
<section class="card mb-4" id="create-task">
|
|
<div class="card-header">创建抓取任务</div>
|
|
<div class="card-body">
|
|
<div id="form-error" class="alert alert-danger d-none" role="alert"></div>
|
|
<form id="task-form" onsubmit="submitTask(event)">
|
|
<div class="row g-3 align-items-end">
|
|
<div class="col-md-3">
|
|
<label class="form-label" for="platform">平台</label>
|
|
<select class="form-select" id="platform" name="platform">
|
|
<option value="xiaohongshu">小红书</option>
|
|
<option value="douyin">抖音</option>
|
|
</select>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<label class="form-label" for="hotspot_limit">热点数</label>
|
|
<input class="form-control scale-input" id="hotspot_limit" name="hotspot_limit" type="number" min="1" max="10" value="5">
|
|
</div>
|
|
<div class="col-md-2">
|
|
<label class="form-label" for="item_limit_per_hotspot">每热点内容</label>
|
|
<input class="form-control scale-input" id="item_limit_per_hotspot" name="item_limit_per_hotspot" type="number" min="1" max="10" value="5">
|
|
</div>
|
|
<div class="col-md-2">
|
|
<label class="form-label" for="comment_limit_per_item">每内容评论</label>
|
|
<input class="form-control scale-input" id="comment_limit_per_item" name="comment_limit_per_item" type="number" min="10" max="100" value="50">
|
|
</div>
|
|
<div class="col-md-3">
|
|
<button class="btn btn-primary w-100" id="submit-btn" type="submit">开始抓取</button>
|
|
</div>
|
|
</div>
|
|
<div class="form-text text-muted mt-2" id="scale-hint">
|
|
预计最多抓取:<strong id="scale-calc">1250</strong> 条评论(实际数量可能受平台返回数量、去重、失败、限流影响)
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</section>
|
|
|
|
<section class="card" id="task-history">
|
|
<div class="card-header d-flex justify-content-between align-items-center">
|
|
<span>最近任务与 Demo 数据</span>
|
|
<button class="btn btn-outline-secondary btn-sm" onclick="window.location.href='/'">手动刷新</button>
|
|
</div>
|
|
<div class="table-responsive">
|
|
<table class="table table-hover align-middle mb-0">
|
|
<thead>
|
|
<tr>
|
|
<th>任务 ID</th>
|
|
<th>平台</th>
|
|
<th>创建时间</th>
|
|
<th>配置规模</th>
|
|
<th>进度</th>
|
|
<th>状态</th>
|
|
<th>操作</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="task-table-body" {% if has_running_tasks %}data-task-list-auto-poll="true"{% endif %}>
|
|
{% include "partials/task_rows.html" %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</section>
|
|
{% if has_running_tasks %}
|
|
<script>document.addEventListener("DOMContentLoaded", () => pollTaskListStatus());</script>
|
|
{% endif %}
|
|
{% endblock %}
|