diff --git a/adk-rust/crates/detmir-portal/src/main.rs b/adk-rust/crates/detmir-portal/src/main.rs index b33ce2b..8ae90f9 100644 --- a/adk-rust/crates/detmir-portal/src/main.rs +++ b/adk-rust/crates/detmir-portal/src/main.rs @@ -32,6 +32,7 @@ mod readiness_api; mod risk_narrative; mod role_access; mod snapshot_cache; +mod static_assets; mod workforce_kpi_explain; use api_contracts::api_contract_summary; @@ -57,14 +58,11 @@ use role_access::{portal_role_from_request, respond_forbidden, role_envelope}; use snapshot_cache::{ SnapshotCache, build_fast_health, cached_snapshot, clone_snapshot_cache, new_snapshot_cache, }; +use static_assets::{ + API_CONTRACT_OPENAPI, API_CONTRACT_TYPESCRIPT, APP_CSS, APP_JS, ARCHITECTURE_HTML, INDEX_HTML, +}; use workforce_kpi_explain::{KpiExplainQuery, build_workforce_kpi_explain}; -const INDEX_HTML: &str = include_str!("static/index.html"); -const ARCHITECTURE_HTML: &str = include_str!("static/architecture.html"); -const APP_CSS: &str = include_str!("static/app.css"); -const APP_JS: &str = include_str!("static/app.js"); -const API_CONTRACT_OPENAPI: &str = include_str!("contracts/openapi.json"); -const API_CONTRACT_TYPESCRIPT: &str = include_str!("contracts/typescript.d.ts"); const UEBA_BASELINE_MIN_SAMPLES: usize = 3; const DEFAULT_DEPARTMENT_LABEL: &str = "Не привязано к подразделению"; const LEGACY_UNASSIGNED_DEPARTMENT_LABEL: &str = "Без подразделения"; diff --git a/adk-rust/crates/detmir-portal/src/static_assets.rs b/adk-rust/crates/detmir-portal/src/static_assets.rs new file mode 100644 index 0000000..82f7bd9 --- /dev/null +++ b/adk-rust/crates/detmir-portal/src/static_assets.rs @@ -0,0 +1,11 @@ +//! Static portal assets and generated API contract text. +//! +//! CONTRACT: this module only exposes embedded static files. Do not change +//! file contents, MIME handling, routes or API contracts from here. + +pub(crate) const INDEX_HTML: &str = include_str!("static/index.html"); +pub(crate) const ARCHITECTURE_HTML: &str = include_str!("static/architecture.html"); +pub(crate) const APP_CSS: &str = include_str!("static/app.css"); +pub(crate) const APP_JS: &str = include_str!("static/app.js"); +pub(crate) const API_CONTRACT_OPENAPI: &str = include_str!("contracts/openapi.json"); +pub(crate) const API_CONTRACT_TYPESCRIPT: &str = include_str!("contracts/typescript.d.ts");