{% from "_macros.html" import th %}
{#- five-state badge coloring: warn=needs action, green=healthy, info=paused,
red=dead, gray=retired -#}
{% set status_badge = {'login_required': 'refused', 'active': 'success',
'cooldown': 'running', 'banned': 'failed',
'retired': 'cancelled'} %}
{% set kind_badge = {'login': 'success', 'probe': 'running',
'small_batch': 'running', 'lease_acquired': 'running',
'lease_released': 'no_op', 'lease_expired': 'refused',
'auth_failed': 'failed', 'suspect_yield': 'zero_yield',
'banned': 'failed', 'note': 'no_op'} %}
{#- The standing banner rides as an OUT-OF-BAND update of the page slot
#auth-alert (spec 警告不重复堆叠): htmx pulls this top-level element out
of the swap and refreshes the page-level banner in place, so the warning
is never re-rendered inline among the cards below. Rendered unconditionally
so a resolved alert clears the slot on the next poll. -#}
{% include "_auth_alert.html" %}
{{ t('身份') }} {{ summary.total }}
{{ t('活跃') }} {{ summary.active }}
{{ t('需登录') }} {{ summary.login_required }}
{{ t('租借中') }} {{ summary.leased }}
{#- 任务分区 (spec: 需登录队列与新建账号表单分属独立分区/卡片): one task
per card. The queue comes FIRST — the page banner's 「点下方『登录』」
points at it, so the actionable rows (now carrying their own visible
拉起登录站 buttons, spec 队列行内登录入口可见) sit directly under the
warning instead of under the occasional-use registration form. -#}
{{ t('需登录队列') }}
- {{ t('失败次数多者先处理,从未登录过的(新登记)排最前。') }}
- {{ t('每行可直接拉起登录站,行内按钮即对该身份发起登录任务。') }}
{{ th(t('源')) }}{{ th(t('账号')) }}{{ th(t('自动化')) }}{{ th(t('最近登录')) }}{{ th(t('失败次数')) }}{{ th(t('操作')) }}
{% for i in queue %}
| {{ i.source }} |
{{ i.account_alias }} |
{{ i.automation }} |
{{ i.last_login_at or t('从未登录') }} |
{{ i.failure_count }} |
{#- fields aligned with POST /panel/auth/station/launch:
source / account_alias / optional egress_ref -#}
|
{% else %}
| {{ t('队列为空,没有需要登录的身份') }} |
{% endfor %}
{{ t('新建账号') }}
- {{ t('选源 + 起别名即登记身份,登记后进入上方队列等待登录。') }}
- {{ t('出口可留自动分配,或自选一个固定出口(该账号的登录与后续爬取都走它)。') }}
{{ t('身份矩阵') }}
- {{ t('按源分组:账号 / 五态状态 / 自动化程度 / 最近登录 / 最近成功 / 连续零产出 / 租借。') }}
- {{ t('login_required 行内可直接拉起登录站(可换出口)。') }}
{{ th(t('账号')) }}{{ th(t('状态')) }}{{ th(t('自动化')) }}{{ th(t('最近登录')) }}{{ th(t('最近成功')) }}{{ th(t('连续零产出')) }}{{ th(t('租借')) }}
{% for g in groups %}
|
{{ g.source }}
{% if g.auth_profile %}{{ t('认证源') }}{% endif %}
{{ g.identities | length }} {{ t('身份') }}
|
{% for i in g.identities %}
| {{ i.account_alias }} |
{{ i.status }}
{% if i.status == 'login_required' %}
{% endif %} |
{{ i.automation }} |
{{ i.last_login_at or '—' }} |
{{ i.last_success_at or '—' }} |
{% if i.consecutive_zero_runs %}{{ i.consecutive_zero_runs }}{% else %}0{% endif %} |
{% if i.leased %}{{ t('租借中') }} {{ i.lease_owner }}
{% elif i.lease_expired %}{{ t('租约过期') }}
{% else %}—{% endif %} |
{% endfor %}
{% else %}
| {{ t('尚无身份') }} |
{% endfor %}
{{ t('事件流') }} {{ t('最近 20 条') }}
- {{ t('login / probe / small_batch / lease / 失效与封禁留痕。') }}
- {{ t('可按身份回放。') }}
{{ th(t('时间')) }}{{ th(t('类型')) }}{{ th(t('身份')) }}{{ th(t('详情')) }}{{ th(t('租借令牌')) }}
{% for ev in events %}
| {{ ev.created_at or '—' }} |
{{ ev.kind }} |
{{ ev.source }} / {{ ev.account_alias }} |
{{ ev.detail or '—' }} |
{{ (ev.lease_token or '')[:8] or '—' }} |
{% else %}
| {{ t('尚无事件') }} |
{% endfor %}
{{ t('登录站') }}
- {{ t('进行中/最近的登录站:状态、期限与观察窗入口。') }}
- {{ t('超期未完成的站会被标记超时并可回收;已结束的站可一键重新拉起。') }}
{{ th(t('站')) }}{{ th(t('身份')) }}{{ th(t('状态')) }}{{ th(t('出口')) }}{{ th(t('期限')) }}{{ th(t('操作')) }}
{% for stn in stations %}
{% include "_station_row.html" %}
{% else %}
| {{ t('暂无登录站') }} |
{% endfor %}