{% extends "base.html" %} {% block title %}站点登录 — News Harvester{% endblock %} {% block extra_head %} {% if test_state and test_state.values() | selectattr('running') | list %} {% endif %} {% endblock %} {% block content %}

站点登录

登录态按站点共享:同一站点的全部频道共用一个浏览器实例与一份登录 (~/.news-harvester/profiles/<站点>/,站点 = 源名第一段, 如 nikkei-world / nikkei-markets / nikkei-tech 共用 nikkei 一份登录, 测任一频道即知全站状态)。凭据与配方同样按站点:一份账号密码+配方覆盖该站全部频道; 保存后以 600 权限落盘,密码不再回显。每个源采集前自动预检,未登录会自动登录。

{% with messages = get_flashed_messages() %} {% if messages %}{% for m in messages %}
{{ m }}
{% endfor %}{% endif %} {% endwith %}

登录态 · 按源

{% for r in src_rows %} {% set st = test_state.get(r.source) %} {% endfor %}
源站点采集开关登录账号(站点级)自动登录配方站点实例上次测试操作
{{ r.source }}{% if r.display and r.display != r.source %} {{ r.display }}{% endif %} {{ r.site }} {% if r.enabled %}开{% else %}停{% endif %} {{ r.user or '—' }} {% if r.has_recipe %}支持 {% else %}无配方{% endif %} {% if r.has_profile %}已建 {% else %}未建(测试/首跑时自动创建){% endif %} {% if st and st.running %} 测试中…(启动于 {{ st.start }}) {% elif st and st.done %} {% if '已登录' in st.output or '登录成功' in st.output %} 通过 {% else %} 失败 {% endif %}
输出
{{ st.output }}
{% else %} — {% endif %}
{% if not r.configured %} 站点未配凭据 {% endif %}

站点凭据 · 按站点

{% for r in rows %} {% endfor %}
站点登录账号首页覆盖频道凭据配方操作
{{ r.site }} {{ r.user or '—' }} {{ r.url or '—' }} {% if r.sources %} {% for s in r.sources %}{{ s }}{% endfor %} {% else %} 未接入源(凭据与配方先行,装源后直接生效) {% endif %} {% if r.configured %}已配置 {% else %}未配置{% endif %} {% if r.has_recipe %}支持 {% else %}无配方(配置凭据后点右侧按钮自动生成){% endif %} {% set mst = test_state.get('manual:' ~ r.site) %} {% if mst and mst.running %} 登录向导运行中(窗口里登录,自动检测) {% elif mst and mst.done and '"logged_in":true' in mst.output %} 登录已记录 {% elif mst and mst.done %} 未检测到登录(超时?) {% endif %}
{% if mst and mst.done and mst.output %}
向导结果
{{ mst.output }}
{% endif %} {% if r.has_recipe %}
{% elif r.configured %}
{% endif %} {% if r.configured %}
{% endif %}

{{ '编辑站点凭据' if edit_hint else '添加 / 更新站点凭据' }}

{% endblock %}