fix(monitoring+layout): 修復基礎架構消失 + 監控工具全線上
All checks were successful
CD Pipeline / build-and-deploy (push) Successful in 6m47s
All checks were successful
CD Pipeline / build-and-deploy (push) Successful in 6m47s
- page.tsx: 右側 panel overflow:hidden → overflowY:auto,基礎架構重新顯示 - page.tsx: 監控工具卡片對齊 figma (icon box + 版本/統計行 + ›箭頭) - monitoring.py: Gitea probe 改用 /api/v1/version (/-/readiness 404) - monitoring.py: Grafana dashboard count 加 Basic auth - NetworkPolicy: 補開 3002/9090/3001 egress (Grafana/Prometheus/Gitea) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -38,9 +38,12 @@ async def _probe_grafana(client: httpx.AsyncClient) -> dict:
|
||||
if r.status_code == 200:
|
||||
data = r.json()
|
||||
version = data.get("version")
|
||||
# Dashboard count requires basic auth (internal probe only)
|
||||
import base64 as _b64
|
||||
_token = _b64.b64encode(b"admin:WoooTech2026").decode()
|
||||
dash_r = await client.get(
|
||||
f"{base}/api/search?type=dash-db",
|
||||
headers={"X-Grafana-Org-Id": "1"},
|
||||
headers={"Authorization": f"Basic {_token}"},
|
||||
timeout=TIMEOUT,
|
||||
)
|
||||
dash_count = len(dash_r.json()) if dash_r.status_code == 200 and isinstance(dash_r.json(), list) else None
|
||||
@@ -179,12 +182,10 @@ async def _probe_signoz(client: httpx.AsyncClient) -> dict:
|
||||
async def _probe_gitea(client: httpx.AsyncClient) -> dict:
|
||||
base = "http://192.168.0.110:3001"
|
||||
try:
|
||||
r = await client.get(f"{base}/-/readiness", timeout=TIMEOUT)
|
||||
if r.status_code == 200:
|
||||
ver_r = await client.get(f"{base}/api/v1/version", timeout=TIMEOUT)
|
||||
version = None
|
||||
if ver_r.status_code == 200:
|
||||
version = ver_r.json().get("version")
|
||||
# Use /api/v1/version — /-/readiness returns 404 on this Gitea version
|
||||
ver_r = await client.get(f"{base}/api/v1/version", timeout=TIMEOUT)
|
||||
if ver_r.status_code == 200:
|
||||
version = ver_r.json().get("version")
|
||||
return {
|
||||
"name": "Gitea",
|
||||
"status": "up",
|
||||
|
||||
Reference in New Issue
Block a user