namespace ZB.MOM.WW.MxGateway.Server.Configuration; public sealed class DashboardOptions { /// Gets whether the dashboard is enabled. public bool Enabled { get; init; } = true; /// Gets whether anonymous localhost access to dashboard is allowed. public bool AllowAnonymousLocalhost { get; init; } = true; /// /// When true (default), the dashboard auth cookie is restricted to HTTPS /// requests via . /// Set to false for plain-HTTP dev deployments — the cookie then uses /// , /// which still marks it Secure on any HTTPS request but allows it to /// round-trip over HTTP. Browsers silently drop Secure cookies set over /// plain HTTP from non-localhost hosts, so leaving this true breaks /// dashboard login from a remote browser unless the dashboard is served /// over HTTPS. /// public bool RequireHttpsCookie { get; init; } = true; /// /// Dashboard auth cookie name. When null/blank (the default) the canonical /// /// is used. Override it (MxGateway:Dashboard:CookieName) to give a distinct name to a /// gateway that shares a hostname with another gateway instance — browser cookies are scoped /// by host+path but NOT by port, so two instances on the same host would otherwise clobber /// each other's dashboard session under a shared cookie name. Changing this signs out /// existing dashboard sessions on next deploy. /// public string? CookieName { get; init; } /// Gets the dashboard snapshot update interval in milliseconds. public int SnapshotIntervalMilliseconds { get; init; } = 1_000; /// Gets the maximum number of recent faults to display. public int RecentFaultLimit { get; init; } = 100; /// Gets the maximum number of recent sessions to display. public int RecentSessionLimit { get; init; } = 200; /// Gets whether to show full tag values in the dashboard. public bool ShowTagValues { get; init; } /// /// LDAP group → dashboard role mapping. Values must be one of /// or . /// Users with no matching group are rejected at login. /// public Dictionary GroupToRole { get; init; } = new(StringComparer.OrdinalIgnoreCase); }