admin-realm-email-domains.html (45756B)
1 <!doctype html> 2 <html lang="en"> 3 <head> 4 <meta charset="utf-8" /> 5 <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" /> 6 <title>Admin realm email domains mockup</title> 7 <link rel="stylesheet" href="../../app/shared/style/global.css" /> 8 <link rel="stylesheet" href="../../app/shared/component/select-menu.css" /> 9 <link rel="stylesheet" href="../../app/shared/component/user-menu.css" /> 10 <link rel="stylesheet" href="./mockups.css" /> 11 </head> 12 <body> 13 <header class="topbar"> 14 <a class="brand" href="./admin-dashboard.html"> 15 <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"> 16 <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" /> 17 </svg> 18 <span class="brand-name">Auth</span> 19 </a> 20 <div class="topbar-actions"> 21 <button class="mobile-nav-toggle" type="button" id="mobile-nav-toggle" aria-controls="mobile-navigation" aria-expanded="false" aria-label="Open navigation"> 22 <span class="mobile-nav-toggle-bars" aria-hidden="true"></span> 23 </button> 24 <details class="menu user-menu"> 25 <summary class="menu-trigger" aria-label="Account menu"> 26 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> 27 <circle cx="12" cy="12" r="10" /> 28 <circle cx="12" cy="10" r="3" /> 29 <path d="M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662" /> 30 </svg> 31 </summary> 32 <div class="menu-panel"> 33 <div class="menu-heading"> 34 <span class="menu-heading-title">System Admin</span> 35 <span class="menu-heading-meta">admin@system.test</span> 36 </div> 37 <div class="menu-list"> 38 <a class="menu-item" href="#"> 39 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> 40 <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" /> 41 <circle cx="12" cy="12" r="3" /> 42 </svg> 43 <span>Account settings</span> 44 </a> 45 <button class="menu-item" type="button" data-user-theme> 46 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> 47 <circle cx="12" cy="12" r="4" /> 48 <path d="M12 2v2" /> 49 <path d="M12 20v2" /> 50 <path d="m4.93 4.93 1.41 1.41" /> 51 <path d="m17.66 17.66 1.41 1.41" /> 52 <path d="M2 12h2" /> 53 <path d="M20 12h2" /> 54 <path d="m6.34 17.66-1.41 1.41" /> 55 <path d="m19.07 4.93-1.41 1.41" /> 56 </svg> 57 <span>Theme</span> 58 <span class="menu-value" data-user-theme-value>Auto</span> 59 </button> 60 <a class="menu-item" href="#"> 61 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> 62 <path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" /> 63 <path d="m16 17 5-5-5-5" /> 64 <path d="M21 12H9" /> 65 </svg> 66 <span>Sign out</span> 67 </a> 68 </div> 69 </div> 70 </details> 71 </div> 72 </header> 73 74 <div class="mobile-nav" id="mobile-navigation" aria-hidden="true"> 75 <nav class="nav" aria-label="Administration"> 76 <p class="nav-label">Administration</p> 77 <a class="nav-item" href="./admin-dashboard.html"> 78 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> 79 <rect x="3" y="3" width="7" height="7" /> 80 <rect x="14" y="3" width="7" height="7" /> 81 <rect x="3" y="14" width="7" height="7" /> 82 <rect x="14" y="14" width="7" height="7" /> 83 </svg> 84 <span>Overview</span> 85 </a> 86 <a class="nav-item is-active" data-realm-nav href="./admin-realms.html"> 87 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> 88 <path d="M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z" /> 89 <path d="M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2" /> 90 <path d="M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2" /> 91 <path d="M10 6h4" /> 92 <path d="M10 10h4" /> 93 <path d="M10 14h4" /> 94 <path d="M10 18h4" /> 95 </svg> 96 <span data-realm-nav-label>Realms</span> 97 </a> 98 <a class="nav-item" href="./admin-clients.html"> 99 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> 100 <rect x="2" y="4" width="20" height="16" rx="2" /> 101 <path d="M10 4v4" /> 102 <path d="M2 8h20" /> 103 <path d="M6 4v4" /> 104 </svg> 105 <span>Clients</span> 106 </a> 107 <a class="nav-item" href="#"> 108 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> 109 <path d="M22 12h-4l-3 8-6-16-3 8H2" /> 110 </svg> 111 <span>Sessions</span> 112 </a> 113 <a class="nav-item" href="./admin-users.html"> 114 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> 115 <path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" /> 116 <circle cx="12" cy="7" r="4" /> 117 </svg> 118 <span>Users</span> 119 </a> 120 <a class="nav-item" data-settings-nav href="./admin-system-settings.html"> 121 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> 122 <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" /> 123 <circle cx="12" cy="12" r="3" /> 124 </svg> 125 <span>Settings</span> 126 </a> 127 </nav> 128 <div class="mobile-nav-divider" aria-hidden="true"></div> 129 <section class="mobile-nav-account" aria-label="Account"> 130 <div class="menu-heading"> 131 <span class="menu-heading-title">System Admin</span> 132 <span class="menu-heading-meta">admin@system.test</span> 133 </div> 134 <div class="menu-list"> 135 <a class="menu-item" href="#"> 136 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> 137 <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" /> 138 <circle cx="12" cy="12" r="3" /> 139 </svg> 140 <span>Account settings</span> 141 </a> 142 <button class="menu-item" type="button" data-user-theme> 143 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> 144 <circle cx="12" cy="12" r="4" /> 145 <path d="M12 2v2" /> 146 <path d="M12 20v2" /> 147 <path d="m4.93 4.93 1.41 1.41" /> 148 <path d="m17.66 17.66 1.41 1.41" /> 149 <path d="M2 12h2" /> 150 <path d="M20 12h2" /> 151 <path d="m6.34 17.66-1.41 1.41" /> 152 <path d="m19.07 4.93-1.41 1.41" /> 153 </svg> 154 <span>Theme</span> 155 <span class="menu-value" data-user-theme-value>Auto</span> 156 </button> 157 <a class="menu-item" href="#"> 158 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> 159 <path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" /> 160 <path d="m16 17 5-5-5-5" /> 161 <path d="M21 12H9" /> 162 </svg> 163 <span>Sign out</span> 164 </a> 165 </div> 166 </section> 167 </div> 168 169 <div class="app"> 170 <aside class="sidebar"> 171 <nav class="nav" aria-label="Administration"> 172 <p class="nav-label">Administration</p> 173 <a class="nav-item" href="./admin-dashboard.html"> 174 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> 175 <rect x="3" y="3" width="7" height="7" /> 176 <rect x="14" y="3" width="7" height="7" /> 177 <rect x="3" y="14" width="7" height="7" /> 178 <rect x="14" y="14" width="7" height="7" /> 179 </svg> 180 <span>Overview</span> 181 </a> 182 <a class="nav-item is-active" data-realm-nav href="./admin-realms.html"> 183 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> 184 <path d="M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z" /> 185 <path d="M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2" /> 186 <path d="M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2" /> 187 <path d="M10 6h4" /> 188 <path d="M10 10h4" /> 189 <path d="M10 14h4" /> 190 <path d="M10 18h4" /> 191 </svg> 192 <span data-realm-nav-label>Realms</span> 193 </a> 194 <a class="nav-item" href="./admin-clients.html"> 195 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> 196 <rect x="2" y="4" width="20" height="16" rx="2" /> 197 <path d="M10 4v4" /> 198 <path d="M2 8h20" /> 199 <path d="M6 4v4" /> 200 </svg> 201 <span>Clients</span> 202 </a> 203 <a class="nav-item" href="#"> 204 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> 205 <path d="M22 12h-4l-3 8-6-16-3 8H2" /> 206 </svg> 207 <span>Sessions</span> 208 </a> 209 <a class="nav-item" href="./admin-users.html"> 210 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> 211 <path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" /> 212 <circle cx="12" cy="7" r="4" /> 213 </svg> 214 <span>Users</span> 215 </a> 216 <a class="nav-item" data-settings-nav href="./admin-system-settings.html"> 217 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> 218 <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" /> 219 <circle cx="12" cy="12" r="3" /> 220 </svg> 221 <span>Settings</span> 222 </a> 223 </nav> 224 </aside> 225 226 <div class="main"> 227 <main class="content"> 228 <div class="page-header page-header-row"> 229 <div> 230 <div class="breadcrumb"> 231 <a id="domains-breadcrumb-root" href="./admin-realms.html"><span data-realm-breadcrumb-root>Realms</span></a> 232 <span>/</span> 233 <a id="domains-breadcrumb-realm" href="./admin-settings.html?realm=acme">Acme</a> 234 <span>/</span> 235 <span aria-current="page">Email domains</span> 236 </div> 237 <h1>Email domains</h1> 238 <p>Domains used to assign new accounts to this realm.</p> 239 </div> 240 <div class="field"> 241 <span class="field-label" id="domains-realm-label">Realm</span> 242 <div class="select" id="domains-realm-select" data-select data-value="acme"> 243 <button 244 class="select-trigger" 245 type="button" 246 id="domains-realm-trigger" 247 role="combobox" 248 aria-haspopup="listbox" 249 aria-expanded="false" 250 aria-controls="domains-realm-listbox" 251 aria-labelledby="domains-realm-label" 252 > 253 <span class="select-value">Acme</span> 254 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> 255 <path d="m6 9 6 6 6-6" /> 256 </svg> 257 </button> 258 <div class="select-list" id="domains-realm-listbox" role="listbox" aria-labelledby="domains-realm-label" hidden> 259 <div class="select-option is-selected" id="domains-realm-acme" role="option" aria-selected="true" data-value="acme" data-label="Acme"> 260 <span class="select-option-mark" aria-hidden="true"> 261 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> 262 <path d="M20 6 9 17l-5-5" /> 263 </svg> 264 </span> 265 <span class="select-option-label">Acme</span> 266 </div> 267 <div class="select-option" id="domains-realm-globex" role="option" aria-selected="false" data-value="globex" data-label="Globex"> 268 <span class="select-option-mark" aria-hidden="true"> 269 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> 270 <path d="M20 6 9 17l-5-5" /> 271 </svg> 272 </span> 273 <span class="select-option-label">Globex</span> 274 </div> 275 <div class="select-option" id="domains-realm-northwind" role="option" aria-selected="false" data-value="northwind" data-label="Northwind"> 276 <span class="select-option-mark" aria-hidden="true"> 277 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> 278 <path d="M20 6 9 17l-5-5" /> 279 </svg> 280 </span> 281 <span class="select-option-label">Northwind</span> 282 </div> 283 </div> 284 </div> 285 </div> 286 </div> 287 288 <div id="domains-notice" class="notice" role="status" hidden></div> 289 290 <section class="card" aria-labelledby="domains-table-title"> 291 <h2 id="domains-table-title" class="sr-only">Realm email domains</h2> 292 <div class="toolbar toolbar-panel"> 293 <div class="toolbar-search"> 294 <input id="domains-search" type="search" aria-label="Search email domains" placeholder="Search email domains" /> 295 </div> 296 <div class="toolbar-actions"> 297 <button id="domains-add-button" class="button button-primary" type="button">Add email domain</button> 298 </div> 299 </div> 300 301 <table class="table"> 302 <thead> 303 <tr> 304 <th scope="col">Domain</th> 305 <th scope="col">Status</th> 306 <th scope="col">Actions</th> 307 </tr> 308 </thead> 309 <tbody id="domains-rows"></tbody> 310 </table> 311 <p id="domains-search-empty" class="empty" hidden>No email domains match this search.</p> 312 <p id="domains-realm-empty" class="empty" hidden>No email domains are assigned to this realm.</p> 313 </section> 314 315 <section class="state-preview"> 316 <h2>Loading state</h2> 317 <div class="panel" aria-busy="true"> 318 <div class="skeleton skeleton-title"></div> 319 <div class="skeleton"></div> 320 <div class="skeleton skeleton-short"></div> 321 </div> 322 </section> 323 </main> 324 </div> 325 </div> 326 327 <div id="domains-create-dialog" class="overlay" hidden> 328 <form id="domains-create-form" class="modal" role="dialog" aria-modal="true" aria-labelledby="domains-create-title" novalidate> 329 <div class="modal-header"> 330 <h2 id="domains-create-title">Add email domain</h2> 331 <button class="modal-close" type="button" aria-label="Close dialog" data-dialog-close> 332 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> 333 <path d="M18 6 6 18" /> 334 <path d="m6 6 12 12" /> 335 </svg> 336 </button> 337 </div> 338 <div class="modal-body"> 339 <div id="domains-create-alert" class="alert" role="alert" hidden></div> 340 341 <label class="field" for="domains-domain-input"> 342 <span class="field-label">Email domain</span> 343 <input id="domains-domain-input" class="field-control" type="text" maxlength="253" placeholder="acme.test" autocomplete="off" spellcheck="false" /> 344 </label> 345 <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> 346 347 <div class="modal-actions"> 348 <button class="button button-secondary" type="button" data-dialog-close>Cancel</button> 349 <button class="button button-primary" type="submit">Add domain</button> 350 </div> 351 </div> 352 </form> 353 </div> 354 355 <div id="domains-verify-dialog" class="overlay" hidden> 356 <div class="modal" role="dialog" aria-modal="true" aria-labelledby="domains-verify-title"> 357 <div class="modal-header"> 358 <h2 id="domains-verify-title">Verify email domain</h2> 359 <button class="modal-close" type="button" aria-label="Close dialog" data-dialog-close> 360 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> 361 <path d="M18 6 6 18" /> 362 <path d="m6 6 12 12" /> 363 </svg> 364 </button> 365 </div> 366 <div class="modal-body"> 367 <p id="domains-verify-message" class="modal-note"></p> 368 369 <div class="field"> 370 <span class="field-label" id="domains-verify-name-label">TXT record name</span> 371 <input id="domains-verify-name" class="field-control u-mono" type="text" readonly aria-labelledby="domains-verify-name-label" /> 372 </div> 373 374 <div class="field"> 375 <span class="field-label" id="domains-verify-value-label">TXT record value</span> 376 <input id="domains-verify-value" class="field-control u-mono" type="text" readonly aria-labelledby="domains-verify-value-label" /> 377 <button id="domains-verify-copy" class="button button-secondary verify-record-copy" type="button">Copy value</button> 378 </div> 379 380 <p class="modal-note">Automated DNS checking arrives in a later slice; mark the domain verified once the record is in place.</p> 381 382 <div class="modal-actions"> 383 <button class="button button-secondary" type="button" data-dialog-close>Close</button> 384 <button id="domains-verify-mark" class="button button-primary" type="button">Mark as verified</button> 385 </div> 386 </div> 387 </div> 388 </div> 389 390 <div id="domains-remove-dialog" class="overlay" hidden> 391 <div class="modal" role="dialog" aria-modal="true" aria-labelledby="domains-remove-title"> 392 <div class="modal-header"> 393 <h2 id="domains-remove-title">Remove email domain</h2> 394 <button class="modal-close" type="button" aria-label="Close dialog" data-dialog-close> 395 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> 396 <path d="M18 6 6 18" /> 397 <path d="m6 6 12 12" /> 398 </svg> 399 </button> 400 </div> 401 <div class="modal-body"> 402 <p id="domains-remove-message" class="modal-note"></p> 403 <label class="field" for="domains-remove-confirm"> 404 <span class="field-label">Confirm domain</span> 405 <input id="domains-remove-confirm" class="field-control" type="text" maxlength="253" autocomplete="off" spellcheck="false" /> 406 </label> 407 <p class="modal-note">Type the domain exactly to confirm.</p> 408 <div class="modal-actions"> 409 <button class="button button-secondary" type="button" data-dialog-close>Cancel</button> 410 <button id="domains-remove-confirm-button" class="button button-danger" type="button" disabled>Remove domain</button> 411 </div> 412 </div> 413 </div> 414 </div> 415 416 <div class="mockup-controls" aria-label="Mockup controls"> 417 <span class="mockup-label">Mockup</span> 418 <button class="mockup-button is-active" type="button" data-theme-target="auto">Auto</button> 419 <button class="mockup-button" type="button" data-theme-target="light">Light</button> 420 <button class="mockup-button" type="button" data-theme-target="dark">Dark</button> 421 <span class="mockup-separator" aria-hidden="true"></span> 422 <span class="mockup-label">View as</span> 423 <button class="mockup-button is-active" type="button" data-role-target="system" aria-pressed="true">System admin</button> 424 <button class="mockup-button" type="button" data-role-target="owner" aria-pressed="false">Realm owner</button> 425 <button class="mockup-button" type="button" data-role-target="admin" aria-pressed="false">Realm admin</button> 426 </div> 427 428 <script> 429 const root = document.documentElement; 430 const themeButtons = document.querySelectorAll('[data-theme-target]'); 431 const userThemeButtons = document.querySelectorAll('[data-user-theme]'); 432 const userThemeValues = document.querySelectorAll('[data-user-theme-value]'); 433 let currentTheme = 'auto'; 434 435 function setTheme(value) { 436 currentTheme = value; 437 if (value === 'auto') { 438 root.removeAttribute('data-theme'); 439 } else { 440 root.setAttribute('data-theme', value); 441 } 442 443 themeButtons.forEach((button) => { 444 button.classList.toggle('is-active', button.dataset.themeTarget === value); 445 }); 446 userThemeValues.forEach((element) => { 447 element.textContent = value.charAt(0).toUpperCase() + value.slice(1); 448 }); 449 450 if (typeof syncUrl === 'function') syncUrl(); 451 if (typeof syncRealmLinks === 'function') syncRealmLinks(); 452 } 453 454 themeButtons.forEach((button) => { 455 button.addEventListener('click', () => setTheme(button.dataset.themeTarget)); 456 }); 457 458 userThemeButtons.forEach((button) => { 459 button.addEventListener('click', () => { 460 const themes = ['auto', 'light', 'dark']; 461 setTheme(themes[(themes.indexOf(currentTheme) + 1) % themes.length]); 462 }); 463 }); 464 465 const userMenu = document.querySelector('.user-menu'); 466 document.addEventListener('click', (event) => { 467 if (userMenu && userMenu.open && !userMenu.contains(event.target)) { 468 userMenu.open = false; 469 } 470 }); 471 472 document.querySelectorAll('[data-dialog-close]').forEach((button) => { 473 button.addEventListener('click', () => { 474 button.closest('.overlay').hidden = true; 475 }); 476 }); 477 478 document.querySelectorAll('.overlay').forEach((overlay) => { 479 overlay.addEventListener('mousedown', (event) => { 480 if (event.target === overlay) overlay.hidden = true; 481 }); 482 }); 483 484 document.addEventListener('keydown', (event) => { 485 if (event.key === 'Escape') { 486 document.querySelectorAll('.overlay:not([hidden])').forEach((dialog) => { 487 dialog.hidden = true; 488 }); 489 } 490 }); 491 492 const identities = { 493 system: { name: 'System Admin', email: 'admin@system.test' }, 494 owner: { name: 'Realm Owner', email: 'owner@acme.test' }, 495 admin: { name: 'Realm Admin', email: 'realm-admin@managed.test' }, 496 }; 497 498 const realmInfo = { 499 acme: { label: 'Acme', roles: ['system', 'owner'] }, 500 globex: { label: 'Globex', roles: ['system', 'admin'] }, 501 northwind: { label: 'Northwind', roles: ['system'] }, 502 }; 503 const realmOrder = ['acme', 'globex', 'northwind']; 504 505 const domains = { 506 acme: [ 507 { domain: 'acme.test', status: 'verified', added: '12 Mar 2026' }, 508 { domain: 'sso.acme.test', status: 'verified', added: '12 Mar 2026' }, 509 { domain: 'employees.acme.test', status: 'pending', token: '6lPq3nJ2mVxT0sYc1BdKeR8w', added: '05 Nov 2026' }, 510 ], 511 globex: [{ domain: 'globex.test', status: 'verified', added: '04 Feb 2026' }], 512 northwind: [], 513 }; 514 515 const domainAssignments = { 516 'acme.test': { realm: 'acme' }, 517 'sso.acme.test': { realm: 'acme' }, 518 'employees.acme.test': { realm: 'acme' }, 519 'globex.test': { realm: 'globex' }, 520 }; 521 522 const currentRole = { value: 'system' }; 523 let currentRealm = 'acme'; 524 525 const roleButtons = document.querySelectorAll('[data-role-target]'); 526 const realmNavLinks = document.querySelectorAll('[data-realm-nav]'); 527 const realmNavLabels = document.querySelectorAll('[data-realm-nav-label]'); 528 const settingsNavLinks = document.querySelectorAll('[data-settings-nav]'); 529 const breadcrumbRootLink = document.getElementById('domains-breadcrumb-root'); 530 const breadcrumbRealmLink = document.getElementById('domains-breadcrumb-realm'); 531 const breadcrumbRootLabels = document.querySelectorAll('[data-realm-breadcrumb-root]'); 532 533 const realmSelect = document.getElementById('domains-realm-select'); 534 const realmSelectValue = realmSelect.querySelector('.select-value'); 535 const realmSelectOptions = [...realmSelect.querySelectorAll('.select-option')]; 536 537 const notice = document.getElementById('domains-notice'); 538 const searchInput = document.getElementById('domains-search'); 539 const searchEmpty = document.getElementById('domains-search-empty'); 540 const realmEmpty = document.getElementById('domains-realm-empty'); 541 const domainRows = document.getElementById('domains-rows'); 542 const addButton = document.getElementById('domains-add-button'); 543 544 function accessibleRealms() { 545 return realmOrder.filter((slug) => realmInfo[slug].roles.includes(currentRole.value)); 546 } 547 548 function domainRowList() { 549 return [...domainRows.querySelectorAll('.domain-row')]; 550 } 551 552 function showNotice(message) { 553 notice.textContent = message; 554 notice.hidden = false; 555 } 556 557 function escapeHtml(value) { 558 return String(value).replace(/[&<>"']/g, (character) => { 559 const entities = { '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }; 560 return entities[character]; 561 }); 562 } 563 564 function statusText(status) { 565 return status === 'verified' ? 'Verified' : 'Pending verification'; 566 } 567 568 function domainRowElement(entry) { 569 const row = document.createElement('tr'); 570 row.className = 'domain-row'; 571 row.dataset.search = entry.domain.toLowerCase(); 572 row.dataset.status = entry.status; 573 574 const verifyButton = 575 entry.status === 'pending' 576 ? `<button class="button-inline" type="button" data-verify-domain="${escapeHtml(entry.domain)}">Verify</button>` 577 : ''; 578 579 const isPending = entry.status === 'pending'; 580 581 row.innerHTML = ` 582 <td data-label="Domain"><span class="table-mono">${escapeHtml(entry.domain)}</span></td> 583 <td data-label="Status"> 584 <span class="status${isPending ? ' status-warn' : ''}"><span class="status-dot" aria-hidden="true"></span>${statusText(entry.status)}</span> 585 </td> 586 <td data-label="Actions"> 587 ${verifyButton} 588 <button class="button-inline button-danger" type="button" data-remove-domain="${escapeHtml(entry.domain)}">Remove</button> 589 </td>`; 590 return row; 591 } 592 593 function renderDomains() { 594 const list = domains[currentRealm] || []; 595 domainRows.replaceChildren(...list.map(domainRowElement)); 596 applySearch(); 597 } 598 599 function applySearch() { 600 const term = searchInput.value.trim().toLowerCase(); 601 const total = (domains[currentRealm] || []).length; 602 let visible = 0; 603 604 domainRowList().forEach((row) => { 605 const match = !term || (row.dataset.search || '').includes(term); 606 row.hidden = !match; 607 if (match) visible += 1; 608 }); 609 610 searchEmpty.hidden = total === 0 || visible !== 0; 611 realmEmpty.hidden = total !== 0; 612 } 613 614 function syncSelector() { 615 realmSelectOptions.forEach((option) => { 616 const slug = option.dataset.value; 617 const accessible = realmInfo[slug].roles.includes(currentRole.value); 618 option.hidden = !accessible; 619 const selected = slug === currentRealm; 620 option.classList.toggle('is-selected', selected); 621 option.setAttribute('aria-selected', String(selected)); 622 }); 623 realmSelectValue.textContent = realmInfo[currentRealm].label; 624 realmSelect.dataset.value = currentRealm; 625 } 626 627 function subpageUrl(path) { 628 const params = new URLSearchParams(); 629 params.set('realm', currentRealm); 630 params.set('role', currentRole.value); 631 if (currentTheme !== 'auto') params.set('theme', currentTheme); 632 return `./${path}?${params.toString()}`; 633 } 634 635 function realmListParams() { 636 const params = new URLSearchParams(); 637 params.set('role', currentRole.value); 638 if (currentTheme !== 'auto') params.set('theme', currentTheme); 639 return params.toString(); 640 } 641 642 function realmNavHref() { 643 return accessibleRealms().length === 1 644 ? subpageUrl('admin-settings.html') 645 : `./admin-realms.html?${realmListParams()}`; 646 } 647 648 function syncRealmLinks() { 649 const count = accessibleRealms().length; 650 const label = count === 1 ? 'Realm' : 'Realms'; 651 const href = realmNavHref(); 652 653 realmNavLabels.forEach((element) => { 654 element.textContent = label; 655 }); 656 realmNavLinks.forEach((link) => { 657 link.href = href; 658 link.classList.add('is-active'); 659 link.removeAttribute('aria-current'); 660 }); 661 breadcrumbRootLabels.forEach((element) => { 662 element.textContent = label; 663 }); 664 breadcrumbRootLink.href = href; 665 breadcrumbRealmLink.textContent = realmInfo[currentRealm].label; 666 breadcrumbRealmLink.href = subpageUrl('admin-settings.html'); 667 } 668 669 function syncUrl() { 670 const params = new URLSearchParams(); 671 params.set('realm', currentRealm); 672 params.set('role', currentRole.value); 673 if (currentTheme !== 'auto') params.set('theme', currentTheme); 674 try { 675 window.history.replaceState({}, '', `${window.location.pathname}?${params.toString()}`); 676 } catch (e) { 677 /* ignore history updates when opened from file:// */ 678 } 679 } 680 681 function setRole(role) { 682 currentRole.value = role; 683 const identity = identities[role]; 684 685 document.querySelectorAll('.menu-heading-title').forEach((element) => { 686 element.textContent = identity.name; 687 }); 688 document.querySelectorAll('.menu-heading-meta').forEach((element) => { 689 element.textContent = identity.email; 690 }); 691 692 roleButtons.forEach((button) => { 693 const active = button.dataset.roleTarget === role; 694 button.classList.toggle('is-active', active); 695 button.setAttribute('aria-pressed', String(active)); 696 }); 697 698 settingsNavLinks.forEach((link) => { 699 link.hidden = role !== 'system'; 700 }); 701 702 if (!accessibleRealms().includes(currentRealm)) { 703 currentRealm = accessibleRealms()[0] || 'acme'; 704 } 705 706 syncSelector(); 707 renderDomains(); 708 syncRealmLinks(); 709 syncUrl(); 710 } 711 712 roleButtons.forEach((button) => { 713 button.addEventListener('click', () => setRole(button.dataset.roleTarget)); 714 }); 715 716 const selectObserver = new MutationObserver(() => { 717 const value = realmSelect.dataset.value; 718 if (value && value !== currentRealm) { 719 currentRealm = value; 720 renderDomains(); 721 syncSelector(); 722 syncRealmLinks(); 723 syncUrl(); 724 } 725 }); 726 selectObserver.observe(realmSelect, { attributes: true, attributeFilter: ['data-value'] }); 727 728 const createDialog = document.getElementById('domains-create-dialog'); 729 const createForm = document.getElementById('domains-create-form'); 730 const createAlert = document.getElementById('domains-create-alert'); 731 const domainInput = document.getElementById('domains-domain-input'); 732 733 function normalizeDomain(value) { 734 return value.trim().toLowerCase().replace(/\.$/, ''); 735 } 736 737 function domainError(raw) { 738 const value = raw.trim(); 739 const domain = normalizeDomain(value); 740 741 if (!domain) return 'Email domain is required.'; 742 if (/\s/.test(value)) return 'Email domain must not contain spaces.'; 743 if (domain.includes('@')) return 'Enter the domain without the @ symbol.'; 744 if (domain.includes('://') || /^[a-z][a-z0-9+.-]*:\/\//i.test(value)) { 745 return 'Email domain must not include a scheme such as https://.'; 746 } 747 if (domain.includes('/')) return 'Email domain must not include a path.'; 748 if (domain.includes('*')) return 'Wildcard domains are not supported.'; 749 if (domain.includes(':')) return 'Email domain must not include a port.'; 750 if (value.endsWith('.')) return 'Email domain must not end with a dot.'; 751 if (domain.startsWith('.')) return 'Email domain must not start with a dot.'; 752 if (domain.length > 253) return 'Email domain must be 253 characters or fewer.'; 753 754 const labels = domain.split('.'); 755 if (labels.length < 2) return 'Enter a complete domain such as acme.test.'; 756 for (const label of labels) { 757 if (!/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/.test(label)) { 758 return 'Domain labels may use lowercase letters, numbers and hyphens.'; 759 } 760 if (label.length > 63) return 'Each domain label must be 63 characters or fewer.'; 761 } 762 763 const assignment = domainAssignments[domain]; 764 if (assignment) { 765 if (assignment.realm === currentRealm) return 'This email domain is already assigned to this realm.'; 766 if (currentRole.value === 'system') { 767 return `This email domain is already assigned to ${realmInfo[assignment.realm].label}.`; 768 } 769 return 'This email domain is already assigned to another realm.'; 770 } 771 772 return null; 773 } 774 775 function generateToken() { 776 const bytes = new Uint8Array(18); 777 crypto.getRandomValues(bytes); 778 let binary = ''; 779 bytes.forEach((byte) => { 780 binary += String.fromCharCode(byte); 781 }); 782 const encoded = btoa(binary).replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, ''); 783 return encoded; 784 } 785 786 function clearCreateError() { 787 createAlert.hidden = true; 788 createAlert.textContent = ''; 789 domainInput.removeAttribute('aria-invalid'); 790 } 791 792 function showCreateError(message) { 793 createAlert.hidden = false; 794 createAlert.textContent = message; 795 domainInput.setAttribute('aria-invalid', 'true'); 796 } 797 798 function resetCreateForm() { 799 createForm.reset(); 800 clearCreateError(); 801 } 802 803 addButton.addEventListener('click', () => { 804 resetCreateForm(); 805 createDialog.hidden = false; 806 requestAnimationFrame(() => domainInput.focus()); 807 }); 808 809 domainInput.addEventListener('input', clearCreateError); 810 811 createForm.addEventListener('submit', (event) => { 812 event.preventDefault(); 813 const domain = normalizeDomain(domainInput.value); 814 const error = domainError(domainInput.value); 815 if (error) { 816 showCreateError(error); 817 return; 818 } 819 820 const entry = { domain, status: 'pending', token: generateToken(), added: 'Just now' }; 821 domains[currentRealm].unshift(entry); 822 domainAssignments[domain] = { realm: currentRealm }; 823 createDialog.hidden = true; 824 renderDomains(); 825 showNotice(`Email domain ${domain} added. Add the TXT record to verify this domain.`); 826 }); 827 828 const verifyDialog = document.getElementById('domains-verify-dialog'); 829 const verifyMessage = document.getElementById('domains-verify-message'); 830 const verifyName = document.getElementById('domains-verify-name'); 831 const verifyValue = document.getElementById('domains-verify-value'); 832 const verifyCopyButton = document.getElementById('domains-verify-copy'); 833 const verifyMarkButton = document.getElementById('domains-verify-mark'); 834 let pendingVerifyDomain = ''; 835 let copyResetTimer = 0; 836 837 function findDomainEntry(domain) { 838 return (domains[currentRealm] || []).find((entry) => entry.domain === domain); 839 } 840 841 function resetCopyButton() { 842 window.clearTimeout(copyResetTimer); 843 verifyCopyButton.textContent = 'Copy value'; 844 } 845 846 function flashCopied() { 847 verifyCopyButton.textContent = 'Copied'; 848 window.clearTimeout(copyResetTimer); 849 copyResetTimer = window.setTimeout(() => { 850 verifyCopyButton.textContent = 'Copy value'; 851 }, 2000); 852 } 853 854 function copyText(text) { 855 if (navigator.clipboard && navigator.clipboard.writeText) { 856 navigator.clipboard.writeText(text).then(flashCopied).catch(() => fallbackCopy(text)); 857 return; 858 } 859 fallbackCopy(text); 860 } 861 862 function fallbackCopy(text) { 863 const scratch = document.createElement('textarea'); 864 scratch.value = text; 865 scratch.setAttribute('readonly', ''); 866 scratch.style.position = 'absolute'; 867 scratch.style.left = '-9999rem'; 868 document.body.appendChild(scratch); 869 scratch.select(); 870 try { 871 document.execCommand('copy'); 872 flashCopied(); 873 } catch (e) { 874 verifyCopyButton.textContent = 'Copy failed'; 875 window.clearTimeout(copyResetTimer); 876 copyResetTimer = window.setTimeout(() => { 877 verifyCopyButton.textContent = 'Copy value'; 878 }, 2000); 879 } 880 document.body.removeChild(scratch); 881 } 882 883 function openVerifyDialog(domain) { 884 const entry = findDomainEntry(domain); 885 if (!entry) return; 886 pendingVerifyDomain = domain; 887 verifyMessage.textContent = `Add the TXT record below to prove control of ${domain}. Accounts using this domain are assigned to the realm automatically once verified.`; 888 verifyName.value = `_auth-domain-challenge.${domain}`; 889 verifyValue.value = entry.token || generateToken(); 890 resetCopyButton(); 891 verifyDialog.hidden = false; 892 requestAnimationFrame(() => verifyName.focus()); 893 } 894 895 verifyCopyButton.addEventListener('click', () => copyText(verifyValue.value)); 896 897 verifyMarkButton.addEventListener('click', () => { 898 if (!pendingVerifyDomain) return; 899 const entry = findDomainEntry(pendingVerifyDomain); 900 if (entry) { 901 entry.status = 'verified'; 902 delete entry.token; 903 } 904 const verified = pendingVerifyDomain; 905 pendingVerifyDomain = ''; 906 verifyDialog.hidden = true; 907 renderDomains(); 908 showNotice(`Email domain ${verified} verified.`); 909 }); 910 911 const removeDialog = document.getElementById('domains-remove-dialog'); 912 const removeMessage = document.getElementById('domains-remove-message'); 913 const removeInput = document.getElementById('domains-remove-confirm'); 914 const confirmRemoveButton = document.getElementById('domains-remove-confirm-button'); 915 let pendingRemoveDomain = ''; 916 917 function openRemoveDialog(domain) { 918 pendingRemoveDomain = domain; 919 const realmLabel = realmInfo[currentRealm].label; 920 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.`; 921 removeInput.value = ''; 922 removeInput.placeholder = domain; 923 confirmRemoveButton.disabled = true; 924 removeDialog.hidden = false; 925 requestAnimationFrame(() => removeInput.focus()); 926 } 927 928 removeInput.addEventListener('input', () => { 929 confirmRemoveButton.disabled = normalizeDomain(removeInput.value) !== pendingRemoveDomain; 930 }); 931 932 confirmRemoveButton.addEventListener('click', () => { 933 if (!pendingRemoveDomain || confirmRemoveButton.disabled) return; 934 935 domains[currentRealm] = (domains[currentRealm] || []).filter((entry) => entry.domain !== pendingRemoveDomain); 936 delete domainAssignments[pendingRemoveDomain]; 937 const removed = pendingRemoveDomain; 938 pendingRemoveDomain = ''; 939 removeDialog.hidden = true; 940 renderDomains(); 941 showNotice(`Email domain ${removed} removed.`); 942 }); 943 944 domainRows.addEventListener('click', (event) => { 945 const verifyButton = event.target.closest('[data-verify-domain]'); 946 if (verifyButton) { 947 event.stopPropagation(); 948 openVerifyDialog(verifyButton.dataset.verifyDomain); 949 return; 950 } 951 952 const removeButton = event.target.closest('[data-remove-domain]'); 953 if (removeButton) { 954 event.stopPropagation(); 955 openRemoveDialog(removeButton.dataset.removeDomain); 956 } 957 }); 958 959 searchInput.addEventListener('input', applySearch); 960 961 const initialParams = new URLSearchParams(window.location.search); 962 const initialTheme = initialParams.get('theme'); 963 if (initialTheme === 'light' || initialTheme === 'dark') setTheme(initialTheme); 964 965 const initialRole = initialParams.get('role'); 966 if (identities[initialRole]) currentRole.value = initialRole; 967 968 const initialRealm = initialParams.get('realm'); 969 if (realmInfo[initialRealm] && realmInfo[initialRealm].roles.includes(currentRole.value)) { 970 currentRealm = initialRealm; 971 } else { 972 currentRealm = accessibleRealms()[0] || 'acme'; 973 } 974 975 setRole(currentRole.value); 976 </script> 977 <script src="./shell.js"></script> 978 </body> 979 </html>