fix: add expected field back for frontend F Tab rendering
This commit is contained in:
@@ -956,7 +956,7 @@ def api_expected():
|
||||
for svc in agent.get("services", []):
|
||||
svc_type = svc["type"]
|
||||
port = svc.get("port")
|
||||
entry = {"name": f"{display}({host}):{svc_type}", "host": host, "critical": True}
|
||||
entry = {"name": f"{display}({host}):{svc_type}", "host": host, "expected": "running", "critical": True}
|
||||
if port:
|
||||
entry["port"] = port
|
||||
entry["check"] = "tcp"
|
||||
@@ -969,7 +969,7 @@ def api_expected():
|
||||
|
||||
# 2. 从 PLATFORM_SERVICES 生成平台服务的期望
|
||||
for ps in PLATFORM_SERVICES:
|
||||
entry = {"name": f"{ps['name']} ({ps['id']})", "host": ps.get("host", "127.0.0.1"), "critical": True}
|
||||
entry = {"name": f"{ps['name']} ({ps['id']})", "host": ps.get("host", "127.0.0.1"), "expected": "running", "critical": True}
|
||||
if ps.get("health_url"):
|
||||
entry["health_url"] = ps["health_url"]
|
||||
entry["check"] = "health_url"
|
||||
@@ -981,8 +981,8 @@ def api_expected():
|
||||
expected.append(entry)
|
||||
|
||||
# 3. 固定定时任务期望
|
||||
expected.append({"name": "agents-health-check", "check": "scheduled", "critical": False})
|
||||
expected.append({"name": "agents-daily-health", "check": "scheduled", "critical": False})
|
||||
expected.append({"name": "agents-health-check", "check": "scheduled", "expected": "scheduled", "critical": False})
|
||||
expected.append({"name": "agents-daily-health", "check": "scheduled", "expected": "scheduled", "critical": False})
|
||||
|
||||
# ── 实际状态检测 ──
|
||||
actual = {}
|
||||
|
||||
Reference in New Issue
Block a user