admin-realm-hosts.html (39339B)
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 hosts 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-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="hosts-breadcrumb-root" href="./admin-realms.html"><span data-realm-breadcrumb-root>Realms</span></a> 232 <span>/</span> 233 <a id="hosts-breadcrumb-realm" href="./admin-settings.html?realm=acme">Acme</a> 234 <span>/</span> 235 <span aria-current="page">Hosts</span> 236 </div> 237 <h1>Hosts</h1> 238 <p>Hostnames that resolve to this realm.</p> 239 </div> 240 <div class="field"> 241 <span class="field-label" id="hosts-realm-label">Realm</span> 242 <div class="select" id="hosts-realm-select" data-select data-value="acme"> 243 <button 244 class="select-trigger" 245 type="button" 246 id="hosts-realm-trigger" 247 role="combobox" 248 aria-haspopup="listbox" 249 aria-expanded="false" 250 aria-controls="hosts-realm-listbox" 251 aria-labelledby="hosts-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="hosts-realm-listbox" role="listbox" aria-labelledby="hosts-realm-label" hidden> 259 <div class="select-option is-selected" id="hosts-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="hosts-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="hosts-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="hosts-notice" class="notice" role="status" hidden></div> 289 290 <section class="card" aria-labelledby="hosts-table-title"> 291 <h2 id="hosts-table-title" class="sr-only">Realm hosts</h2> 292 <div class="toolbar toolbar-panel"> 293 <div class="toolbar-search"> 294 <input id="hosts-search" type="search" aria-label="Search hosts" placeholder="Search hosts" /> 295 </div> 296 <div class="toolbar-actions"> 297 <button id="hosts-add-button" class="button button-primary" type="button">Add host</button> 298 </div> 299 </div> 300 301 <table class="table"> 302 <thead> 303 <tr> 304 <th scope="col">Hostname</th> 305 <th scope="col">Added</th> 306 <th scope="col">Actions</th> 307 </tr> 308 </thead> 309 <tbody id="hosts-rows"></tbody> 310 </table> 311 <p id="hosts-search-empty" class="empty" hidden>No hosts match this search.</p> 312 <p id="hosts-realm-empty" class="empty" hidden>No hosts 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="hosts-create-dialog" class="overlay" hidden> 328 <form id="hosts-create-form" class="modal" role="dialog" aria-modal="true" aria-labelledby="hosts-create-title" novalidate> 329 <div class="modal-header"> 330 <h2 id="hosts-create-title">Add host</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="hosts-create-alert" class="alert" role="alert" hidden></div> 340 341 <label class="field" for="hosts-host-input"> 342 <span class="field-label">Hostname</span> 343 <input id="hosts-host-input" class="field-control" type="text" maxlength="253" placeholder="login.acme.test" autocomplete="off" spellcheck="false" /> 344 </label> 345 <p class="modal-note">Lowercase hostname. Do not include a scheme, port, path or wildcard.</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 host</button> 350 </div> 351 </div> 352 </form> 353 </div> 354 355 <div id="hosts-remove-dialog" class="overlay" hidden> 356 <div class="modal" role="dialog" aria-modal="true" aria-labelledby="hosts-remove-title"> 357 <div class="modal-header"> 358 <h2 id="hosts-remove-title">Remove host</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="hosts-remove-message" class="modal-note"></p> 368 <label class="field" for="hosts-remove-confirm"> 369 <span class="field-label">Confirm hostname</span> 370 <input id="hosts-remove-confirm" class="field-control" type="text" maxlength="253" autocomplete="off" spellcheck="false" /> 371 </label> 372 <p class="modal-note">Type the hostname exactly to confirm.</p> 373 <div class="modal-actions"> 374 <button class="button button-secondary" type="button" data-dialog-close>Cancel</button> 375 <button id="hosts-remove-confirm-button" class="button button-danger" type="button" disabled>Remove host</button> 376 </div> 377 </div> 378 </div> 379 </div> 380 381 <div class="mockup-controls" aria-label="Mockup controls"> 382 <span class="mockup-label">Mockup</span> 383 <button class="mockup-button is-active" type="button" data-theme-target="auto">Auto</button> 384 <button class="mockup-button" type="button" data-theme-target="light">Light</button> 385 <button class="mockup-button" type="button" data-theme-target="dark">Dark</button> 386 <span class="mockup-separator" aria-hidden="true"></span> 387 <span class="mockup-label">View as</span> 388 <button class="mockup-button is-active" type="button" data-role-target="system" aria-pressed="true">System admin</button> 389 <button class="mockup-button" type="button" data-role-target="owner" aria-pressed="false">Realm owner</button> 390 <button class="mockup-button" type="button" data-role-target="admin" aria-pressed="false">Realm admin</button> 391 </div> 392 393 <script> 394 const root = document.documentElement; 395 const themeButtons = document.querySelectorAll('[data-theme-target]'); 396 const userThemeButtons = document.querySelectorAll('[data-user-theme]'); 397 const userThemeValues = document.querySelectorAll('[data-user-theme-value]'); 398 let currentTheme = 'auto'; 399 400 function setTheme(value) { 401 currentTheme = value; 402 if (value === 'auto') { 403 root.removeAttribute('data-theme'); 404 } else { 405 root.setAttribute('data-theme', value); 406 } 407 408 themeButtons.forEach((button) => { 409 button.classList.toggle('is-active', button.dataset.themeTarget === value); 410 }); 411 userThemeValues.forEach((element) => { 412 element.textContent = value.charAt(0).toUpperCase() + value.slice(1); 413 }); 414 415 if (typeof syncUrl === 'function') syncUrl(); 416 if (typeof syncRealmLinks === 'function') syncRealmLinks(); 417 } 418 419 themeButtons.forEach((button) => { 420 button.addEventListener('click', () => setTheme(button.dataset.themeTarget)); 421 }); 422 423 userThemeButtons.forEach((button) => { 424 button.addEventListener('click', () => { 425 const themes = ['auto', 'light', 'dark']; 426 setTheme(themes[(themes.indexOf(currentTheme) + 1) % themes.length]); 427 }); 428 }); 429 430 const userMenu = document.querySelector('.user-menu'); 431 document.addEventListener('click', (event) => { 432 if (userMenu && userMenu.open && !userMenu.contains(event.target)) { 433 userMenu.open = false; 434 } 435 }); 436 437 document.querySelectorAll('[data-dialog-close]').forEach((button) => { 438 button.addEventListener('click', () => { 439 button.closest('.overlay').hidden = true; 440 }); 441 }); 442 443 document.querySelectorAll('.overlay').forEach((overlay) => { 444 overlay.addEventListener('mousedown', (event) => { 445 if (event.target === overlay) overlay.hidden = true; 446 }); 447 }); 448 449 document.addEventListener('keydown', (event) => { 450 if (event.key === 'Escape') { 451 document.querySelectorAll('.overlay:not([hidden])').forEach((dialog) => { 452 dialog.hidden = true; 453 }); 454 } 455 }); 456 457 const identities = { 458 system: { name: 'System Admin', email: 'admin@system.test' }, 459 owner: { name: 'Realm Owner', email: 'owner@acme.test' }, 460 admin: { name: 'Realm Admin', email: 'realm-admin@managed.test' }, 461 }; 462 463 const realmInfo = { 464 acme: { label: 'Acme', roles: ['system', 'owner'] }, 465 globex: { label: 'Globex', roles: ['system', 'admin'] }, 466 northwind: { label: 'Northwind', roles: ['system'] }, 467 }; 468 const realmOrder = ['acme', 'globex', 'northwind']; 469 470 const hosts = { 471 acme: [ 472 { host: 'acme.localhost', added: '12 Mar 2026' }, 473 { host: 'login.acme.test', added: '12 Mar 2026' }, 474 ], 475 globex: [{ host: 'globex.localhost', added: '04 Feb 2026' }], 476 northwind: [], 477 }; 478 479 const hostAssignments = { 480 'acme.localhost': { realm: 'acme' }, 481 'login.acme.test': { realm: 'acme' }, 482 'globex.localhost': { realm: 'globex' }, 483 'app.acme.localhost': { realm: 'acme', client: true }, 484 'auth.example.test': { reserved: true }, 485 }; 486 487 const currentRole = { value: 'system' }; 488 let currentRealm = 'acme'; 489 490 const roleButtons = document.querySelectorAll('[data-role-target]'); 491 const realmNavLinks = document.querySelectorAll('[data-realm-nav]'); 492 const realmNavLabels = document.querySelectorAll('[data-realm-nav-label]'); 493 const settingsNavLinks = document.querySelectorAll('[data-settings-nav]'); 494 const breadcrumbRootLink = document.getElementById('hosts-breadcrumb-root'); 495 const breadcrumbRealmLink = document.getElementById('hosts-breadcrumb-realm'); 496 const breadcrumbRootLabels = document.querySelectorAll('[data-realm-breadcrumb-root]'); 497 498 const realmSelect = document.getElementById('hosts-realm-select'); 499 const realmSelectValue = realmSelect.querySelector('.select-value'); 500 const realmSelectOptions = [...realmSelect.querySelectorAll('.select-option')]; 501 502 const notice = document.getElementById('hosts-notice'); 503 const searchInput = document.getElementById('hosts-search'); 504 const searchEmpty = document.getElementById('hosts-search-empty'); 505 const realmEmpty = document.getElementById('hosts-realm-empty'); 506 const hostsRows = document.getElementById('hosts-rows'); 507 const addButton = document.getElementById('hosts-add-button'); 508 509 function accessibleRealms() { 510 return realmOrder.filter((slug) => realmInfo[slug].roles.includes(currentRole.value)); 511 } 512 513 function hostRowList() { 514 return [...hostsRows.querySelectorAll('.host-row')]; 515 } 516 517 function showNotice(message) { 518 notice.textContent = message; 519 notice.hidden = false; 520 } 521 522 function escapeHtml(value) { 523 return String(value).replace(/[&<>"']/g, (character) => { 524 const entities = { '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }; 525 return entities[character]; 526 }); 527 } 528 529 function hostRowElement(entry) { 530 const row = document.createElement('tr'); 531 row.className = 'host-row'; 532 row.dataset.search = entry.host.toLowerCase(); 533 row.innerHTML = ` 534 <td data-label="Hostname"><span class="table-mono">${escapeHtml(entry.host)}</span></td> 535 <td data-label="Added"><span class="table-meta">${escapeHtml(entry.added)}</span></td> 536 <td data-label="Actions"> 537 <button class="button-inline button-danger" type="button" data-remove-host="${escapeHtml(entry.host)}">Remove</button> 538 </td>`; 539 return row; 540 } 541 542 function renderHosts() { 543 const list = hosts[currentRealm] || []; 544 hostsRows.replaceChildren(...list.map(hostRowElement)); 545 applySearch(); 546 } 547 548 function applySearch() { 549 const term = searchInput.value.trim().toLowerCase(); 550 const total = (hosts[currentRealm] || []).length; 551 let visible = 0; 552 553 hostRowList().forEach((row) => { 554 const match = !term || (row.dataset.search || '').includes(term); 555 row.hidden = !match; 556 if (match) visible += 1; 557 }); 558 559 searchEmpty.hidden = total === 0 || visible !== 0; 560 realmEmpty.hidden = total !== 0; 561 } 562 563 function syncSelector() { 564 realmSelectOptions.forEach((option) => { 565 const slug = option.dataset.value; 566 const accessible = realmInfo[slug].roles.includes(currentRole.value); 567 option.hidden = !accessible; 568 const selected = slug === currentRealm; 569 option.classList.toggle('is-selected', selected); 570 option.setAttribute('aria-selected', String(selected)); 571 }); 572 realmSelectValue.textContent = realmInfo[currentRealm].label; 573 realmSelect.dataset.value = currentRealm; 574 } 575 576 function subpageUrl(path) { 577 const params = new URLSearchParams(); 578 params.set('realm', currentRealm); 579 params.set('role', currentRole.value); 580 if (currentTheme !== 'auto') params.set('theme', currentTheme); 581 return `./${path}?${params.toString()}`; 582 } 583 584 function realmNavHref() { 585 return accessibleRealms().length === 1 586 ? subpageUrl('admin-settings.html') 587 : `./admin-realms.html?${realmListParams()}`; 588 } 589 590 function realmListParams() { 591 const params = new URLSearchParams(); 592 params.set('role', currentRole.value); 593 if (currentTheme !== 'auto') params.set('theme', currentTheme); 594 return params.toString(); 595 } 596 597 function syncRealmLinks() { 598 const count = accessibleRealms().length; 599 const label = count === 1 ? 'Realm' : 'Realms'; 600 const href = realmNavHref(); 601 602 realmNavLabels.forEach((element) => { 603 element.textContent = label; 604 }); 605 realmNavLinks.forEach((link) => { 606 link.href = href; 607 link.classList.add('is-active'); 608 link.removeAttribute('aria-current'); 609 }); 610 breadcrumbRootLabels.forEach((element) => { 611 element.textContent = label; 612 }); 613 breadcrumbRootLink.href = href; 614 breadcrumbRealmLink.textContent = realmInfo[currentRealm].label; 615 breadcrumbRealmLink.href = subpageUrl('admin-settings.html'); 616 } 617 618 function syncUrl() { 619 const params = new URLSearchParams(); 620 params.set('realm', currentRealm); 621 params.set('role', currentRole.value); 622 if (currentTheme !== 'auto') params.set('theme', currentTheme); 623 try { 624 window.history.replaceState({}, '', `${window.location.pathname}?${params.toString()}`); 625 } catch (e) { 626 /* ignore history updates when opened from file:// */ 627 } 628 } 629 630 function setRole(role) { 631 currentRole.value = role; 632 const identity = identities[role]; 633 634 document.querySelectorAll('.menu-heading-title').forEach((element) => { 635 element.textContent = identity.name; 636 }); 637 document.querySelectorAll('.menu-heading-meta').forEach((element) => { 638 element.textContent = identity.email; 639 }); 640 641 roleButtons.forEach((button) => { 642 const active = button.dataset.roleTarget === role; 643 button.classList.toggle('is-active', active); 644 button.setAttribute('aria-pressed', String(active)); 645 }); 646 647 settingsNavLinks.forEach((link) => { 648 link.hidden = role !== 'system'; 649 }); 650 651 if (!accessibleRealms().includes(currentRealm)) { 652 currentRealm = accessibleRealms()[0] || 'acme'; 653 } 654 655 syncSelector(); 656 renderHosts(); 657 syncRealmLinks(); 658 syncUrl(); 659 } 660 661 roleButtons.forEach((button) => { 662 button.addEventListener('click', () => setRole(button.dataset.roleTarget)); 663 }); 664 665 const selectObserver = new MutationObserver(() => { 666 const value = realmSelect.dataset.value; 667 if (value && value !== currentRealm) { 668 currentRealm = value; 669 renderHosts(); 670 syncSelector(); 671 syncRealmLinks(); 672 syncUrl(); 673 } 674 }); 675 selectObserver.observe(realmSelect, { attributes: true, attributeFilter: ['data-value'] }); 676 677 const createDialog = document.getElementById('hosts-create-dialog'); 678 const createForm = document.getElementById('hosts-create-form'); 679 const createAlert = document.getElementById('hosts-create-alert'); 680 const hostInput = document.getElementById('hosts-host-input'); 681 682 function normalizeHostname(value) { 683 return value.trim().toLowerCase(); 684 } 685 686 function hostnameError(raw) { 687 const value = raw.trim(); 688 const host = normalizeHostname(value); 689 690 if (!host) return 'Hostname is required.'; 691 if (/\s/.test(value)) return 'Hostname must not contain spaces.'; 692 if (host.includes('://') || /^[a-z][a-z0-9+.-]*:\/\//i.test(value)) { 693 return 'Hostname must not include a scheme such as https://.'; 694 } 695 if (host.includes('@')) return 'Hostname must not include @.'; 696 if (host.includes('/')) return 'Hostname must not include a path.'; 697 if (host.includes('*')) return 'Wildcard hostnames are not supported.'; 698 if (host.startsWith('[')) { 699 if (!host.endsWith(']')) return 'Enter a valid IPv6 hostname.'; 700 } else if (host.includes(':')) { 701 return 'Hostname must not include a port.'; 702 } 703 if (host.length > 253) return 'Hostname must be 253 characters or fewer.'; 704 if (host.startsWith('.') || host.endsWith('.')) return 'Hostname must not start or end with a dot.'; 705 706 const labels = host.replace(/^\[|\]$/g, '').split('.'); 707 if (!host.startsWith('[') && labels.length < 2) return 'Enter a complete hostname such as login.acme.test.'; 708 for (const label of host.startsWith('[') ? [] : labels) { 709 if (!/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/.test(label)) { 710 return 'Hostname labels may use lowercase letters, numbers and hyphens.'; 711 } 712 if (label.length > 63) return 'Each hostname label must be 63 characters or fewer.'; 713 } 714 715 if (hostAssignments[host]?.reserved) return 'This hostname is reserved for the authentication service.'; 716 717 const assignment = hostAssignments[host]; 718 if (assignment) { 719 if (assignment.client) { 720 return currentRole.value === 'system' 721 ? 'This hostname is already assigned to a client application.' 722 : 'This hostname is already assigned.'; 723 } 724 if (assignment.realm === currentRealm) return 'This hostname is already assigned to this realm.'; 725 if (currentRole.value === 'system') { 726 return `This hostname is already assigned to ${realmInfo[assignment.realm].label}.`; 727 } 728 return 'This hostname is already assigned to another realm.'; 729 } 730 731 return null; 732 } 733 734 function clearCreateError() { 735 createAlert.hidden = true; 736 createAlert.textContent = ''; 737 hostInput.removeAttribute('aria-invalid'); 738 } 739 740 function showCreateError(message) { 741 createAlert.hidden = false; 742 createAlert.textContent = message; 743 hostInput.setAttribute('aria-invalid', 'true'); 744 } 745 746 function resetCreateForm() { 747 createForm.reset(); 748 clearCreateError(); 749 } 750 751 addButton.addEventListener('click', () => { 752 resetCreateForm(); 753 createDialog.hidden = false; 754 requestAnimationFrame(() => hostInput.focus()); 755 }); 756 757 hostInput.addEventListener('input', clearCreateError); 758 759 createForm.addEventListener('submit', (event) => { 760 event.preventDefault(); 761 const host = normalizeHostname(hostInput.value); 762 const error = hostnameError(hostInput.value); 763 if (error) { 764 showCreateError(error); 765 return; 766 } 767 768 hosts[currentRealm].unshift({ host, added: 'Just now' }); 769 hostAssignments[host] = { realm: currentRealm }; 770 createDialog.hidden = true; 771 renderHosts(); 772 showNotice(`Host ${host} added.`); 773 }); 774 775 const removeDialog = document.getElementById('hosts-remove-dialog'); 776 const removeMessage = document.getElementById('hosts-remove-message'); 777 const removeInput = document.getElementById('hosts-remove-confirm'); 778 const confirmRemoveButton = document.getElementById('hosts-remove-confirm-button'); 779 let pendingRemoveHost = ''; 780 781 function openRemoveDialog(host) { 782 pendingRemoveHost = host; 783 const realmLabel = realmInfo[currentRealm].label; 784 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.`; 785 removeInput.value = ''; 786 removeInput.placeholder = host; 787 confirmRemoveButton.disabled = true; 788 removeDialog.hidden = false; 789 requestAnimationFrame(() => removeInput.focus()); 790 } 791 792 removeInput.addEventListener('input', () => { 793 confirmRemoveButton.disabled = normalizeHostname(removeInput.value) !== pendingRemoveHost; 794 }); 795 796 confirmRemoveButton.addEventListener('click', () => { 797 if (!pendingRemoveHost || confirmRemoveButton.disabled) return; 798 799 hosts[currentRealm] = (hosts[currentRealm] || []).filter((entry) => entry.host !== pendingRemoveHost); 800 delete hostAssignments[pendingRemoveHost]; 801 const removed = pendingRemoveHost; 802 pendingRemoveHost = ''; 803 removeDialog.hidden = true; 804 renderHosts(); 805 showNotice(`Host ${removed} removed.`); 806 }); 807 808 hostsRows.addEventListener('click', (event) => { 809 const removeButton = event.target.closest('[data-remove-host]'); 810 if (removeButton) { 811 event.stopPropagation(); 812 openRemoveDialog(removeButton.dataset.removeHost); 813 } 814 }); 815 816 searchInput.addEventListener('input', applySearch); 817 818 const initialParams = new URLSearchParams(window.location.search); 819 const initialTheme = initialParams.get('theme'); 820 if (initialTheme === 'light' || initialTheme === 'dark') setTheme(initialTheme); 821 822 const initialRole = initialParams.get('role'); 823 if (identities[initialRole]) currentRole.value = initialRole; 824 825 const initialRealm = initialParams.get('realm'); 826 if (realmInfo[initialRealm] && realmInfo[initialRealm].roles.includes(currentRole.value)) { 827 currentRealm = initialRealm; 828 } else { 829 currentRealm = accessibleRealms()[0] || 'acme'; 830 } 831 832 setRole(currentRole.value); 833 </script> 834 <script src="./shell.js"></script> 835 </body> 836 </html>