- Landing: 主 CTA “先做快速审核” 升级为主按钮,移除多余的次按钮,添加 hero-note 与 hero-divider 让首屏节奏更稳
- Landing: hero-points 收口为 3 个差异化卖点,第 1 个加 lead 背景,右侧风险卡降饱和、避免压过主 CTA
- Landing: 删去旧“志愿方案审计更聚焦/先下单后补资料/站内可追踪交付”重复卡片
- Public: /privacy /service-terms /deletion-policy 接 portal-ui.css 并改成双段 panel + 列表结构
- Portal: /portal/{token}/notifications /portal/{token}/deletion-request 接 portal-ui.css 与新的工具条 / 表单字段化
- Admin: /admin/orders/new 接 portal-ui.css,添加“人工补录更直接/与后台订单主链一致/字段业务语义化”信任块
- Admin: /admin/notifications /admin/ops-alerts 接 portal-ui.css,添加 meta-grid 摘要并把 “payload / details” 改名为“通知内容摘要 / 详细上下文”
- Tests: 锁住 shared CSS、关键产品化文案、Portal 与 admin 页结构断言
34 lines
1.3 KiB
Python
34 lines
1.3 KiB
Python
from __future__ import annotations
|
|
|
|
from pathlib import Path
|
|
|
|
from data.notifications.ops_alerts import OpsAlertSink
|
|
|
|
|
|
def test_admin_ops_alert_list_and_page(client, auth_headers, settings, tmp_path: Path):
|
|
sink = OpsAlertSink(log_path=settings.ops_alert_log_path)
|
|
sink.emit(
|
|
alert_type="delivery_watchdog_failed",
|
|
title="Gaokao delivery watchdog detected failed events",
|
|
body="station failed once",
|
|
details={"channel": "station", "failed": 1},
|
|
)
|
|
|
|
api = client.get("/api/admin/notifications/ops-alerts", headers=auth_headers)
|
|
assert api.status_code == 200, api.text
|
|
body = api.json()
|
|
assert body["total"] == 1
|
|
assert body["items"][0]["alert_type"] == "delivery_watchdog_failed"
|
|
assert body["items"][0]["details"]["channel"] == "station"
|
|
|
|
page = client.get("/admin/ops-alerts", headers=auth_headers)
|
|
assert page.status_code == 200, page.text
|
|
assert "运维告警审计" in page.text
|
|
assert '/static/portal-ui.css' in page.text
|
|
assert "告警来源文件" in page.text
|
|
assert "详细上下文" in page.text
|
|
assert "delivery_watchdog_failed" in page.text
|
|
assert "station failed once" in page.text
|
|
assert "SMTP 告警收件人数量" in page.text
|
|
assert "IM Webhook 数量" in page.text
|