mirror of
https://github.com/fawney19/Aether.git
synced 2026-10-07 09:57:47 +08:00
refactor(health): add dashboard overview and related drill-down
- Replace health monitor tabs with a dashboard layout - Add related health drill-down for endpoint, model, and provider cards - Render provider health as cards and hide empty monitors
This commit is contained in:
@@ -81,6 +81,16 @@ pub(super) fn classify_admin_endpoints_family_route(
|
||||
"admin:endpoints_health",
|
||||
false,
|
||||
))
|
||||
} else if method == http::Method::GET
|
||||
&& normalized_path == "/api/admin/endpoints/health/related"
|
||||
{
|
||||
Some(classified(
|
||||
"admin_proxy",
|
||||
"endpoints_health",
|
||||
"health_related",
|
||||
"admin:endpoints_health",
|
||||
false,
|
||||
))
|
||||
} else if method == http::Method::GET
|
||||
&& normalized_path.starts_with("/api/admin/endpoints/rpm/key/")
|
||||
{
|
||||
|
||||
@@ -157,6 +157,7 @@ pub(super) fn classify_public_support_route(
|
||||
| "/api/public/global-models"
|
||||
| "/api/public/health/api-formats"
|
||||
| "/api/public/health/models"
|
||||
| "/api/public/health/related"
|
||||
)
|
||||
{
|
||||
let route_kind = match normalized_path {
|
||||
@@ -168,6 +169,7 @@ pub(super) fn classify_public_support_route(
|
||||
"/api/public/global-models" => "global_models",
|
||||
"/api/public/health/api-formats" => "health_api_formats",
|
||||
"/api/public/health/models" => "health_models",
|
||||
"/api/public/health/related" => "health_related",
|
||||
_ => "site_info",
|
||||
};
|
||||
Some(classified(
|
||||
|
||||
@@ -140,6 +140,25 @@ fn classifies_admin_endpoint_health_providers_as_admin_proxy_route() {
|
||||
assert!(!decision.is_execution_runtime_candidate());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn classifies_admin_endpoint_health_related_as_admin_proxy_route() {
|
||||
let headers = headers(&[]);
|
||||
let uri: Uri = "/api/admin/endpoints/health/related?dimension=model&value=gpt-5"
|
||||
.parse()
|
||||
.expect("uri should parse");
|
||||
let decision =
|
||||
classify_control_route(&http::Method::GET, &uri, &headers).expect("route should classify");
|
||||
|
||||
assert_eq!(decision.route_class.as_deref(), Some("admin_proxy"));
|
||||
assert_eq!(decision.route_family.as_deref(), Some("endpoints_health"));
|
||||
assert_eq!(decision.route_kind.as_deref(), Some("health_related"));
|
||||
assert_eq!(
|
||||
decision.auth_endpoint_signature.as_deref(),
|
||||
Some("admin:endpoints_health")
|
||||
);
|
||||
assert!(!decision.is_execution_runtime_candidate());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn classifies_admin_endpoint_key_rpm_as_admin_proxy_route() {
|
||||
let headers = headers(&[]);
|
||||
|
||||
@@ -757,6 +757,25 @@ fn classifies_public_catalog_health_models_as_public_support_route() {
|
||||
assert!(!decision.is_execution_runtime_candidate());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn classifies_public_catalog_health_related_as_public_support_route() {
|
||||
let headers = headers(&[]);
|
||||
let uri: Uri = "/api/public/health/related?dimension=endpoint&value=openai%3Achat"
|
||||
.parse()
|
||||
.expect("uri should parse");
|
||||
let decision =
|
||||
classify_control_route(&http::Method::GET, &uri, &headers).expect("route should classify");
|
||||
|
||||
assert_eq!(decision.route_class.as_deref(), Some("public_support"));
|
||||
assert_eq!(decision.route_family.as_deref(), Some("public_catalog"));
|
||||
assert_eq!(decision.route_kind.as_deref(), Some("health_related"));
|
||||
assert_eq!(
|
||||
decision.auth_endpoint_signature.as_deref(),
|
||||
Some("public:catalog")
|
||||
);
|
||||
assert!(!decision.is_execution_runtime_candidate());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn classifies_auth_registration_settings_as_public_support_route() {
|
||||
let headers = headers(&[]);
|
||||
|
||||
Reference in New Issue
Block a user