chages in profiles
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from .client import *
|
||||
from .. import poller_control
|
||||
import shlex
|
||||
|
||||
def scgi_diagnostics(profile: dict) -> dict:
|
||||
@@ -64,7 +65,12 @@ def scgi_diagnostics(profile: dict) -> dict:
|
||||
def profile_diagnostics(profile: dict) -> dict:
|
||||
"""Lightweight per-profile diagnostics for save/test UI."""
|
||||
started = time.perf_counter()
|
||||
result = {"profile_id": profile.get("id"), "ok": False, "checks": {}}
|
||||
profile_id = profile.get("id")
|
||||
try:
|
||||
slow_threshold_ms = float(poller_control.get_settings(int(profile_id)).get("slow_response_threshold_ms") or poller_control.DEFAULTS["slow_response_threshold_ms"])
|
||||
except Exception:
|
||||
slow_threshold_ms = float(poller_control.DEFAULTS["slow_response_threshold_ms"])
|
||||
result = {"profile_id": profile_id, "ok": False, "checks": {}, "slow_threshold_ms": slow_threshold_ms}
|
||||
try:
|
||||
c = client_for(profile)
|
||||
version = str(c.call("system.client_version") or "")
|
||||
@@ -96,7 +102,7 @@ def profile_diagnostics(profile: dict) -> dict:
|
||||
free_disk[base] = {"error": str(exc)}
|
||||
result.update({
|
||||
"ok": True,
|
||||
"status": "online",
|
||||
"status": "normal",
|
||||
"version": version,
|
||||
"library_version": library,
|
||||
"base_paths": paths,
|
||||
@@ -106,7 +112,8 @@ def profile_diagnostics(profile: dict) -> dict:
|
||||
})
|
||||
except Exception as exc:
|
||||
result.update({"ok": False, "status": "error", "error": str(exc), "response_time_ms": round((time.perf_counter() - started) * 1000, 2)})
|
||||
if result.get("ok") and result.get("response_time_ms", 0) > 1500:
|
||||
# Note: Profile diagnostics uses the same slow-response threshold as Tools -> Poller for this profile.
|
||||
if result.get("ok") and result.get("response_time_ms", 0) > slow_threshold_ms:
|
||||
result["status"] = "slow"
|
||||
return result
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -738,23 +738,6 @@ body.resizing-details {
|
||||
.profile-actions {
|
||||
justify-content: flex-end;
|
||||
}
|
||||
.profile-status-badge.badge {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: auto;
|
||||
min-width: 0;
|
||||
min-height: 1rem;
|
||||
max-width: max-content;
|
||||
padding: 0.1rem 0.32rem;
|
||||
border-radius: 999px;
|
||||
font-size: 0.58rem;
|
||||
line-height: 1;
|
||||
letter-spacing: 0.01em;
|
||||
text-transform: uppercase;
|
||||
white-space: nowrap;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.profile-form-grid {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(150px, 1.1fr) minmax(260px, 2.1fr) minmax(
|
||||
@@ -3579,9 +3562,21 @@ body.mobile-mode .mobile-filter-bar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.profile-diagnostics-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:.5rem;}
|
||||
.profile-diagnostics-card{border:1px solid var(--bs-border-color);border-radius:.5rem;padding:.5rem;background:var(--bs-body-bg);}
|
||||
.profile-diagnostics-card small{display:block;color:var(--bs-secondary-color);}
|
||||
.profile-diagnostics-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
|
||||
gap: 0.5rem;
|
||||
}
|
||||
.profile-diagnostics-card {
|
||||
border: 1px solid var(--bs-border-color);
|
||||
border-radius: 0.5rem;
|
||||
padding: 0.5rem;
|
||||
background: var(--bs-body-bg);
|
||||
}
|
||||
.profile-diagnostics-card small {
|
||||
display: block;
|
||||
color: var(--bs-secondary-color);
|
||||
}
|
||||
|
||||
.labels-manager {
|
||||
display: grid;
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user