fix(portal): hide technical terms in executive demo view

This commit is contained in:
igor04091968
2026-06-04 22:52:03 +03:00
parent 88dcd8ecaa
commit 2cb1afad4f
3 changed files with 53 additions and 3 deletions
+26 -1
View File
@@ -2549,6 +2549,19 @@ fn security_events_summary_text(summary: &SecurityEventsSummary) -> String {
)
}
fn security_events_executive_text(summary: &SecurityEventsSummary) -> String {
if summary.backend == "disabled" || summary.status == "disabled" {
return "Источник событий безопасности отключён.".to_string();
}
if summary.fallback_used {
return "События безопасности временно недоступны.".to_string();
}
format!(
"События безопасности доступны: событий за 24 часа {}.",
summary.events_24h
)
}
fn security_events_block(summary: &SecurityEventsSummary) -> SummaryBlock {
SummaryBlock {
status: security_events_summary_status(summary),
@@ -2844,7 +2857,7 @@ fn build_reports(
));
executive_points.push(format!(
"События безопасности за 24 часа: {}",
security_events_summary_text(&security_events_summary)
security_events_executive_text(&security_events_summary)
));
executive_points.extend([
format!("Сбор данных: {}. {}", collection.status, collection.text),
@@ -10174,6 +10187,15 @@ mod tests {
error: None,
};
assert!(security_events_summary_text(&available).contains("События безопасности доступны"));
assert_eq!(
security_events_executive_text(&disabled),
"Источник событий безопасности отключён."
);
assert_eq!(
security_events_executive_text(&fallback),
"События безопасности временно недоступны."
);
assert!(!security_events_executive_text(&disabled).contains("ClickHouse"));
}
#[test]
@@ -10733,6 +10755,9 @@ mod tests {
.unwrap()
.contains("Статус связанной картины риска"))
);
let executive_points_text = report["executive_points"].to_string();
assert!(!executive_points_text.contains("ClickHouse"));
assert!(!executive_points_text.contains("SECURITY_EVENTS_BACKEND"));
assert!(
report["markdown"]
.as_str()
@@ -2174,7 +2174,7 @@ function renderSecurityEventsSummary(summary, options = {}) {
: fallback
? "События безопасности временно недоступны"
: "События безопасности доступны";
const localModeText = disabled ? "Используется локальный режим без ClickHouse" : "";
const localModeText = disabled ? "Локальный режим" : "";
const title = options.compact
? "События безопасности"
: "События безопасности за 24 часа";