Fix portal branding icons and system info

This commit is contained in:
Jino Jose committed 2026-06-30 16:29:03 +05:30
1 parent e4e126bd43
commit 2b03df0e3a
3 files changed
+129 -38

No files matched your search

+29 -3
View File
@@ -1621,14 +1621,40 @@ async def system_info(user: dict = Depends(current_user)):
except Exception:
v = "unknown"
try:
os_name = subprocess.check_output(["lsb_release", "-ds"], text=True, timeout=3).strip().strip('"')
except Exception:
os_name = subprocess.getoutput("uname -sr") or "unknown"
ip_address = ""
try:
for _name, addrs in psutil.net_if_addrs().items():
for addr in addrs:
if addr.address.count(".") == 3 and not addr.address.startswith("127."):
ip_address = addr.address
raise StopIteration
except StopIteration:
pass
except Exception:
ip_address = ""
metrics = collect_metrics()
gpu_name = subprocess.getoutput(
"nvidia-smi --query-gpu=name --format=csv,noheader 2>/dev/null | head -1"
) or "N/A"
return {
"hostname": hostname,
"ip_address": ip_address,
"os": os_name,
"uptime": uptime,
"python_version": subprocess.getoutput("python3 --version"),
"ollama_version": v,
"gpu_name": subprocess.getoutput(
"nvidia-smi --query-gpu=name --format=csv,noheader 2>/dev/null | head -1"
) or "N/A",
"gpu_name": gpu_name,
"gpu_vram_gb": metrics.get("gpu_mem_total_gb"),
"ram_total_gb": metrics.get("ram_total_gb"),
"disk_total_gb": metrics.get("disk_total_gb"),
"cpu_cores": metrics.get("cpu_cores"),
}
@app.get("/api/system/feasibility")