feat: persist browser sessions and update admin workflows

This commit is contained in:
liumangmang
2026-05-29 16:00:43 +08:00
parent e3151a7ea6
commit c5778bb3e7
19 changed files with 829 additions and 369 deletions
+19
View File
@@ -64,6 +64,25 @@ def format_dingtalk_website_rate_changed(
}
def format_dingtalk_balance_low(
upstream_name: str, balance: float, threshold: float, changed_at: str
) -> dict[str, Any]:
lines = [
f"### ⚠️ {upstream_name} 余额不足",
"",
f"- **当前余额**{balance:.2f}",
f"- **告警阈值**{threshold:.2f}",
f"- **时间**{changed_at}",
]
return {
"msgtype": "markdown",
"markdown": {
"title": f"{upstream_name} 余额不足",
"text": "\n".join(lines),
},
}
def format_dingtalk_status(upstream_name: str, event: str, changed_at: str, error: str = "") -> dict[str, Any]:
emoji = "🔴" if event == "upstream_unhealthy" else "🟢"
label = "服务异常" if event == "upstream_unhealthy" else "服务恢复"