diff --git a/gateway/scripts/dashboard.py b/gateway/scripts/dashboard.py index 2da55d4..387594f 100644 --- a/gateway/scripts/dashboard.py +++ b/gateway/scripts/dashboard.py @@ -962,6 +962,7 @@ def api_expected(): entry["check"] = "tcp" elif svc_type == "xmpp_bot": entry["check"] = "xmpp" # xmpp bot without port means ejabberd-connected + entry["jid"] = agent.get("jid", "") else: entry["check"] = "agent_online" expected.append(entry) @@ -1024,6 +1025,16 @@ def api_expected(): # 远程服务:状态由 /api/platform 精确检测,这里标记为远程引用 actual[name] = "remote (见平台Tab)" + elif check == "xmpp": + # 无端口号的 xmpp_bot:通过 ejabberdctl 查 JID 是否在线 + jid = e.get("jid", "") + if jid: + online = _ejabberd_online_jids() + actual[name] = "online" if jid in online else "offline" + else: + actual[name] = "unknown" + elif check == "agent_online": + actual[name] = "unknown" else: actual[name] = "unknown"