feat: Aufbewahrung der Ereignisse einstellbar (90 Tage), Audit-Standard 365 Tage (#1225)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-26 14:48:15 +01:00
parent 8c970d3ee1
commit 4b89dc5e0d
9 changed files with 35 additions and 18 deletions

View File

@ -63,12 +63,12 @@ pub struct Aufbewahrung {
}
impl Aufbewahrung {
/// Heutige Werte: Anfragen, Audit und Messwerte aus der Konfiguration, Ereignisse und Warnungen fest im Code.
/// Anfragen, Audit, Ereignisse und Messwerte aus der Konfiguration, beendete Warnungen fest im Code.
pub fn aus(config: &nexus_core::Config) -> Self {
Self {
anfragen: config.log_retention_days,
audit: config.audit_retention_days,
ereignisse: nexus_store::AUFBEWAHRUNG_TAGE,
ereignisse: config.event_retention_days,
warnungen: nexus_store::WARNUNG_AUFBEWAHRUNG_TAGE,
messwerte_roh: config.metrics_retention_days,
rollup5: config.metrics_rollup5_days,

View File

@ -415,9 +415,14 @@ fn ereignisse_seite(
"<section class=\"card\"><div class=\"breit\"><table data-filtern=\"ereignisse\" data-nur-sortieren><thead><tr><th data-spalte=\"zeit\">Zeit</th><th data-spalte=\"art\">Art</th><th data-spalte=\"modell\">Modell</th><th data-spalte=\"engine\">Engine</th><th data-spalte=\"ergebnis\">Ergebnis</th><th data-spalte=\"korrelation\">Korrelation</th><th>Detail</th></tr></thead><tbody>{zeilen}</tbody></table></div></section>"
)
};
let aufbewahrung = match state.system.get().map(|s| s.aufbewahrung.ereignisse) {
Some(0) => "unbegrenzt".to_string(),
Some(n) => format!("{n} Tage"),
None => "nicht bekannt".to_string(),
};
let body = format!(
"{}<form method=\"get\" action=\"/ui/protokoll\" class=\"zeile\" data-auto><input type=\"hidden\" name=\"reiter\" value=\"ereignisse\"><label>Zeitraum <select name=\"zeit\">{periods}</select></label><button>Anzeigen</button></form>\
<p>Höchstens 500 Ereignisse, neueste zuerst. Die Aufbewahrung beträgt 35 Tage.</p>{inhalt}",
<p>Höchstens 500 Ereignisse, neueste zuerst. Die Aufbewahrung beträgt {aufbewahrung}.</p>{inhalt}",
reiter_leiste(user, "ereignisse")
);
html(

View File

@ -51,7 +51,11 @@ fn aufbewahrung_karte(state: &AppState) -> String {
a.audit,
"Konfiguration <code>audit_retention_days</code>",
),
("Ereignisse", a.ereignisse, "fest im Code"),
(
"Ereignisse",
a.ereignisse,
"Konfiguration <code>event_retention_days</code>",
),
("Beendete Warnungen", a.warnungen, "fest im Code"),
(
"Messwerte, roh",