feat: persist browser sessions and update admin workflows
This commit is contained in:
@@ -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 "服务恢复"
|
||||
|
||||
Reference in New Issue
Block a user