feat: bind monitors by base url hash
This commit is contained in:
@@ -226,6 +226,11 @@ def text_tokens(value: Any) -> set[str]:
|
||||
|
||||
|
||||
def matching_monitor(row: dict[str, Any], status_payload: dict[str, Any]) -> dict[str, Any] | None:
|
||||
base_url_hash = str(row.get("base_url_hash") or "").strip()
|
||||
if base_url_hash:
|
||||
for item in monitor_items(status_payload):
|
||||
if str(item.get("base_url_hash") or "").strip() == base_url_hash:
|
||||
return item
|
||||
account_tokens = text_tokens(row.get("name"))
|
||||
if not account_tokens:
|
||||
return None
|
||||
@@ -324,6 +329,7 @@ def normalize_account_rows(payload: dict[str, Any], filter_text: str = "") -> li
|
||||
"id": as_int(account.get("id")),
|
||||
"name": str(account.get("name") or ""),
|
||||
"routing_group": routing_group,
|
||||
"base_url_hash": str(account.get("base_url_hash") or ""),
|
||||
"provider": provider_label(account),
|
||||
"kind": str(account.get("kind") or "unknown"),
|
||||
"kind_label": kind_label(account.get("kind")),
|
||||
|
||||
Reference in New Issue
Block a user