fix: show endpoint model names and duplicate targets
This commit is contained in:
@@ -333,7 +333,8 @@ def _probe_endpoint(url: str, timeout: int = 5) -> dict[str, Any]:
|
||||
version_payload = _json_request(url + "/api/version", timeout=timeout)
|
||||
tags_payload = _json_request(url + "/api/tags", timeout=timeout)
|
||||
models = tags_payload.get("models", [])
|
||||
return {"available": True, "url": url, "version": str(version_payload.get("version") or "unknown"), "models": len(models) if isinstance(models, list) else 0}
|
||||
model_names = [str(item.get("name") or item.get("model")) for item in models if isinstance(item, dict) and (item.get("name") or item.get("model"))]
|
||||
return {"available": True, "url": url, "version": str(version_payload.get("version") or "unknown"), "models": len(model_names), "model_names": model_names[:100]}
|
||||
|
||||
|
||||
def _connection_snapshot() -> list[dict[str, Any]]:
|
||||
@@ -365,6 +366,10 @@ def _connection_snapshot() -> list[dict[str, Any]]:
|
||||
except Exception as exc:
|
||||
result = {"available": False, "kind": kind, "label": label, "url": normalized, "error": str(exc)[:240]}
|
||||
results.append(result)
|
||||
local_urls = {row.get("url") for row in results if row.get("kind") == "local" and row.get("available")}
|
||||
for row in results:
|
||||
if row.get("kind") == "remote" and row.get("url") in local_urls:
|
||||
row["same_endpoint"] = True
|
||||
return results
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user