@page "/admin/sessions" @rendermode @(Microsoft.AspNetCore.Components.Web.RenderMode.InteractiveServer) @attribute [Authorize(Policy = TrafagSalesExporter.Security.SecurityPolicies.AdminOnly)] @using TrafagSalesExporter.Services @inject IAccessSessionTracker SessionTracker @inject IAdminAccessService AdminAccess @inject ILandingPageSettingsService LandingSettings @inject IUiTextService UiText @T("Aktive Logins", "Active logins") @T("Aktive Logins", "Active logins") @if (!AdminAccess.IsUnlocked) { } else {
@T("Startseite", "Landing page") @T("Optionale Animation unter dem Willkommens-Text.", "Optional animation below the welcome text.")
@T("HR-/Finance-Cockpit Sessions", "HR/Finance cockpit sessions") @T("Gezählt werden App-interne Entsperrungen seit dem letzten App-Start.", "Counts app-internal unlocks since the last app start.")
@T("Admin sperren", "Lock admin") @T("Aktualisieren", "Refresh")
@T("Bereich", "Area") @T("Name", "Name") @T("IP-Adresse", "IP address") @T("Entsperrt seit", "Unlocked since") @T("Zuletzt gesehen", "Last seen") @context.Area @context.Username @context.RemoteAddress @FormatDate(context.StartedAt) @FormatDate(context.LastSeenAt) @T("Keine aktiven HR-/Finance-Logins erfasst.", "No active HR/Finance logins recorded.")
@T("Hinweis: HR und Finance verwenden gemeinsame App-Logins. Diese Seite zeigt daher den verwendeten Login-Namen und die Session, nicht zwingend die echte Person.", "Note: HR and Finance use shared app logins. This page therefore shows the used login name and session, not necessarily the real person.") } @code { private IReadOnlyList _sessions = []; protected override void OnInitialized() { Refresh(); } private void Refresh() { _sessions = SessionTracker.GetActiveSessions(); } private void LockAdmin() { AdminAccess.Lock(); _sessions = []; } private void SetWalkingFigure(bool value) { LandingSettings.SetShowWalkingLabFigure(value); } private static string FormatDate(DateTimeOffset value) => value.ToString("dd.MM.yyyy HH:mm:ss"); private string T(string german, string english) => UiText.Text(german, english); }