dashboard: plus de spam [Presets] Erreur depuis le polling
- dashboard_status utilise le cache presets au lieu d'appeler Jean - jean_service_ok/ollama_service_ok silencieux (pas de warning log) - slot check uniquement si jean est UP - [Presets] Erreur ne vient plus du dashboard mais d'OpenFox/OpenWebUI
This commit is contained in:
+8
-9
@@ -157,7 +157,7 @@ def jean_alive() -> bool:
|
||||
|
||||
|
||||
def jean_service_ok() -> bool:
|
||||
"""Verifie que le service Jean repond (HTTP)"""
|
||||
"""Verifie que le service Jean repond (HTTP) — silencieux"""
|
||||
try:
|
||||
r = requests.get(f"http://{JEAN_WEB_HOST}:{JEAN_WEB_PORT}/api/presets", timeout=3)
|
||||
return r.ok
|
||||
@@ -166,7 +166,7 @@ def jean_service_ok() -> bool:
|
||||
|
||||
|
||||
def ollama_service_ok() -> bool:
|
||||
"""Verifie que le service Ollama repond (HTTP)"""
|
||||
"""Verifie que le service Ollama repond (HTTP) — silencieux"""
|
||||
try:
|
||||
r = requests.get(f"http://{OLLAMA_DIRECT_HOST}:{OLLAMA_DIRECT_PORT}/api/version", timeout=2)
|
||||
return r.ok
|
||||
@@ -1019,13 +1019,11 @@ def dashboard_status():
|
||||
jean_ok = jean_service_ok() if pc_alive else False
|
||||
olla_ok = ollama_service_ok() if pc_alive else False
|
||||
|
||||
try:
|
||||
r = requests.get(f"http://{JEAN_WEB_HOST}:{JEAN_WEB_PORT}/api/presets", timeout=1)
|
||||
presets_raw = r.json() if r.ok else []
|
||||
except Exception:
|
||||
presets_raw = []
|
||||
# Presets depuis le cache (evite d'appeler get_presets qui log un warning si down)
|
||||
presets_raw = presets_cache.get("data", []) if jean_ok else []
|
||||
|
||||
slot_info = None
|
||||
if jean_ok:
|
||||
try:
|
||||
r = requests.get(f"http://{JEAN_WEB_HOST}:{JEAN_WEB_PORT}/slots", timeout=1)
|
||||
if r.ok:
|
||||
@@ -1044,6 +1042,7 @@ def dashboard_status():
|
||||
active = get_active_preset()
|
||||
with stats_lock:
|
||||
stats = dict(request_stats)
|
||||
stats["last_requests"] = list(stats.get("last_requests", []))
|
||||
|
||||
return jsonify({
|
||||
"pc": {
|
||||
@@ -1154,8 +1153,8 @@ h1{font-size:18px;color:var(--purple);margin-bottom:12px}
|
||||
.badge-red{background:#3a1a1a;color:var(--red);border:1px solid var(--red)}
|
||||
.badge-blue{background:#1a2a3a;color:var(--blue);border:1px solid var(--blue)}
|
||||
#logs{grid-column:1/-1;height:400px;overflow-y:auto;font-size:12px;line-height:1.6;border:1px solid var(--border);border-radius:6px;padding:10px;background:#0a0e13}
|
||||
#logs .error{color:var(--red)}
|
||||
#logs .warn{color:#f0883e;font-weight:500}
|
||||
#logs .error{color:#ff7b72;background:#1a0a0a;padding:1px 4px;border-radius:3px;display:inline-block;max-width:100%;word-break:break-all}
|
||||
#logs .warn{color:#ffa657;background:#1a1008;padding:1px 4px;border-radius:3px;display:inline-block;max-width:100%;word-break:break-all}
|
||||
#logs .info{color:var(--muted)}
|
||||
#logs .debug{color:#484f58}
|
||||
#logs .highlight{color:var(--green);font-weight:700}
|
||||
|
||||
Reference in New Issue
Block a user