commit 16de87d127a37fe3d0d62756686b2ecc4df61ebf
parent a5b3bde50d2fcbce9cf3fed4214f44d2bd5fba22
Author: finwo <finwo@pm.me>
Date: Sat, 7 Nov 2026 01:43:39 +0100
Added realm host and email-domain mockups
Diffstat:
5 files changed, 2265 insertions(+), 25 deletions(-)
diff --git a/mockup/plain/admin-realm-email-domains.html b/mockup/plain/admin-realm-email-domains.html
@@ -0,0 +1,1151 @@
+<!doctype html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
+ <title>Admin realm email domains mockup</title>
+ <link rel="stylesheet" href="./global.css" />
+ <link rel="stylesheet" href="./select-menu.css" />
+ <style>
+ .domain-name {
+ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
+ font-size: 0.8125rem;
+ overflow-wrap: anywhere;
+ }
+
+ .domain-status {
+ display: inline-flex;
+ align-items: center;
+ gap: 0.4rem;
+ color: var(--muted);
+ font-size: 0.8125rem;
+ }
+
+ .domain-status-dot {
+ width: 0.4375rem;
+ height: 0.4375rem;
+ flex: none;
+ border-radius: 50%;
+ background: var(--muted);
+ }
+
+ .domain-status.is-pending {
+ color: var(--warn);
+ }
+
+ .domain-status.is-pending .domain-status-dot {
+ background: var(--warn);
+ }
+
+ .domain-added {
+ color: var(--muted);
+ font-size: 0.8125rem;
+ }
+
+ .domain-row-action {
+ display: flex;
+ align-items: center;
+ flex-wrap: wrap;
+ gap: 0.125rem;
+ }
+
+ .action-button {
+ display: inline-flex;
+ align-items: center;
+ min-height: 2rem;
+ padding: 0.25rem 0.625rem;
+ border: 0;
+ border-radius: 0.25rem;
+ background: transparent;
+ color: var(--muted);
+ font: inherit;
+ font-size: 0.8125rem;
+ font-weight: 500;
+ line-height: 1.4;
+ white-space: nowrap;
+ cursor: pointer;
+ }
+
+ .action-button:hover {
+ background: var(--row-hover);
+ color: var(--text);
+ }
+
+ .action-button:first-child {
+ margin-left: -0.625rem;
+ }
+
+ .action-button.is-primary {
+ color: var(--accent-text);
+ }
+
+ .action-button.is-primary:hover {
+ background: color-mix(in srgb, var(--accent) 12%, transparent);
+ color: var(--accent-text-hover);
+ }
+
+ .action-button.is-danger {
+ color: var(--danger-text);
+ }
+
+ .action-button.is-danger:hover {
+ background: color-mix(in srgb, var(--danger) 12%, transparent);
+ color: var(--danger-text);
+ }
+
+ .verify-record-name,
+ .verify-record-value {
+ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
+ font-size: 0.8125rem;
+ }
+
+ .verify-copy-row {
+ display: flex;
+ justify-content: flex-end;
+ margin-top: 0.5rem;
+ }
+
+ .empty {
+ padding: 2rem;
+ color: var(--muted);
+ font-size: 0.875rem;
+ }
+
+ .empty p {
+ margin: 0;
+ }
+
+ .state-preview {
+ margin-top: 2rem;
+ }
+
+ .state-preview > h2 {
+ margin-bottom: 0.75rem;
+ }
+
+ @media (max-width: 39.999em) {
+ .mockup-controls {
+ flex-direction: column;
+ align-items: flex-start;
+ width: min(18rem, calc(100vw - 2rem));
+ }
+
+ .mockup-separator {
+ display: none;
+ }
+
+ .table-actions {
+ width: 100%;
+ flex-direction: column;
+ align-items: stretch;
+ }
+
+ .table-actions .button {
+ width: 100%;
+ }
+ }
+
+ @media (min-width: 40em) {
+ .domain-table {
+ table-layout: fixed;
+ }
+
+ .domain-table .domain-status-column {
+ width: 12rem;
+ }
+
+ .domain-table .domain-action-column {
+ width: 14rem;
+ }
+
+ .domain-table td.domain-action-column {
+ padding-bottom: 0.75rem;
+ }
+
+ .domain-row-action {
+ flex-wrap: nowrap;
+ justify-content: flex-start;
+ }
+ }
+ </style>
+ </head>
+ <body>
+ <header class="topbar">
+ <a class="brand" href="./admin-dashboard.html">
+ <svg class="brand-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
+ <path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z" />
+ </svg>
+ <span class="brand-name">Auth</span>
+ </a>
+ <div class="topbar-actions">
+ <button class="mobile-nav-toggle" type="button" id="mobile-nav-toggle" aria-controls="mobile-navigation" aria-expanded="false" aria-label="Open navigation">
+ <span class="mobile-nav-toggle-bars" aria-hidden="true"></span>
+ </button>
+ <details class="user-menu">
+ <summary aria-label="Account menu">
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
+ <circle cx="12" cy="12" r="10" />
+ <circle cx="12" cy="10" r="3" />
+ <path d="M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662" />
+ </svg>
+ </summary>
+ <div class="user-panel">
+ <div class="user-summary">
+ <span class="user-name">System Admin</span>
+ <span class="user-meta">admin@system.test</span>
+ </div>
+ <div class="user-menu-list">
+ <a class="user-menu-item" href="#">
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
+ <path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1-1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z" />
+ <circle cx="12" cy="12" r="3" />
+ </svg>
+ <span>Account settings</span>
+ </a>
+ <button class="user-menu-item" type="button" data-user-theme>
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
+ <circle cx="12" cy="12" r="4" />
+ <path d="M12 2v2" />
+ <path d="M12 20v2" />
+ <path d="m4.93 4.93 1.41 1.41" />
+ <path d="m17.66 17.66 1.41 1.41" />
+ <path d="M2 12h2" />
+ <path d="M20 12h2" />
+ <path d="m6.34 17.66-1.41 1.41" />
+ <path d="m19.07 4.93-1.41 1.41" />
+ </svg>
+ <span>Theme</span>
+ <span class="user-menu-value" data-user-theme-value>Auto</span>
+ </button>
+ <a class="user-menu-item" href="#">
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
+ <path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" />
+ <path d="m16 17 5-5-5-5" />
+ <path d="M21 12H9" />
+ </svg>
+ <span>Sign out</span>
+ </a>
+ </div>
+ </div>
+ </details>
+ </div>
+ </header>
+
+ <div class="mobile-nav" id="mobile-navigation" aria-hidden="true">
+ <nav class="nav" aria-label="Administration">
+ <p class="nav-label">Administration</p>
+ <a class="nav-item" href="./admin-dashboard.html">
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
+ <rect x="3" y="3" width="7" height="7" />
+ <rect x="14" y="3" width="7" height="7" />
+ <rect x="3" y="14" width="7" height="7" />
+ <rect x="14" y="14" width="7" height="7" />
+ </svg>
+ <span>Overview</span>
+ </a>
+ <a class="nav-item is-active" data-realm-nav href="./admin-realms.html">
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
+ <path d="M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z" />
+ <path d="M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2" />
+ <path d="M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2" />
+ <path d="M10 6h4" />
+ <path d="M10 10h4" />
+ <path d="M10 14h4" />
+ <path d="M10 18h4" />
+ </svg>
+ <span data-realm-nav-label>Realms</span>
+ </a>
+ <a class="nav-item" href="./admin-clients.html">
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
+ <rect x="2" y="4" width="20" height="16" rx="2" />
+ <path d="M10 4v4" />
+ <path d="M2 8h20" />
+ <path d="M6 4v4" />
+ </svg>
+ <span>Clients</span>
+ </a>
+ <a class="nav-item" href="#">
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
+ <path d="M22 12h-4l-3 8-6-16-3 8H2" />
+ </svg>
+ <span>Sessions</span>
+ </a>
+ <a class="nav-item" href="./admin-users.html">
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
+ <path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" />
+ <circle cx="12" cy="7" r="4" />
+ </svg>
+ <span>Users</span>
+ </a>
+ <a class="nav-item" data-settings-nav href="./admin-system-settings.html">
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
+ <path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1-1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z" />
+ <circle cx="12" cy="12" r="3" />
+ </svg>
+ <span>Settings</span>
+ </a>
+ </nav>
+ <div class="mobile-nav-divider" aria-hidden="true"></div>
+ <section class="mobile-nav-account" aria-label="Account">
+ <div class="user-summary">
+ <span class="user-name">System Admin</span>
+ <span class="user-meta">admin@system.test</span>
+ </div>
+ <div class="user-menu-list">
+ <a class="user-menu-item" href="#">
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
+ <path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1-1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z" />
+ <circle cx="12" cy="12" r="3" />
+ </svg>
+ <span>Account settings</span>
+ </a>
+ <button class="user-menu-item" type="button" data-user-theme>
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
+ <circle cx="12" cy="12" r="4" />
+ <path d="M12 2v2" />
+ <path d="M12 20v2" />
+ <path d="m4.93 4.93 1.41 1.41" />
+ <path d="m17.66 17.66 1.41 1.41" />
+ <path d="M2 12h2" />
+ <path d="M20 12h2" />
+ <path d="m6.34 17.66-1.41 1.41" />
+ <path d="m19.07 4.93-1.41 1.41" />
+ </svg>
+ <span>Theme</span>
+ <span class="user-menu-value" data-user-theme-value>Auto</span>
+ </button>
+ <a class="user-menu-item" href="#">
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
+ <path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" />
+ <path d="m16 17 5-5-5-5" />
+ <path d="M21 12H9" />
+ </svg>
+ <span>Sign out</span>
+ </a>
+ </div>
+ </section>
+ </div>
+
+ <div class="app">
+ <aside class="sidebar">
+ <nav class="nav" aria-label="Administration">
+ <p class="nav-label">Administration</p>
+ <a class="nav-item" href="./admin-dashboard.html">
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
+ <rect x="3" y="3" width="7" height="7" />
+ <rect x="14" y="3" width="7" height="7" />
+ <rect x="3" y="14" width="7" height="7" />
+ <rect x="14" y="14" width="7" height="7" />
+ </svg>
+ <span>Overview</span>
+ </a>
+ <a class="nav-item is-active" data-realm-nav href="./admin-realms.html">
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
+ <path d="M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z" />
+ <path d="M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2" />
+ <path d="M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2" />
+ <path d="M10 6h4" />
+ <path d="M10 10h4" />
+ <path d="M10 14h4" />
+ <path d="M10 18h4" />
+ </svg>
+ <span data-realm-nav-label>Realms</span>
+ </a>
+ <a class="nav-item" href="./admin-clients.html">
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
+ <rect x="2" y="4" width="20" height="16" rx="2" />
+ <path d="M10 4v4" />
+ <path d="M2 8h20" />
+ <path d="M6 4v4" />
+ </svg>
+ <span>Clients</span>
+ </a>
+ <a class="nav-item" href="#">
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
+ <path d="M22 12h-4l-3 8-6-16-3 8H2" />
+ </svg>
+ <span>Sessions</span>
+ </a>
+ <a class="nav-item" href="./admin-users.html">
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
+ <path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" />
+ <circle cx="12" cy="7" r="4" />
+ </svg>
+ <span>Users</span>
+ </a>
+ <a class="nav-item" data-settings-nav href="./admin-system-settings.html">
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
+ <path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1-1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z" />
+ <circle cx="12" cy="12" r="3" />
+ </svg>
+ <span>Settings</span>
+ </a>
+ </nav>
+ </aside>
+
+ <div class="main">
+ <main class="content">
+ <div class="page-header page-header-row">
+ <div>
+ <div class="client-breadcrumb">
+ <a id="domains-breadcrumb-root" href="./admin-realms.html"><span data-realm-breadcrumb-root>Realms</span></a>
+ <span>/</span>
+ <a id="domains-breadcrumb-realm" href="./admin-settings.html?realm=acme">Acme</a>
+ <span>/</span>
+ <span aria-current="page">Email domains</span>
+ </div>
+ <h1>Email domains</h1>
+ <p>Domains used to assign new accounts to this realm.</p>
+ </div>
+ <div class="realm-select">
+ <span id="domains-realm-label">Realm</span>
+ <div class="select" id="domains-realm-select" data-select data-value="acme">
+ <button
+ class="select-trigger"
+ type="button"
+ id="domains-realm-trigger"
+ role="combobox"
+ aria-haspopup="listbox"
+ aria-expanded="false"
+ aria-controls="domains-realm-listbox"
+ aria-labelledby="domains-realm-label"
+ >
+ <span class="select-value">Acme</span>
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
+ <path d="m6 9 6 6 6-6" />
+ </svg>
+ </button>
+ <div class="select-list" id="domains-realm-listbox" role="listbox" aria-labelledby="domains-realm-label" hidden>
+ <div class="select-option is-selected" id="domains-realm-acme" role="option" aria-selected="true" data-value="acme" data-label="Acme">
+ <span class="select-option-mark" aria-hidden="true">
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
+ <path d="M20 6 9 17l-5-5" />
+ </svg>
+ </span>
+ <span class="select-option-label">Acme</span>
+ </div>
+ <div class="select-option" id="domains-realm-globex" role="option" aria-selected="false" data-value="globex" data-label="Globex">
+ <span class="select-option-mark" aria-hidden="true">
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
+ <path d="M20 6 9 17l-5-5" />
+ </svg>
+ </span>
+ <span class="select-option-label">Globex</span>
+ </div>
+ <div class="select-option" id="domains-realm-northwind" role="option" aria-selected="false" data-value="northwind" data-label="Northwind">
+ <span class="select-option-mark" aria-hidden="true">
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
+ <path d="M20 6 9 17l-5-5" />
+ </svg>
+ </span>
+ <span class="select-option-label">Northwind</span>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <div id="domains-notice" class="notice" role="status" hidden></div>
+
+ <section class="table-panel" aria-labelledby="domains-table-title">
+ <h2 id="domains-table-title" class="sr-only">Realm email domains</h2>
+ <div class="table-toolbar">
+ <div class="table-search">
+ <input id="domains-search" type="search" aria-label="Search email domains" placeholder="Search email domains" />
+ </div>
+ <div class="table-actions">
+ <button id="domains-add-button" class="button" type="button">Add email domain</button>
+ </div>
+ </div>
+
+ <div class="data-table-wrap">
+ <table class="data-table data-table-static domain-table">
+ <thead>
+ <tr>
+ <th class="data-table-primary domain-name-column" scope="col">Domain</th>
+ <th class="domain-status-column" scope="col">Status</th>
+ <th class="domain-action-column" scope="col">Actions</th>
+ </tr>
+ </thead>
+ <tbody id="domains-rows"></tbody>
+ </table>
+ <div id="domains-search-empty" class="empty" hidden>
+ <p>No email domains match this search.</p>
+ </div>
+ <div id="domains-realm-empty" class="empty" hidden>
+ <p>No email domains are assigned to this realm.</p>
+ </div>
+ </div>
+ </section>
+
+ <section class="state-preview">
+ <h2>Loading state</h2>
+ <div class="panel" aria-busy="true">
+ <div class="skeleton skeleton-title"></div>
+ <div class="skeleton"></div>
+ <div class="skeleton skeleton-short"></div>
+ </div>
+ </section>
+ </main>
+ </div>
+ </div>
+
+ <div id="domains-create-dialog" class="modal-overlay" hidden>
+ <form id="domains-create-form" class="modal" role="dialog" aria-modal="true" aria-labelledby="domains-create-title" novalidate>
+ <div class="modal-header">
+ <h2 id="domains-create-title">Add email domain</h2>
+ <button class="modal-close" type="button" aria-label="Close dialog" data-dialog-close>
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
+ <path d="M18 6 6 18" />
+ <path d="m6 6 12 12" />
+ </svg>
+ </button>
+ </div>
+ <div class="modal-body">
+ <div id="domains-create-alert" class="alert" role="alert" hidden></div>
+
+ <label class="form-field" for="domains-domain-input">
+ <span class="field-label">Email domain</span>
+ <input id="domains-domain-input" class="field-control" type="text" maxlength="253" placeholder="acme.test" autocomplete="off" spellcheck="false" />
+ </label>
+ <p class="modal-note">Enter the domain without @ or a protocol. New accounts matching this domain are assigned to the realm once the domain is verified.</p>
+
+ <div class="modal-actions">
+ <button class="button-secondary" type="button" data-dialog-close>Cancel</button>
+ <button class="button" type="submit">Add domain</button>
+ </div>
+ </div>
+ </form>
+ </div>
+
+ <div id="domains-verify-dialog" class="modal-overlay" hidden>
+ <div class="modal" role="dialog" aria-modal="true" aria-labelledby="domains-verify-title">
+ <div class="modal-header">
+ <h2 id="domains-verify-title">Verify email domain</h2>
+ <button class="modal-close" type="button" aria-label="Close dialog" data-dialog-close>
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
+ <path d="M18 6 6 18" />
+ <path d="m6 6 12 12" />
+ </svg>
+ </button>
+ </div>
+ <div class="modal-body">
+ <p id="domains-verify-message" class="modal-note"></p>
+
+ <div class="form-field">
+ <span class="field-label" id="domains-verify-name-label">TXT record name</span>
+ <input id="domains-verify-name" class="field-control verify-record-name" type="text" readonly aria-labelledby="domains-verify-name-label" />
+ </div>
+
+ <div class="form-field">
+ <span class="field-label" id="domains-verify-value-label">TXT record value</span>
+ <input id="domains-verify-value" class="field-control verify-record-value" type="text" readonly aria-labelledby="domains-verify-value-label" />
+ <div class="verify-copy-row">
+ <button id="domains-verify-copy" class="button-secondary" type="button">Copy value</button>
+ </div>
+ </div>
+
+ <p class="modal-note">Automated DNS checking arrives in a later slice; mark the domain verified once the record is in place.</p>
+
+ <div class="modal-actions">
+ <button class="button-secondary" type="button" data-dialog-close>Close</button>
+ <button id="domains-verify-mark" class="button" type="button">Mark as verified</button>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <div id="domains-remove-dialog" class="modal-overlay" hidden>
+ <div class="modal" role="dialog" aria-modal="true" aria-labelledby="domains-remove-title">
+ <div class="modal-header">
+ <h2 id="domains-remove-title">Remove email domain</h2>
+ <button class="modal-close" type="button" aria-label="Close dialog" data-dialog-close>
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
+ <path d="M18 6 6 18" />
+ <path d="m6 6 12 12" />
+ </svg>
+ </button>
+ </div>
+ <div class="modal-body">
+ <p id="domains-remove-message" class="modal-note"></p>
+ <label class="form-field" for="domains-remove-confirm">
+ <span class="field-label">Confirm domain</span>
+ <input id="domains-remove-confirm" class="field-control" type="text" maxlength="253" autocomplete="off" spellcheck="false" />
+ </label>
+ <p class="modal-note">Type the domain exactly to confirm.</p>
+ <div class="modal-actions">
+ <button class="button-secondary" type="button" data-dialog-close>Cancel</button>
+ <button id="domains-remove-confirm-button" class="button-danger" type="button" disabled>Remove domain</button>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <div class="mockup-controls" aria-label="Mockup controls">
+ <span class="mockup-label">Mockup</span>
+ <button class="mockup-button is-active" type="button" data-theme-target="auto">Auto</button>
+ <button class="mockup-button" type="button" data-theme-target="light">Light</button>
+ <button class="mockup-button" type="button" data-theme-target="dark">Dark</button>
+ <span class="mockup-separator" aria-hidden="true"></span>
+ <span class="mockup-label">View as</span>
+ <button class="mockup-button is-active" type="button" data-role-target="system" aria-pressed="true">System admin</button>
+ <button class="mockup-button" type="button" data-role-target="owner" aria-pressed="false">Realm owner</button>
+ <button class="mockup-button" type="button" data-role-target="admin" aria-pressed="false">Realm admin</button>
+ </div>
+
+ <script>
+ const root = document.documentElement;
+ const themeButtons = document.querySelectorAll('[data-theme-target]');
+ const userThemeButtons = document.querySelectorAll('[data-user-theme]');
+ const userThemeValues = document.querySelectorAll('[data-user-theme-value]');
+ let currentTheme = 'auto';
+
+ function setTheme(value) {
+ currentTheme = value;
+ if (value === 'auto') {
+ root.removeAttribute('data-theme');
+ } else {
+ root.setAttribute('data-theme', value);
+ }
+
+ themeButtons.forEach((button) => {
+ button.classList.toggle('is-active', button.dataset.themeTarget === value);
+ });
+ userThemeValues.forEach((element) => {
+ element.textContent = value.charAt(0).toUpperCase() + value.slice(1);
+ });
+
+ if (typeof syncUrl === 'function') syncUrl();
+ if (typeof syncRealmLinks === 'function') syncRealmLinks();
+ }
+
+ themeButtons.forEach((button) => {
+ button.addEventListener('click', () => setTheme(button.dataset.themeTarget));
+ });
+
+ userThemeButtons.forEach((button) => {
+ button.addEventListener('click', () => {
+ const themes = ['auto', 'light', 'dark'];
+ setTheme(themes[(themes.indexOf(currentTheme) + 1) % themes.length]);
+ });
+ });
+
+ const userMenu = document.querySelector('.user-menu');
+ document.addEventListener('click', (event) => {
+ if (userMenu && userMenu.open && !userMenu.contains(event.target)) {
+ userMenu.open = false;
+ }
+ });
+
+ document.querySelectorAll('[data-dialog-close]').forEach((button) => {
+ button.addEventListener('click', () => {
+ button.closest('.modal-overlay').hidden = true;
+ });
+ });
+
+ document.querySelectorAll('.modal-overlay').forEach((overlay) => {
+ overlay.addEventListener('mousedown', (event) => {
+ if (event.target === overlay) overlay.hidden = true;
+ });
+ });
+
+ document.addEventListener('keydown', (event) => {
+ if (event.key === 'Escape') {
+ document.querySelectorAll('.modal-overlay:not([hidden])').forEach((dialog) => {
+ dialog.hidden = true;
+ });
+ }
+ });
+
+ const identities = {
+ system: { name: 'System Admin', email: 'admin@system.test' },
+ owner: { name: 'Realm Owner', email: 'owner@acme.test' },
+ admin: { name: 'Realm Admin', email: 'realm-admin@managed.test' },
+ };
+
+ const realmInfo = {
+ acme: { label: 'Acme', roles: ['system', 'owner'] },
+ globex: { label: 'Globex', roles: ['system', 'admin'] },
+ northwind: { label: 'Northwind', roles: ['system'] },
+ };
+ const realmOrder = ['acme', 'globex', 'northwind'];
+
+ const domains = {
+ acme: [
+ { domain: 'acme.test', status: 'verified', added: '12 Mar 2026' },
+ { domain: 'sso.acme.test', status: 'verified', added: '12 Mar 2026' },
+ { domain: 'employees.acme.test', status: 'pending', token: '6lPq3nJ2mVxT0sYc1BdKeR8w', added: '05 Nov 2026' },
+ ],
+ globex: [{ domain: 'globex.test', status: 'verified', added: '04 Feb 2026' }],
+ northwind: [],
+ };
+
+ const domainAssignments = {
+ 'acme.test': { realm: 'acme' },
+ 'sso.acme.test': { realm: 'acme' },
+ 'employees.acme.test': { realm: 'acme' },
+ 'globex.test': { realm: 'globex' },
+ };
+
+ const currentRole = { value: 'system' };
+ let currentRealm = 'acme';
+
+ const roleButtons = document.querySelectorAll('[data-role-target]');
+ const realmNavLinks = document.querySelectorAll('[data-realm-nav]');
+ const realmNavLabels = document.querySelectorAll('[data-realm-nav-label]');
+ const settingsNavLinks = document.querySelectorAll('[data-settings-nav]');
+ const breadcrumbRootLink = document.getElementById('domains-breadcrumb-root');
+ const breadcrumbRealmLink = document.getElementById('domains-breadcrumb-realm');
+ const breadcrumbRootLabels = document.querySelectorAll('[data-realm-breadcrumb-root]');
+
+ const realmSelect = document.getElementById('domains-realm-select');
+ const realmSelectValue = realmSelect.querySelector('.select-value');
+ const realmSelectOptions = [...realmSelect.querySelectorAll('.select-option')];
+
+ const notice = document.getElementById('domains-notice');
+ const searchInput = document.getElementById('domains-search');
+ const searchEmpty = document.getElementById('domains-search-empty');
+ const realmEmpty = document.getElementById('domains-realm-empty');
+ const domainRows = document.getElementById('domains-rows');
+ const addButton = document.getElementById('domains-add-button');
+
+ function accessibleRealms() {
+ return realmOrder.filter((slug) => realmInfo[slug].roles.includes(currentRole.value));
+ }
+
+ function domainRowList() {
+ return [...domainRows.querySelectorAll('.domain-row')];
+ }
+
+ function showNotice(message) {
+ notice.textContent = message;
+ notice.hidden = false;
+ }
+
+ function escapeHtml(value) {
+ return String(value).replace(/[&<>"']/g, (character) => {
+ const entities = { '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' };
+ return entities[character];
+ });
+ }
+
+ function statusText(status) {
+ return status === 'verified' ? 'Verified' : 'Pending verification';
+ }
+
+ function domainRowElement(entry) {
+ const row = document.createElement('tr');
+ row.className = 'domain-row';
+ row.dataset.search = entry.domain.toLowerCase();
+ row.dataset.status = entry.status;
+
+ const verifyButton =
+ entry.status === 'pending'
+ ? `<button class="action-button is-primary" type="button" data-verify-domain="${escapeHtml(entry.domain)}">Verify</button>`
+ : '';
+
+ const isPending = entry.status === 'pending';
+
+ row.innerHTML = `
+ <td class="data-table-primary domain-name-column" data-label="Domain">
+ <span class="domain-name">${escapeHtml(entry.domain)}</span>
+ </td>
+ <td class="domain-status-column" data-label="Status">
+ <span class="domain-status${isPending ? ' is-pending' : ''}"><span class="domain-status-dot" aria-hidden="true"></span>${statusText(entry.status)}</span>
+ </td>
+ <td class="domain-action-column" data-label="Actions">
+ <div class="domain-row-action">
+ ${verifyButton}
+ <button class="action-button is-danger" type="button" data-remove-domain="${escapeHtml(entry.domain)}">Remove</button>
+ </div>
+ </td>`;
+ return row;
+ }
+
+ function renderDomains() {
+ const list = domains[currentRealm] || [];
+ domainRows.replaceChildren(...list.map(domainRowElement));
+ applySearch();
+ }
+
+ function applySearch() {
+ const term = searchInput.value.trim().toLowerCase();
+ const total = (domains[currentRealm] || []).length;
+ let visible = 0;
+
+ domainRowList().forEach((row) => {
+ const match = !term || (row.dataset.search || '').includes(term);
+ row.hidden = !match;
+ if (match) visible += 1;
+ });
+
+ searchEmpty.hidden = total === 0 || visible !== 0;
+ realmEmpty.hidden = total !== 0;
+ }
+
+ function syncSelector() {
+ realmSelectOptions.forEach((option) => {
+ const slug = option.dataset.value;
+ const accessible = realmInfo[slug].roles.includes(currentRole.value);
+ option.hidden = !accessible;
+ const selected = slug === currentRealm;
+ option.classList.toggle('is-selected', selected);
+ option.setAttribute('aria-selected', String(selected));
+ });
+ realmSelectValue.textContent = realmInfo[currentRealm].label;
+ realmSelect.dataset.value = currentRealm;
+ }
+
+ function subpageUrl(path) {
+ const params = new URLSearchParams();
+ params.set('realm', currentRealm);
+ params.set('role', currentRole.value);
+ if (currentTheme !== 'auto') params.set('theme', currentTheme);
+ return `./${path}?${params.toString()}`;
+ }
+
+ function realmListParams() {
+ const params = new URLSearchParams();
+ params.set('role', currentRole.value);
+ if (currentTheme !== 'auto') params.set('theme', currentTheme);
+ return params.toString();
+ }
+
+ function realmNavHref() {
+ return accessibleRealms().length === 1
+ ? subpageUrl('admin-settings.html')
+ : `./admin-realms.html?${realmListParams()}`;
+ }
+
+ function syncRealmLinks() {
+ const count = accessibleRealms().length;
+ const label = count === 1 ? 'Realm' : 'Realms';
+ const href = realmNavHref();
+
+ realmNavLabels.forEach((element) => {
+ element.textContent = label;
+ });
+ realmNavLinks.forEach((link) => {
+ link.href = href;
+ link.classList.add('is-active');
+ link.removeAttribute('aria-current');
+ });
+ breadcrumbRootLabels.forEach((element) => {
+ element.textContent = label;
+ });
+ breadcrumbRootLink.href = href;
+ breadcrumbRealmLink.textContent = realmInfo[currentRealm].label;
+ breadcrumbRealmLink.href = subpageUrl('admin-settings.html');
+ }
+
+ function syncUrl() {
+ const params = new URLSearchParams();
+ params.set('realm', currentRealm);
+ params.set('role', currentRole.value);
+ if (currentTheme !== 'auto') params.set('theme', currentTheme);
+ try {
+ window.history.replaceState({}, '', `${window.location.pathname}?${params.toString()}`);
+ } catch (e) {
+ /* ignore history updates when opened from file:// */
+ }
+ }
+
+ function setRole(role) {
+ currentRole.value = role;
+ const identity = identities[role];
+
+ document.querySelectorAll('.user-name').forEach((element) => {
+ element.textContent = identity.name;
+ });
+ document.querySelectorAll('.user-meta').forEach((element) => {
+ element.textContent = identity.email;
+ });
+
+ roleButtons.forEach((button) => {
+ const active = button.dataset.roleTarget === role;
+ button.classList.toggle('is-active', active);
+ button.setAttribute('aria-pressed', String(active));
+ });
+
+ settingsNavLinks.forEach((link) => {
+ link.hidden = role !== 'system';
+ });
+
+ if (!accessibleRealms().includes(currentRealm)) {
+ currentRealm = accessibleRealms()[0] || 'acme';
+ }
+
+ syncSelector();
+ renderDomains();
+ syncRealmLinks();
+ syncUrl();
+ }
+
+ roleButtons.forEach((button) => {
+ button.addEventListener('click', () => setRole(button.dataset.roleTarget));
+ });
+
+ const selectObserver = new MutationObserver(() => {
+ const value = realmSelect.dataset.value;
+ if (value && value !== currentRealm) {
+ currentRealm = value;
+ renderDomains();
+ syncSelector();
+ syncRealmLinks();
+ syncUrl();
+ }
+ });
+ selectObserver.observe(realmSelect, { attributes: true, attributeFilter: ['data-value'] });
+
+ const createDialog = document.getElementById('domains-create-dialog');
+ const createForm = document.getElementById('domains-create-form');
+ const createAlert = document.getElementById('domains-create-alert');
+ const domainInput = document.getElementById('domains-domain-input');
+
+ function normalizeDomain(value) {
+ return value.trim().toLowerCase().replace(/\.$/, '');
+ }
+
+ function domainError(raw) {
+ const value = raw.trim();
+ const domain = normalizeDomain(value);
+
+ if (!domain) return 'Email domain is required.';
+ if (/\s/.test(value)) return 'Email domain must not contain spaces.';
+ if (domain.includes('@')) return 'Enter the domain without the @ symbol.';
+ if (domain.includes('://') || /^[a-z][a-z0-9+.-]*:\/\//i.test(value)) {
+ return 'Email domain must not include a scheme such as https://.';
+ }
+ if (domain.includes('/')) return 'Email domain must not include a path.';
+ if (domain.includes('*')) return 'Wildcard domains are not supported.';
+ if (domain.includes(':')) return 'Email domain must not include a port.';
+ if (value.endsWith('.')) return 'Email domain must not end with a dot.';
+ if (domain.startsWith('.')) return 'Email domain must not start with a dot.';
+ if (domain.length > 253) return 'Email domain must be 253 characters or fewer.';
+
+ const labels = domain.split('.');
+ if (labels.length < 2) return 'Enter a complete domain such as acme.test.';
+ for (const label of labels) {
+ if (!/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/.test(label)) {
+ return 'Domain labels may use lowercase letters, numbers and hyphens.';
+ }
+ if (label.length > 63) return 'Each domain label must be 63 characters or fewer.';
+ }
+
+ const assignment = domainAssignments[domain];
+ if (assignment) {
+ if (assignment.realm === currentRealm) return 'This email domain is already assigned to this realm.';
+ if (currentRole.value === 'system') {
+ return `This email domain is already assigned to ${realmInfo[assignment.realm].label}.`;
+ }
+ return 'This email domain is already assigned to another realm.';
+ }
+
+ return null;
+ }
+
+ function generateToken() {
+ const bytes = new Uint8Array(18);
+ crypto.getRandomValues(bytes);
+ let binary = '';
+ bytes.forEach((byte) => {
+ binary += String.fromCharCode(byte);
+ });
+ const encoded = btoa(binary).replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, '');
+ return encoded;
+ }
+
+ function clearCreateError() {
+ createAlert.hidden = true;
+ createAlert.textContent = '';
+ domainInput.removeAttribute('aria-invalid');
+ }
+
+ function showCreateError(message) {
+ createAlert.hidden = false;
+ createAlert.textContent = message;
+ domainInput.setAttribute('aria-invalid', 'true');
+ }
+
+ function resetCreateForm() {
+ createForm.reset();
+ clearCreateError();
+ }
+
+ addButton.addEventListener('click', () => {
+ resetCreateForm();
+ createDialog.hidden = false;
+ requestAnimationFrame(() => domainInput.focus());
+ });
+
+ domainInput.addEventListener('input', clearCreateError);
+
+ createForm.addEventListener('submit', (event) => {
+ event.preventDefault();
+ const domain = normalizeDomain(domainInput.value);
+ const error = domainError(domainInput.value);
+ if (error) {
+ showCreateError(error);
+ return;
+ }
+
+ const entry = { domain, status: 'pending', token: generateToken(), added: 'Just now' };
+ domains[currentRealm].unshift(entry);
+ domainAssignments[domain] = { realm: currentRealm };
+ createDialog.hidden = true;
+ renderDomains();
+ showNotice(`Email domain ${domain} added. Add the TXT record to verify this domain.`);
+ });
+
+ const verifyDialog = document.getElementById('domains-verify-dialog');
+ const verifyMessage = document.getElementById('domains-verify-message');
+ const verifyName = document.getElementById('domains-verify-name');
+ const verifyValue = document.getElementById('domains-verify-value');
+ const verifyCopyButton = document.getElementById('domains-verify-copy');
+ const verifyMarkButton = document.getElementById('domains-verify-mark');
+ let pendingVerifyDomain = '';
+ let copyResetTimer = 0;
+
+ function findDomainEntry(domain) {
+ return (domains[currentRealm] || []).find((entry) => entry.domain === domain);
+ }
+
+ function resetCopyButton() {
+ window.clearTimeout(copyResetTimer);
+ verifyCopyButton.textContent = 'Copy value';
+ }
+
+ function flashCopied() {
+ verifyCopyButton.textContent = 'Copied';
+ window.clearTimeout(copyResetTimer);
+ copyResetTimer = window.setTimeout(() => {
+ verifyCopyButton.textContent = 'Copy value';
+ }, 2000);
+ }
+
+ function copyText(text) {
+ if (navigator.clipboard && navigator.clipboard.writeText) {
+ navigator.clipboard.writeText(text).then(flashCopied).catch(() => fallbackCopy(text));
+ return;
+ }
+ fallbackCopy(text);
+ }
+
+ function fallbackCopy(text) {
+ const scratch = document.createElement('textarea');
+ scratch.value = text;
+ scratch.setAttribute('readonly', '');
+ scratch.style.position = 'absolute';
+ scratch.style.left = '-9999rem';
+ document.body.appendChild(scratch);
+ scratch.select();
+ try {
+ document.execCommand('copy');
+ flashCopied();
+ } catch (e) {
+ verifyCopyButton.textContent = 'Copy failed';
+ window.clearTimeout(copyResetTimer);
+ copyResetTimer = window.setTimeout(() => {
+ verifyCopyButton.textContent = 'Copy value';
+ }, 2000);
+ }
+ document.body.removeChild(scratch);
+ }
+
+ function openVerifyDialog(domain) {
+ const entry = findDomainEntry(domain);
+ if (!entry) return;
+ pendingVerifyDomain = domain;
+ verifyMessage.textContent = `Add the TXT record below to prove control of ${domain}. Accounts using this domain are assigned to the realm automatically once verified.`;
+ verifyName.value = `_auth-domain-challenge.${domain}`;
+ verifyValue.value = entry.token || generateToken();
+ resetCopyButton();
+ verifyDialog.hidden = false;
+ requestAnimationFrame(() => verifyName.focus());
+ }
+
+ verifyCopyButton.addEventListener('click', () => copyText(verifyValue.value));
+
+ verifyMarkButton.addEventListener('click', () => {
+ if (!pendingVerifyDomain) return;
+ const entry = findDomainEntry(pendingVerifyDomain);
+ if (entry) {
+ entry.status = 'verified';
+ delete entry.token;
+ }
+ const verified = pendingVerifyDomain;
+ pendingVerifyDomain = '';
+ verifyDialog.hidden = true;
+ renderDomains();
+ showNotice(`Email domain ${verified} verified.`);
+ });
+
+ const removeDialog = document.getElementById('domains-remove-dialog');
+ const removeMessage = document.getElementById('domains-remove-message');
+ const removeInput = document.getElementById('domains-remove-confirm');
+ const confirmRemoveButton = document.getElementById('domains-remove-confirm-button');
+ let pendingRemoveDomain = '';
+
+ function openRemoveDialog(domain) {
+ pendingRemoveDomain = domain;
+ const realmLabel = realmInfo[currentRealm].label;
+ removeMessage.textContent = `Remove ${domain}? This domain will stop assigning new accounts to ${realmLabel}. Existing accounts keep their current home realm, and realm memberships are unaffected.`;
+ removeInput.value = '';
+ removeInput.placeholder = domain;
+ confirmRemoveButton.disabled = true;
+ removeDialog.hidden = false;
+ requestAnimationFrame(() => removeInput.focus());
+ }
+
+ removeInput.addEventListener('input', () => {
+ confirmRemoveButton.disabled = normalizeDomain(removeInput.value) !== pendingRemoveDomain;
+ });
+
+ confirmRemoveButton.addEventListener('click', () => {
+ if (!pendingRemoveDomain || confirmRemoveButton.disabled) return;
+
+ domains[currentRealm] = (domains[currentRealm] || []).filter((entry) => entry.domain !== pendingRemoveDomain);
+ delete domainAssignments[pendingRemoveDomain];
+ const removed = pendingRemoveDomain;
+ pendingRemoveDomain = '';
+ removeDialog.hidden = true;
+ renderDomains();
+ showNotice(`Email domain ${removed} removed.`);
+ });
+
+ domainRows.addEventListener('click', (event) => {
+ const verifyButton = event.target.closest('[data-verify-domain]');
+ if (verifyButton) {
+ event.stopPropagation();
+ openVerifyDialog(verifyButton.dataset.verifyDomain);
+ return;
+ }
+
+ const removeButton = event.target.closest('[data-remove-domain]');
+ if (removeButton) {
+ event.stopPropagation();
+ openRemoveDialog(removeButton.dataset.removeDomain);
+ }
+ });
+
+ searchInput.addEventListener('input', applySearch);
+
+ const initialParams = new URLSearchParams(window.location.search);
+ const initialTheme = initialParams.get('theme');
+ if (initialTheme === 'light' || initialTheme === 'dark') setTheme(initialTheme);
+
+ const initialRole = initialParams.get('role');
+ if (identities[initialRole]) currentRole.value = initialRole;
+
+ const initialRealm = initialParams.get('realm');
+ if (realmInfo[initialRealm] && realmInfo[initialRealm].roles.includes(currentRole.value)) {
+ currentRealm = initialRealm;
+ } else {
+ currentRealm = accessibleRealms()[0] || 'acme';
+ }
+
+ setRole(currentRole.value);
+ </script>
+ <script src="./shell.js"></script>
+ </body>
+</html>
diff --git a/mockup/plain/admin-realm-hosts.html b/mockup/plain/admin-realm-hosts.html
@@ -0,0 +1,958 @@
+<!doctype html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
+ <title>Admin realm hosts mockup</title>
+ <link rel="stylesheet" href="./global.css" />
+ <link rel="stylesheet" href="./select-menu.css" />
+ <style>
+ .host-name {
+ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
+ font-size: 0.8125rem;
+ overflow-wrap: anywhere;
+ }
+
+ .host-added {
+ color: var(--muted);
+ font-size: 0.8125rem;
+ }
+
+ .host-row-action {
+ display: flex;
+ align-items: center;
+ }
+
+ .action-button {
+ display: inline-flex;
+ align-items: center;
+ min-height: 2rem;
+ padding: 0.25rem 0.625rem;
+ border: 0;
+ border-radius: 0.25rem;
+ background: transparent;
+ color: var(--muted);
+ font: inherit;
+ font-size: 0.8125rem;
+ font-weight: 500;
+ line-height: 1.4;
+ white-space: nowrap;
+ cursor: pointer;
+ }
+
+ .action-button:hover {
+ background: var(--row-hover);
+ color: var(--text);
+ }
+
+ .action-button:first-child {
+ margin-left: -0.625rem;
+ }
+
+ .action-button.is-danger {
+ color: var(--danger-text);
+ }
+
+ .action-button.is-danger:hover {
+ background: color-mix(in srgb, var(--danger) 12%, transparent);
+ color: var(--danger-text);
+ }
+
+ .host-table td.host-action-column {
+ padding-bottom: 0.75rem;
+ }
+
+ .empty {
+ padding: 2rem;
+ color: var(--muted);
+ font-size: 0.875rem;
+ }
+
+ .empty p {
+ margin: 0;
+ }
+
+ .state-preview {
+ margin-top: 2rem;
+ }
+
+ .state-preview > h2 {
+ margin-bottom: 0.75rem;
+ }
+
+ @media (max-width: 39.999em) {
+ .mockup-controls {
+ flex-direction: column;
+ align-items: flex-start;
+ width: min(18rem, calc(100vw - 2rem));
+ }
+
+ .mockup-separator {
+ display: none;
+ }
+
+ .table-actions {
+ width: 100%;
+ flex-direction: column;
+ align-items: stretch;
+ }
+
+ .table-actions .button {
+ width: 100%;
+ }
+ }
+
+ @media (min-width: 40em) {
+ .host-table {
+ table-layout: fixed;
+ }
+
+ .host-table .host-added-column {
+ width: 10rem;
+ }
+
+ .host-table .host-action-column {
+ width: 9rem;
+ }
+
+ .host-row-action {
+ justify-content: flex-start;
+ }
+ }
+ </style>
+ </head>
+ <body>
+ <header class="topbar">
+ <a class="brand" href="./admin-dashboard.html">
+ <svg class="brand-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
+ <path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z" />
+ </svg>
+ <span class="brand-name">Auth</span>
+ </a>
+ <div class="topbar-actions">
+ <button class="mobile-nav-toggle" type="button" id="mobile-nav-toggle" aria-controls="mobile-navigation" aria-expanded="false" aria-label="Open navigation">
+ <span class="mobile-nav-toggle-bars" aria-hidden="true"></span>
+ </button>
+ <details class="user-menu">
+ <summary aria-label="Account menu">
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
+ <circle cx="12" cy="12" r="10" />
+ <circle cx="12" cy="10" r="3" />
+ <path d="M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662" />
+ </svg>
+ </summary>
+ <div class="user-panel">
+ <div class="user-summary">
+ <span class="user-name">System Admin</span>
+ <span class="user-meta">admin@system.test</span>
+ </div>
+ <div class="user-menu-list">
+ <a class="user-menu-item" href="#">
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
+ <path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1-1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z" />
+ <circle cx="12" cy="12" r="3" />
+ </svg>
+ <span>Account settings</span>
+ </a>
+ <button class="user-menu-item" type="button" data-user-theme>
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
+ <circle cx="12" cy="12" r="4" />
+ <path d="M12 2v2" />
+ <path d="M12 20v2" />
+ <path d="m4.93 4.93 1.41 1.41" />
+ <path d="m17.66 17.66 1.41 1.41" />
+ <path d="M2 12h2" />
+ <path d="M20 12h2" />
+ <path d="m6.34 17.66-1.41 1.41" />
+ <path d="m19.07 4.93-1.41 1.41" />
+ </svg>
+ <span>Theme</span>
+ <span class="user-menu-value" data-user-theme-value>Auto</span>
+ </button>
+ <a class="user-menu-item" href="#">
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
+ <path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" />
+ <path d="m16 17 5-5-5-5" />
+ <path d="M21 12H9" />
+ </svg>
+ <span>Sign out</span>
+ </a>
+ </div>
+ </div>
+ </details>
+ </div>
+ </header>
+
+ <div class="mobile-nav" id="mobile-navigation" aria-hidden="true">
+ <nav class="nav" aria-label="Administration">
+ <p class="nav-label">Administration</p>
+ <a class="nav-item" href="./admin-dashboard.html">
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
+ <rect x="3" y="3" width="7" height="7" />
+ <rect x="14" y="3" width="7" height="7" />
+ <rect x="3" y="14" width="7" height="7" />
+ <rect x="14" y="14" width="7" height="7" />
+ </svg>
+ <span>Overview</span>
+ </a>
+ <a class="nav-item is-active" data-realm-nav href="./admin-realms.html">
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
+ <path d="M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z" />
+ <path d="M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2" />
+ <path d="M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2" />
+ <path d="M10 6h4" />
+ <path d="M10 10h4" />
+ <path d="M10 14h4" />
+ <path d="M10 18h4" />
+ </svg>
+ <span data-realm-nav-label>Realms</span>
+ </a>
+ <a class="nav-item" href="./admin-clients.html">
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
+ <rect x="2" y="4" width="20" height="16" rx="2" />
+ <path d="M10 4v4" />
+ <path d="M2 8h20" />
+ <path d="M6 4v4" />
+ </svg>
+ <span>Clients</span>
+ </a>
+ <a class="nav-item" href="#">
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
+ <path d="M22 12h-4l-3 8-6-16-3 8H2" />
+ </svg>
+ <span>Sessions</span>
+ </a>
+ <a class="nav-item" href="./admin-users.html">
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
+ <path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" />
+ <circle cx="12" cy="7" r="4" />
+ </svg>
+ <span>Users</span>
+ </a>
+ <a class="nav-item" data-settings-nav href="./admin-system-settings.html">
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
+ <path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1-1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z" />
+ <circle cx="12" cy="12" r="3" />
+ </svg>
+ <span>Settings</span>
+ </a>
+ </nav>
+ <div class="mobile-nav-divider" aria-hidden="true"></div>
+ <section class="mobile-nav-account" aria-label="Account">
+ <div class="user-summary">
+ <span class="user-name">System Admin</span>
+ <span class="user-meta">admin@system.test</span>
+ </div>
+ <div class="user-menu-list">
+ <a class="user-menu-item" href="#">
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
+ <path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1-1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z" />
+ <circle cx="12" cy="12" r="3" />
+ </svg>
+ <span>Account settings</span>
+ </a>
+ <button class="user-menu-item" type="button" data-user-theme>
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
+ <circle cx="12" cy="12" r="4" />
+ <path d="M12 2v2" />
+ <path d="M12 20v2" />
+ <path d="m4.93 4.93 1.41 1.41" />
+ <path d="m17.66 17.66 1.41 1.41" />
+ <path d="M2 12h2" />
+ <path d="M20 12h2" />
+ <path d="m6.34 17.66-1.41 1.41" />
+ <path d="m19.07 4.93-1.41 1.41" />
+ </svg>
+ <span>Theme</span>
+ <span class="user-menu-value" data-user-theme-value>Auto</span>
+ </button>
+ <a class="user-menu-item" href="#">
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
+ <path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" />
+ <path d="m16 17 5-5-5-5" />
+ <path d="M21 12H9" />
+ </svg>
+ <span>Sign out</span>
+ </a>
+ </div>
+ </section>
+ </div>
+
+ <div class="app">
+ <aside class="sidebar">
+ <nav class="nav" aria-label="Administration">
+ <p class="nav-label">Administration</p>
+ <a class="nav-item" href="./admin-dashboard.html">
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
+ <rect x="3" y="3" width="7" height="7" />
+ <rect x="14" y="3" width="7" height="7" />
+ <rect x="3" y="14" width="7" height="7" />
+ <rect x="14" y="14" width="7" height="7" />
+ </svg>
+ <span>Overview</span>
+ </a>
+ <a class="nav-item is-active" data-realm-nav href="./admin-realms.html">
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
+ <path d="M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z" />
+ <path d="M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2" />
+ <path d="M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2" />
+ <path d="M10 6h4" />
+ <path d="M10 10h4" />
+ <path d="M10 14h4" />
+ <path d="M10 18h4" />
+ </svg>
+ <span data-realm-nav-label>Realms</span>
+ </a>
+ <a class="nav-item" href="./admin-clients.html">
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
+ <rect x="2" y="4" width="20" height="16" rx="2" />
+ <path d="M10 4v4" />
+ <path d="M2 8h20" />
+ <path d="M6 4v4" />
+ </svg>
+ <span>Clients</span>
+ </a>
+ <a class="nav-item" href="#">
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
+ <path d="M22 12h-4l-3 8-6-16-3 8H2" />
+ </svg>
+ <span>Sessions</span>
+ </a>
+ <a class="nav-item" href="./admin-users.html">
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
+ <path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" />
+ <circle cx="12" cy="7" r="4" />
+ </svg>
+ <span>Users</span>
+ </a>
+ <a class="nav-item" data-settings-nav href="./admin-system-settings.html">
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
+ <path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1-1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z" />
+ <circle cx="12" cy="12" r="3" />
+ </svg>
+ <span>Settings</span>
+ </a>
+ </nav>
+ </aside>
+
+ <div class="main">
+ <main class="content">
+ <div class="page-header page-header-row">
+ <div>
+ <div class="client-breadcrumb">
+ <a id="hosts-breadcrumb-root" href="./admin-realms.html"><span data-realm-breadcrumb-root>Realms</span></a>
+ <span>/</span>
+ <a id="hosts-breadcrumb-realm" href="./admin-settings.html?realm=acme">Acme</a>
+ <span>/</span>
+ <span aria-current="page">Hosts</span>
+ </div>
+ <h1>Hosts</h1>
+ <p>Hostnames that resolve to this realm.</p>
+ </div>
+ <div class="realm-select">
+ <span id="hosts-realm-label">Realm</span>
+ <div class="select" id="hosts-realm-select" data-select data-value="acme">
+ <button
+ class="select-trigger"
+ type="button"
+ id="hosts-realm-trigger"
+ role="combobox"
+ aria-haspopup="listbox"
+ aria-expanded="false"
+ aria-controls="hosts-realm-listbox"
+ aria-labelledby="hosts-realm-label"
+ >
+ <span class="select-value">Acme</span>
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
+ <path d="m6 9 6 6 6-6" />
+ </svg>
+ </button>
+ <div class="select-list" id="hosts-realm-listbox" role="listbox" aria-labelledby="hosts-realm-label" hidden>
+ <div class="select-option is-selected" id="hosts-realm-acme" role="option" aria-selected="true" data-value="acme" data-label="Acme">
+ <span class="select-option-mark" aria-hidden="true">
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
+ <path d="M20 6 9 17l-5-5" />
+ </svg>
+ </span>
+ <span class="select-option-label">Acme</span>
+ </div>
+ <div class="select-option" id="hosts-realm-globex" role="option" aria-selected="false" data-value="globex" data-label="Globex">
+ <span class="select-option-mark" aria-hidden="true">
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
+ <path d="M20 6 9 17l-5-5" />
+ </svg>
+ </span>
+ <span class="select-option-label">Globex</span>
+ </div>
+ <div class="select-option" id="hosts-realm-northwind" role="option" aria-selected="false" data-value="northwind" data-label="Northwind">
+ <span class="select-option-mark" aria-hidden="true">
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
+ <path d="M20 6 9 17l-5-5" />
+ </svg>
+ </span>
+ <span class="select-option-label">Northwind</span>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <div id="hosts-notice" class="notice" role="status" hidden></div>
+
+ <section class="table-panel" aria-labelledby="hosts-table-title">
+ <h2 id="hosts-table-title" class="sr-only">Realm hosts</h2>
+ <div class="table-toolbar">
+ <div class="table-search">
+ <input id="hosts-search" type="search" aria-label="Search hosts" placeholder="Search hosts" />
+ </div>
+ <div class="table-actions">
+ <button id="hosts-add-button" class="button" type="button">Add host</button>
+ </div>
+ </div>
+
+ <div class="data-table-wrap">
+ <table class="data-table data-table-static host-table">
+ <thead>
+ <tr>
+ <th class="data-table-primary host-name-column" scope="col">Hostname</th>
+ <th class="host-added-column" scope="col">Added</th>
+ <th class="host-action-column" scope="col">Actions</th>
+ </tr>
+ </thead>
+ <tbody id="hosts-rows"></tbody>
+ </table>
+ <div id="hosts-search-empty" class="empty" hidden>
+ <p>No hosts match this search.</p>
+ </div>
+ <div id="hosts-realm-empty" class="empty" hidden>
+ <p>No hosts are assigned to this realm.</p>
+ </div>
+ </div>
+ </section>
+
+ <section class="state-preview">
+ <h2>Loading state</h2>
+ <div class="panel" aria-busy="true">
+ <div class="skeleton skeleton-title"></div>
+ <div class="skeleton"></div>
+ <div class="skeleton skeleton-short"></div>
+ </div>
+ </section>
+ </main>
+ </div>
+ </div>
+
+ <div id="hosts-create-dialog" class="modal-overlay" hidden>
+ <form id="hosts-create-form" class="modal" role="dialog" aria-modal="true" aria-labelledby="hosts-create-title" novalidate>
+ <div class="modal-header">
+ <h2 id="hosts-create-title">Add host</h2>
+ <button class="modal-close" type="button" aria-label="Close dialog" data-dialog-close>
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
+ <path d="M18 6 6 18" />
+ <path d="m6 6 12 12" />
+ </svg>
+ </button>
+ </div>
+ <div class="modal-body">
+ <div id="hosts-create-alert" class="alert" role="alert" hidden></div>
+
+ <label class="form-field" for="hosts-host-input">
+ <span class="field-label">Hostname</span>
+ <input id="hosts-host-input" class="field-control" type="text" maxlength="253" placeholder="login.acme.test" autocomplete="off" spellcheck="false" />
+ </label>
+ <p class="modal-note">Lowercase hostname. Do not include a scheme, port, path or wildcard.</p>
+
+ <div class="modal-actions">
+ <button class="button-secondary" type="button" data-dialog-close>Cancel</button>
+ <button class="button" type="submit">Add host</button>
+ </div>
+ </div>
+ </form>
+ </div>
+
+ <div id="hosts-remove-dialog" class="modal-overlay" hidden>
+ <div class="modal" role="dialog" aria-modal="true" aria-labelledby="hosts-remove-title">
+ <div class="modal-header">
+ <h2 id="hosts-remove-title">Remove host</h2>
+ <button class="modal-close" type="button" aria-label="Close dialog" data-dialog-close>
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
+ <path d="M18 6 6 18" />
+ <path d="m6 6 12 12" />
+ </svg>
+ </button>
+ </div>
+ <div class="modal-body">
+ <p id="hosts-remove-message" class="modal-note"></p>
+ <label class="form-field" for="hosts-remove-confirm">
+ <span class="field-label">Confirm hostname</span>
+ <input id="hosts-remove-confirm" class="field-control" type="text" maxlength="253" autocomplete="off" spellcheck="false" />
+ </label>
+ <p class="modal-note">Type the hostname exactly to confirm.</p>
+ <div class="modal-actions">
+ <button class="button-secondary" type="button" data-dialog-close>Cancel</button>
+ <button id="hosts-remove-confirm-button" class="button-danger" type="button" disabled>Remove host</button>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <div class="mockup-controls" aria-label="Mockup controls">
+ <span class="mockup-label">Mockup</span>
+ <button class="mockup-button is-active" type="button" data-theme-target="auto">Auto</button>
+ <button class="mockup-button" type="button" data-theme-target="light">Light</button>
+ <button class="mockup-button" type="button" data-theme-target="dark">Dark</button>
+ <span class="mockup-separator" aria-hidden="true"></span>
+ <span class="mockup-label">View as</span>
+ <button class="mockup-button is-active" type="button" data-role-target="system" aria-pressed="true">System admin</button>
+ <button class="mockup-button" type="button" data-role-target="owner" aria-pressed="false">Realm owner</button>
+ <button class="mockup-button" type="button" data-role-target="admin" aria-pressed="false">Realm admin</button>
+ </div>
+
+ <script>
+ const root = document.documentElement;
+ const themeButtons = document.querySelectorAll('[data-theme-target]');
+ const userThemeButtons = document.querySelectorAll('[data-user-theme]');
+ const userThemeValues = document.querySelectorAll('[data-user-theme-value]');
+ let currentTheme = 'auto';
+
+ function setTheme(value) {
+ currentTheme = value;
+ if (value === 'auto') {
+ root.removeAttribute('data-theme');
+ } else {
+ root.setAttribute('data-theme', value);
+ }
+
+ themeButtons.forEach((button) => {
+ button.classList.toggle('is-active', button.dataset.themeTarget === value);
+ });
+ userThemeValues.forEach((element) => {
+ element.textContent = value.charAt(0).toUpperCase() + value.slice(1);
+ });
+
+ if (typeof syncUrl === 'function') syncUrl();
+ if (typeof syncRealmLinks === 'function') syncRealmLinks();
+ }
+
+ themeButtons.forEach((button) => {
+ button.addEventListener('click', () => setTheme(button.dataset.themeTarget));
+ });
+
+ userThemeButtons.forEach((button) => {
+ button.addEventListener('click', () => {
+ const themes = ['auto', 'light', 'dark'];
+ setTheme(themes[(themes.indexOf(currentTheme) + 1) % themes.length]);
+ });
+ });
+
+ const userMenu = document.querySelector('.user-menu');
+ document.addEventListener('click', (event) => {
+ if (userMenu && userMenu.open && !userMenu.contains(event.target)) {
+ userMenu.open = false;
+ }
+ });
+
+ document.querySelectorAll('[data-dialog-close]').forEach((button) => {
+ button.addEventListener('click', () => {
+ button.closest('.modal-overlay').hidden = true;
+ });
+ });
+
+ document.querySelectorAll('.modal-overlay').forEach((overlay) => {
+ overlay.addEventListener('mousedown', (event) => {
+ if (event.target === overlay) overlay.hidden = true;
+ });
+ });
+
+ document.addEventListener('keydown', (event) => {
+ if (event.key === 'Escape') {
+ document.querySelectorAll('.modal-overlay:not([hidden])').forEach((dialog) => {
+ dialog.hidden = true;
+ });
+ }
+ });
+
+ const identities = {
+ system: { name: 'System Admin', email: 'admin@system.test' },
+ owner: { name: 'Realm Owner', email: 'owner@acme.test' },
+ admin: { name: 'Realm Admin', email: 'realm-admin@managed.test' },
+ };
+
+ const realmInfo = {
+ acme: { label: 'Acme', roles: ['system', 'owner'] },
+ globex: { label: 'Globex', roles: ['system', 'admin'] },
+ northwind: { label: 'Northwind', roles: ['system'] },
+ };
+ const realmOrder = ['acme', 'globex', 'northwind'];
+
+ const hosts = {
+ acme: [
+ { host: 'acme.localhost', added: '12 Mar 2026' },
+ { host: 'login.acme.test', added: '12 Mar 2026' },
+ ],
+ globex: [{ host: 'globex.localhost', added: '04 Feb 2026' }],
+ northwind: [],
+ };
+
+ const hostAssignments = {
+ 'acme.localhost': { realm: 'acme' },
+ 'login.acme.test': { realm: 'acme' },
+ 'globex.localhost': { realm: 'globex' },
+ 'app.acme.localhost': { realm: 'acme', client: true },
+ 'auth.example.test': { reserved: true },
+ };
+
+ const currentRole = { value: 'system' };
+ let currentRealm = 'acme';
+
+ const roleButtons = document.querySelectorAll('[data-role-target]');
+ const realmNavLinks = document.querySelectorAll('[data-realm-nav]');
+ const realmNavLabels = document.querySelectorAll('[data-realm-nav-label]');
+ const settingsNavLinks = document.querySelectorAll('[data-settings-nav]');
+ const breadcrumbRootLink = document.getElementById('hosts-breadcrumb-root');
+ const breadcrumbRealmLink = document.getElementById('hosts-breadcrumb-realm');
+ const breadcrumbRootLabels = document.querySelectorAll('[data-realm-breadcrumb-root]');
+
+ const realmSelect = document.getElementById('hosts-realm-select');
+ const realmSelectValue = realmSelect.querySelector('.select-value');
+ const realmSelectOptions = [...realmSelect.querySelectorAll('.select-option')];
+
+ const notice = document.getElementById('hosts-notice');
+ const searchInput = document.getElementById('hosts-search');
+ const searchEmpty = document.getElementById('hosts-search-empty');
+ const realmEmpty = document.getElementById('hosts-realm-empty');
+ const hostsRows = document.getElementById('hosts-rows');
+ const addButton = document.getElementById('hosts-add-button');
+
+ function accessibleRealms() {
+ return realmOrder.filter((slug) => realmInfo[slug].roles.includes(currentRole.value));
+ }
+
+ function hostRowList() {
+ return [...hostsRows.querySelectorAll('.host-row')];
+ }
+
+ function showNotice(message) {
+ notice.textContent = message;
+ notice.hidden = false;
+ }
+
+ function escapeHtml(value) {
+ return String(value).replace(/[&<>"']/g, (character) => {
+ const entities = { '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' };
+ return entities[character];
+ });
+ }
+
+ function hostRowElement(entry) {
+ const row = document.createElement('tr');
+ row.className = 'host-row';
+ row.dataset.search = entry.host.toLowerCase();
+ row.innerHTML = `
+ <td class="data-table-primary host-name-column" data-label="Hostname">
+ <span class="host-name">${escapeHtml(entry.host)}</span>
+ </td>
+ <td class="host-added-column" data-label="Added"><span class="host-added">${escapeHtml(entry.added)}</span></td>
+ <td class="host-action-column" data-label="Actions">
+ <div class="host-row-action">
+ <button class="action-button is-danger" type="button" data-remove-host="${escapeHtml(entry.host)}">Remove</button>
+ </div>
+ </td>`;
+ return row;
+ }
+
+ function renderHosts() {
+ const list = hosts[currentRealm] || [];
+ hostsRows.replaceChildren(...list.map(hostRowElement));
+ applySearch();
+ }
+
+ function applySearch() {
+ const term = searchInput.value.trim().toLowerCase();
+ const total = (hosts[currentRealm] || []).length;
+ let visible = 0;
+
+ hostRowList().forEach((row) => {
+ const match = !term || (row.dataset.search || '').includes(term);
+ row.hidden = !match;
+ if (match) visible += 1;
+ });
+
+ searchEmpty.hidden = total === 0 || visible !== 0;
+ realmEmpty.hidden = total !== 0;
+ }
+
+ function syncSelector() {
+ realmSelectOptions.forEach((option) => {
+ const slug = option.dataset.value;
+ const accessible = realmInfo[slug].roles.includes(currentRole.value);
+ option.hidden = !accessible;
+ const selected = slug === currentRealm;
+ option.classList.toggle('is-selected', selected);
+ option.setAttribute('aria-selected', String(selected));
+ });
+ realmSelectValue.textContent = realmInfo[currentRealm].label;
+ realmSelect.dataset.value = currentRealm;
+ }
+
+ function subpageUrl(path) {
+ const params = new URLSearchParams();
+ params.set('realm', currentRealm);
+ params.set('role', currentRole.value);
+ if (currentTheme !== 'auto') params.set('theme', currentTheme);
+ return `./${path}?${params.toString()}`;
+ }
+
+ function realmNavHref() {
+ return accessibleRealms().length === 1
+ ? subpageUrl('admin-settings.html')
+ : `./admin-realms.html?${realmListParams()}`;
+ }
+
+ function realmListParams() {
+ const params = new URLSearchParams();
+ params.set('role', currentRole.value);
+ if (currentTheme !== 'auto') params.set('theme', currentTheme);
+ return params.toString();
+ }
+
+ function syncRealmLinks() {
+ const count = accessibleRealms().length;
+ const label = count === 1 ? 'Realm' : 'Realms';
+ const href = realmNavHref();
+
+ realmNavLabels.forEach((element) => {
+ element.textContent = label;
+ });
+ realmNavLinks.forEach((link) => {
+ link.href = href;
+ link.classList.add('is-active');
+ link.removeAttribute('aria-current');
+ });
+ breadcrumbRootLabels.forEach((element) => {
+ element.textContent = label;
+ });
+ breadcrumbRootLink.href = href;
+ breadcrumbRealmLink.textContent = realmInfo[currentRealm].label;
+ breadcrumbRealmLink.href = subpageUrl('admin-settings.html');
+ }
+
+ function syncUrl() {
+ const params = new URLSearchParams();
+ params.set('realm', currentRealm);
+ params.set('role', currentRole.value);
+ if (currentTheme !== 'auto') params.set('theme', currentTheme);
+ try {
+ window.history.replaceState({}, '', `${window.location.pathname}?${params.toString()}`);
+ } catch (e) {
+ /* ignore history updates when opened from file:// */
+ }
+ }
+
+ function setRole(role) {
+ currentRole.value = role;
+ const identity = identities[role];
+
+ document.querySelectorAll('.user-name').forEach((element) => {
+ element.textContent = identity.name;
+ });
+ document.querySelectorAll('.user-meta').forEach((element) => {
+ element.textContent = identity.email;
+ });
+
+ roleButtons.forEach((button) => {
+ const active = button.dataset.roleTarget === role;
+ button.classList.toggle('is-active', active);
+ button.setAttribute('aria-pressed', String(active));
+ });
+
+ settingsNavLinks.forEach((link) => {
+ link.hidden = role !== 'system';
+ });
+
+ if (!accessibleRealms().includes(currentRealm)) {
+ currentRealm = accessibleRealms()[0] || 'acme';
+ }
+
+ syncSelector();
+ renderHosts();
+ syncRealmLinks();
+ syncUrl();
+ }
+
+ roleButtons.forEach((button) => {
+ button.addEventListener('click', () => setRole(button.dataset.roleTarget));
+ });
+
+ const selectObserver = new MutationObserver(() => {
+ const value = realmSelect.dataset.value;
+ if (value && value !== currentRealm) {
+ currentRealm = value;
+ renderHosts();
+ syncSelector();
+ syncRealmLinks();
+ syncUrl();
+ }
+ });
+ selectObserver.observe(realmSelect, { attributes: true, attributeFilter: ['data-value'] });
+
+ const createDialog = document.getElementById('hosts-create-dialog');
+ const createForm = document.getElementById('hosts-create-form');
+ const createAlert = document.getElementById('hosts-create-alert');
+ const hostInput = document.getElementById('hosts-host-input');
+
+ function normalizeHostname(value) {
+ return value.trim().toLowerCase();
+ }
+
+ function hostnameError(raw) {
+ const value = raw.trim();
+ const host = normalizeHostname(value);
+
+ if (!host) return 'Hostname is required.';
+ if (/\s/.test(value)) return 'Hostname must not contain spaces.';
+ if (host.includes('://') || /^[a-z][a-z0-9+.-]*:\/\//i.test(value)) {
+ return 'Hostname must not include a scheme such as https://.';
+ }
+ if (host.includes('@')) return 'Hostname must not include @.';
+ if (host.includes('/')) return 'Hostname must not include a path.';
+ if (host.includes('*')) return 'Wildcard hostnames are not supported.';
+ if (host.startsWith('[')) {
+ if (!host.endsWith(']')) return 'Enter a valid IPv6 hostname.';
+ } else if (host.includes(':')) {
+ return 'Hostname must not include a port.';
+ }
+ if (host.length > 253) return 'Hostname must be 253 characters or fewer.';
+ if (host.startsWith('.') || host.endsWith('.')) return 'Hostname must not start or end with a dot.';
+
+ const labels = host.replace(/^\[|\]$/g, '').split('.');
+ if (!host.startsWith('[') && labels.length < 2) return 'Enter a complete hostname such as login.acme.test.';
+ for (const label of host.startsWith('[') ? [] : labels) {
+ if (!/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/.test(label)) {
+ return 'Hostname labels may use lowercase letters, numbers and hyphens.';
+ }
+ if (label.length > 63) return 'Each hostname label must be 63 characters or fewer.';
+ }
+
+ if (hostAssignments[host]?.reserved) return 'This hostname is reserved for the authentication service.';
+
+ const assignment = hostAssignments[host];
+ if (assignment) {
+ if (assignment.client) {
+ return currentRole.value === 'system'
+ ? 'This hostname is already assigned to a client application.'
+ : 'This hostname is already assigned.';
+ }
+ if (assignment.realm === currentRealm) return 'This hostname is already assigned to this realm.';
+ if (currentRole.value === 'system') {
+ return `This hostname is already assigned to ${realmInfo[assignment.realm].label}.`;
+ }
+ return 'This hostname is already assigned to another realm.';
+ }
+
+ return null;
+ }
+
+ function clearCreateError() {
+ createAlert.hidden = true;
+ createAlert.textContent = '';
+ hostInput.removeAttribute('aria-invalid');
+ }
+
+ function showCreateError(message) {
+ createAlert.hidden = false;
+ createAlert.textContent = message;
+ hostInput.setAttribute('aria-invalid', 'true');
+ }
+
+ function resetCreateForm() {
+ createForm.reset();
+ clearCreateError();
+ }
+
+ addButton.addEventListener('click', () => {
+ resetCreateForm();
+ createDialog.hidden = false;
+ requestAnimationFrame(() => hostInput.focus());
+ });
+
+ hostInput.addEventListener('input', clearCreateError);
+
+ createForm.addEventListener('submit', (event) => {
+ event.preventDefault();
+ const host = normalizeHostname(hostInput.value);
+ const error = hostnameError(hostInput.value);
+ if (error) {
+ showCreateError(error);
+ return;
+ }
+
+ hosts[currentRealm].unshift({ host, added: 'Just now' });
+ hostAssignments[host] = { realm: currentRealm };
+ createDialog.hidden = true;
+ renderHosts();
+ showNotice(`Host ${host} added.`);
+ });
+
+ const removeDialog = document.getElementById('hosts-remove-dialog');
+ const removeMessage = document.getElementById('hosts-remove-message');
+ const removeInput = document.getElementById('hosts-remove-confirm');
+ const confirmRemoveButton = document.getElementById('hosts-remove-confirm-button');
+ let pendingRemoveHost = '';
+
+ function openRemoveDialog(host) {
+ pendingRemoveHost = host;
+ const realmLabel = realmInfo[currentRealm].label;
+ removeMessage.textContent = `Remove ${host}? This hostname will stop resolving to ${realmLabel}. Sessions for this realm on that host will end. Realm settings, clients and users are unaffected.`;
+ removeInput.value = '';
+ removeInput.placeholder = host;
+ confirmRemoveButton.disabled = true;
+ removeDialog.hidden = false;
+ requestAnimationFrame(() => removeInput.focus());
+ }
+
+ removeInput.addEventListener('input', () => {
+ confirmRemoveButton.disabled = normalizeHostname(removeInput.value) !== pendingRemoveHost;
+ });
+
+ confirmRemoveButton.addEventListener('click', () => {
+ if (!pendingRemoveHost || confirmRemoveButton.disabled) return;
+
+ hosts[currentRealm] = (hosts[currentRealm] || []).filter((entry) => entry.host !== pendingRemoveHost);
+ delete hostAssignments[pendingRemoveHost];
+ const removed = pendingRemoveHost;
+ pendingRemoveHost = '';
+ removeDialog.hidden = true;
+ renderHosts();
+ showNotice(`Host ${removed} removed.`);
+ });
+
+ hostsRows.addEventListener('click', (event) => {
+ const removeButton = event.target.closest('[data-remove-host]');
+ if (removeButton) {
+ event.stopPropagation();
+ openRemoveDialog(removeButton.dataset.removeHost);
+ }
+ });
+
+ searchInput.addEventListener('input', applySearch);
+
+ const initialParams = new URLSearchParams(window.location.search);
+ const initialTheme = initialParams.get('theme');
+ if (initialTheme === 'light' || initialTheme === 'dark') setTheme(initialTheme);
+
+ const initialRole = initialParams.get('role');
+ if (identities[initialRole]) currentRole.value = initialRole;
+
+ const initialRealm = initialParams.get('realm');
+ if (realmInfo[initialRealm] && realmInfo[initialRealm].roles.includes(currentRole.value)) {
+ currentRealm = initialRealm;
+ } else {
+ currentRealm = accessibleRealms()[0] || 'acme';
+ }
+
+ setRole(currentRole.value);
+ </script>
+ <script src="./shell.js"></script>
+ </body>
+</html>
diff --git a/mockup/plain/admin-realms.html b/mockup/plain/admin-realms.html
@@ -13,15 +13,27 @@
line-height: 1.4;
}
- .realm-meta > span {
+ .realm-meta > span,
+ .realm-meta > a {
display: inline;
margin-right: 0.75rem;
}
- .realm-meta > span:last-child {
+ .realm-meta > span:last-child,
+ .realm-meta > a:last-child {
margin-right: 0;
}
+ .realm-count-link {
+ color: var(--muted);
+ text-decoration: none;
+ }
+
+ .realm-count-link:hover {
+ color: var(--accent-text);
+ text-decoration: underline;
+ }
+
.realm-slug,
.realm-owner-meta {
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
@@ -51,9 +63,39 @@
align-items: center;
}
- .realm-row-action .button-danger {
- width: 100%;
+ .action-button {
+ display: inline-flex;
+ align-items: center;
+ min-height: 2rem;
+ padding: 0.25rem 0.625rem;
+ border: 0;
+ border-radius: 0.25rem;
+ background: transparent;
+ color: var(--muted);
+ font: inherit;
+ font-size: 0.8125rem;
+ font-weight: 500;
+ line-height: 1.4;
white-space: nowrap;
+ cursor: pointer;
+ }
+
+ .action-button:hover {
+ background: var(--row-hover);
+ color: var(--text);
+ }
+
+ .action-button:first-child {
+ margin-left: -0.625rem;
+ }
+
+ .action-button.is-danger {
+ color: var(--danger-text);
+ }
+
+ .action-button.is-danger:hover {
+ background: color-mix(in srgb, var(--danger) 12%, transparent);
+ color: var(--danger-text);
}
.field-grid {
@@ -153,7 +195,8 @@
gap: 0.25rem 0.75rem;
}
- .realm-meta > span {
+ .realm-meta > span,
+ .realm-meta > a {
margin-right: 0;
}
@@ -176,10 +219,6 @@
.realm-row-action {
justify-content: flex-start;
}
-
- .realm-row-action .button-danger {
- width: auto;
- }
}
</style>
</head>
@@ -457,8 +496,8 @@
<span class="realm-meta">
<span class="realm-slug">acme</span>
<span class="realm-count">6 members</span>
- <span class="realm-count">2 hosts</span>
- <span class="realm-count">3 domains</span>
+ <a class="realm-count realm-count-link" data-count-kind="hosts" href="./admin-realm-hosts.html?realm=acme">2 hosts</a>
+ <a class="realm-count realm-count-link" data-count-kind="domains" href="./admin-realm-email-domains.html?realm=acme">3 domains</a>
<span class="realm-count">4 clients</span>
</span>
</td>
@@ -468,7 +507,7 @@
</td>
<td class="realm-action-column" data-label="Actions">
<div class="realm-row-action">
- <button class="button-danger" type="button" data-delete-realm>Delete realm</button>
+ <button class="action-button is-danger" type="button" data-delete-realm>Delete realm</button>
</div>
</td>
</tr>
@@ -498,8 +537,8 @@
<span class="realm-meta">
<span class="realm-slug">globex</span>
<span class="realm-count">5 members</span>
- <span class="realm-count">1 host</span>
- <span class="realm-count">1 domain</span>
+ <a class="realm-count realm-count-link" data-count-kind="hosts" href="./admin-realm-hosts.html?realm=globex">1 host</a>
+ <a class="realm-count realm-count-link" data-count-kind="domains" href="./admin-realm-email-domains.html?realm=globex">1 domain</a>
<span class="realm-count">2 clients</span>
</span>
</td>
@@ -509,7 +548,7 @@
</td>
<td class="realm-action-column" data-label="Actions">
<div class="realm-row-action">
- <button class="button-danger" type="button" data-delete-realm>Delete realm</button>
+ <button class="action-button is-danger" type="button" data-delete-realm>Delete realm</button>
</div>
</td>
</tr>
@@ -539,8 +578,8 @@
<span class="realm-meta">
<span class="realm-slug">northwind</span>
<span class="realm-count">0 members</span>
- <span class="realm-count">0 hosts</span>
- <span class="realm-count">0 domains</span>
+ <a class="realm-count realm-count-link" data-count-kind="hosts" href="./admin-realm-hosts.html?realm=northwind">0 hosts</a>
+ <a class="realm-count realm-count-link" data-count-kind="domains" href="./admin-realm-email-domains.html?realm=northwind">0 domains</a>
<span class="realm-count">0 clients</span>
</span>
</td>
@@ -550,7 +589,7 @@
</td>
<td class="realm-action-column" data-label="Actions">
<div class="realm-row-action">
- <button class="button-danger" type="button" data-delete-realm>Delete realm</button>
+ <button class="action-button is-danger" type="button" data-delete-realm>Delete realm</button>
</div>
</td>
</tr>
@@ -705,6 +744,8 @@
userThemeValues.forEach((element) => {
element.textContent = value.charAt(0).toUpperCase() + value.slice(1);
});
+
+ if (typeof refreshRealmLinks === 'function') refreshRealmLinks();
}
themeButtons.forEach((button) => {
@@ -830,6 +871,29 @@
settingsNavLinks.forEach((link) => {
link.hidden = currentRole.value !== 'system';
});
+ refreshRealmLinks();
+ }
+
+ const countLinkTargets = {
+ hosts: './admin-realm-hosts.html',
+ domains: './admin-realm-email-domains.html',
+ };
+
+ function refreshRealmLinks() {
+ realmRowList().forEach((row) => {
+ const slugEl = row.querySelector('.realm-slug');
+ if (!slugEl) return;
+ const slug = slugEl.textContent.trim();
+ row.querySelectorAll('[data-count-kind]').forEach((link) => {
+ const target = countLinkTargets[link.dataset.countKind];
+ if (!target) return;
+ const params = new URLSearchParams();
+ params.set('realm', slug);
+ params.set('role', currentRole.value);
+ if (currentTheme !== 'auto') params.set('theme', currentTheme);
+ link.setAttribute('href', `${target}?${params.toString()}`);
+ });
+ });
}
function setRole(role) {
@@ -1074,8 +1138,8 @@
<span class="realm-meta">
<span class="realm-slug">${escapeHtml(slug)}</span>
<span class="realm-count">0 members</span>
- <span class="realm-count">0 hosts</span>
- <span class="realm-count">0 domains</span>
+ <a class="realm-count realm-count-link" data-count-kind="hosts" href="./admin-realm-hosts.html?realm=${escapeHtml(slug)}">0 hosts</a>
+ <a class="realm-count realm-count-link" data-count-kind="domains" href="./admin-realm-email-domains.html?realm=${escapeHtml(slug)}">0 domains</a>
<span class="realm-count">0 clients</span>
</span>
</td>
@@ -1085,7 +1149,7 @@
</td>
<td class="realm-action-column" data-label="Actions">
<div class="realm-row-action">
- <button class="button-danger" type="button" data-delete-realm>Delete realm</button>
+ <button class="action-button is-danger" type="button" data-delete-realm>Delete realm</button>
</div>
</td>`;
realmRows.prepend(row);
@@ -1209,7 +1273,12 @@
searchInput.addEventListener('input', applySearch);
resetCreateForm();
- setRole('system');
+
+ const initialParams = new URLSearchParams(window.location.search);
+ const initialTheme = initialParams.get('theme');
+ if (initialTheme === 'light' || initialTheme === 'dark') setTheme(initialTheme);
+ const initialRole = initialParams.get('role');
+ setRole(identities[initialRole] ? initialRole : 'system');
</script>
<script src="./shell.js"></script>
</body>
diff --git a/mockup/plain/admin-settings.html b/mockup/plain/admin-settings.html
@@ -102,6 +102,25 @@
margin-bottom: 0.75rem;
}
+ .realm-access-links {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 0.75rem;
+ margin-top: 1rem;
+ }
+
+ .realm-access-count {
+ margin-left: 0.375rem;
+ opacity: 0.7;
+ }
+
+ @media (max-width: 39.999em) {
+ .realm-access-links .button-secondary {
+ width: 100%;
+ text-align: center;
+ }
+ }
+
@media (min-width: 40em) {
.field-grid {
grid-template-columns: repeat(2, minmax(0, 1fr));
@@ -330,7 +349,7 @@
<div class="client-breadcrumb">
<a id="realm-breadcrumb-link" href="./admin-realms.html"><span data-realm-breadcrumb-root>Realms</span></a>
<span id="realm-breadcrumb-root-text" hidden><span data-realm-breadcrumb-root>Realm</span></span>
- <span id="realm-breadcrumb-separator" aria-hidden="true">/</span>
+ <span id="realm-breadcrumb-separator">/</span>
<span aria-current="page">Acme</span>
</div>
<h1>Realm settings</h1>
@@ -433,6 +452,15 @@
</div>
</div>
</section>
+
+ <section class="panel realm-access-panel">
+ <h2>Realm access</h2>
+ <p class="note">Configure the hostnames and email domains that route to this realm.</p>
+ <div class="realm-access-links">
+ <a id="settings-hosts-link" class="button-secondary" href="./admin-realm-hosts.html?realm=acme">Hosts <span class="realm-access-count">2</span></a>
+ <a id="settings-domains-link" class="button-secondary" href="./admin-realm-email-domains.html?realm=acme">Email domains <span class="realm-access-count">3</span></a>
+ </div>
+ </section>
</div>
<section class="state-preview">
@@ -602,6 +630,8 @@
const userThemeButtons = document.querySelectorAll('[data-user-theme]');
const userThemeValues = document.querySelectorAll('[data-user-theme-value]');
let currentTheme = 'auto';
+ let currentRealm = 'acme';
+ let currentRole = 'system';
function setTheme(value) {
currentTheme = value;
@@ -616,6 +646,8 @@
userThemeValues.forEach((element) => {
element.textContent = value.charAt(0).toUpperCase() + value.slice(1);
});
+
+ if (typeof syncAccessLinks === 'function') syncAccessLinks();
}
const queryTheme = new URLSearchParams(window.location.search).get('theme');
@@ -655,7 +687,24 @@
const realmBreadcrumbRootText = document.getElementById('realm-breadcrumb-root-text');
const realmBreadcrumbRootLabels = document.querySelectorAll('[data-realm-breadcrumb-root]');
+ const hostsLink = document.getElementById('settings-hosts-link');
+ const domainsLink = document.getElementById('settings-domains-link');
+
+ function subpageParams(realm) {
+ const params = new URLSearchParams();
+ params.set('realm', realm);
+ params.set('role', currentRole);
+ if (currentTheme !== 'auto') params.set('theme', currentTheme);
+ return params.toString();
+ }
+
+ function syncAccessLinks() {
+ if (hostsLink) hostsLink.href = `./admin-realm-hosts.html?${subpageParams(currentRealm)}`;
+ if (domainsLink) domainsLink.href = `./admin-realm-email-domains.html?${subpageParams(currentRealm)}`;
+ }
+
function setRole(role) {
+ currentRole = role;
const count = realmCounts[role] || 0;
const label = count === 1 ? 'Realm' : 'Realms';
const identity = identities[role];
@@ -674,7 +723,9 @@
realmNavLabels.forEach((element) => {
element.textContent = label;
});
- const realmHref = count === 1 ? './admin-settings.html' : './admin-realms.html';
+ const realmHref = count === 1
+ ? `./admin-settings.html?${subpageParams(currentRealm)}`
+ : `./admin-realms.html?${subpageParams(currentRealm)}`;
realmNavLinks.forEach((link) => {
link.href = realmHref;
link.classList.toggle('is-active', true);
@@ -688,12 +739,17 @@
});
realmBreadcrumbLink.hidden = count === 1;
realmBreadcrumbRootText.hidden = count !== 1;
+ syncAccessLinks();
}
roleButtons.forEach((button) => {
button.addEventListener('click', () => setRole(button.dataset.roleTarget));
});
- setRole('system');
+ const initialParams = new URLSearchParams(window.location.search);
+ const initialRealm = initialParams.get('realm');
+ if (initialRealm) currentRealm = initialRealm;
+ const initialRole = initialParams.get('role');
+ setRole(identities[initialRole] ? initialRole : 'system');
</script>
<script src="./shell.js"></script>
</body>
diff --git a/mockup/plain/global.css b/mockup/plain/global.css
@@ -21,6 +21,8 @@
--skeleton: #00000012;
--danger: #c9190b;
--danger-text: #c9190b;
+ --warn: #a15c00;
+ --warn-bg: #a15c001a;
--field-line: rgba(0, 0, 0, 0.42);
--shadow: 0 0.125em 0.25em #0008;
--hex: url('./hex-grid-light.svg');
@@ -1410,6 +1412,8 @@ summary:focus-visible {
--row-hover: #ffffff14;
--skeleton: #ffffff14;
--danger-text: #f28b82;
+ --warn: #e0a63d;
+ --warn-bg: #e0a63d26;
--field-line: rgba(255, 255, 255, 0.42);
--hex: url('./hex-grid-dark.svg');
color-scheme: dark;
@@ -1432,6 +1436,8 @@ summary:focus-visible {
--row-hover: #ffffff14;
--skeleton: #ffffff14;
--danger-text: #f28b82;
+ --warn: #e0a63d;
+ --warn-bg: #e0a63d26;
--field-line: rgba(255, 255, 255, 0.42);
--hex: url('./hex-grid-dark.svg');
color-scheme: dark;