admin-realm-providers.html (39091B)
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 providers 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="providers-breadcrumb-root" href="./admin-realms.html"><span data-realm-breadcrumb-root>Realms</span></a> 232 <span>/</span> 233 <a id="providers-breadcrumb-realm" href="./admin-settings.html?realm=acme">Acme</a> 234 <span>/</span> 235 <span aria-current="page">Identity providers</span> 236 </div> 237 <h1>Identity providers</h1> 238 <p>External sign-in providers that accounts in this realm can use.</p> 239 </div> 240 <div class="field"> 241 <span class="field-label" id="providers-realm-label">Realm</span> 242 <div class="select" id="providers-realm-select" data-select data-value="acme"> 243 <button 244 class="select-trigger" 245 type="button" 246 id="providers-realm-trigger" 247 role="combobox" 248 aria-haspopup="listbox" 249 aria-expanded="false" 250 aria-controls="providers-realm-listbox" 251 aria-labelledby="providers-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="providers-realm-listbox" role="listbox" aria-labelledby="providers-realm-label" hidden> 259 <div class="select-option is-selected" id="providers-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="providers-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="providers-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="providers-notice" class="notice" role="status" hidden></div> 289 290 <section class="card" aria-labelledby="providers-table-title"> 291 <h2 id="providers-table-title" class="sr-only">Realm identity providers</h2> 292 <div class="toolbar toolbar-panel"> 293 <div class="toolbar-search"> 294 <input id="providers-search" type="search" aria-label="Search providers" placeholder="Search providers" /> 295 </div> 296 <div class="toolbar-actions"> 297 <button id="providers-add-button" class="button button-primary" type="button">Add provider</button> 298 </div> 299 </div> 300 301 <table class="table"> 302 <thead> 303 <tr> 304 <th scope="col">Provider</th> 305 <th scope="col">Issuer</th> 306 <th scope="col">Status</th> 307 <th scope="col">Domains</th> 308 <th scope="col">Actions</th> 309 </tr> 310 </thead> 311 <tbody id="providers-rows"></tbody> 312 </table> 313 <p id="providers-search-empty" class="empty" hidden>No providers match this search.</p> 314 <p id="providers-realm-empty" class="empty" hidden>No identity providers are configured for this realm.</p> 315 </section> 316 317 <section class="state-preview"> 318 <h2>Loading state</h2> 319 <div class="panel" aria-busy="true"> 320 <div class="skeleton skeleton-title"></div> 321 <div class="skeleton"></div> 322 <div class="skeleton skeleton-short"></div> 323 </div> 324 </section> 325 </main> 326 </div> 327 </div> 328 329 <div id="providers-toggle-dialog" class="overlay" hidden> 330 <div class="modal" role="dialog" aria-modal="true" aria-labelledby="providers-toggle-title"> 331 <div class="modal-header"> 332 <h2 id="providers-toggle-title">Disable provider</h2> 333 <button class="modal-close" type="button" aria-label="Close dialog" data-dialog-close> 334 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> 335 <path d="M18 6 6 18" /> 336 <path d="m6 6 12 12" /> 337 </svg> 338 </button> 339 </div> 340 <div class="modal-body"> 341 <p id="providers-toggle-message" class="modal-note"></p> 342 <div class="modal-actions"> 343 <button class="button button-secondary" type="button" data-dialog-close>Cancel</button> 344 <button id="providers-toggle-confirm-button" class="button button-primary" type="button">Disable provider</button> 345 </div> 346 </div> 347 </div> 348 </div> 349 350 <div id="providers-delete-dialog" class="overlay" hidden> 351 <div class="modal" role="dialog" aria-modal="true" aria-labelledby="providers-delete-title"> 352 <div class="modal-header"> 353 <h2 id="providers-delete-title">Delete provider</h2> 354 <button class="modal-close" type="button" aria-label="Close dialog" data-dialog-close> 355 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> 356 <path d="M18 6 6 18" /> 357 <path d="m6 6 12 12" /> 358 </svg> 359 </button> 360 </div> 361 <div class="modal-body"> 362 <p id="providers-delete-message" class="modal-note"></p> 363 <label class="field" for="providers-delete-confirm"> 364 <span class="field-label">Confirm slug</span> 365 <input id="providers-delete-confirm" class="field-control" type="text" maxlength="64" autocomplete="off" spellcheck="false" /> 366 </label> 367 <p class="modal-note">Type the provider slug exactly to confirm.</p> 368 <div class="modal-actions"> 369 <button class="button button-secondary" type="button" data-dialog-close>Cancel</button> 370 <button id="providers-delete-confirm-button" class="button button-danger" type="button" disabled>Delete provider</button> 371 </div> 372 </div> 373 </div> 374 </div> 375 376 <div class="mockup-controls" aria-label="Mockup controls"> 377 <span class="mockup-label">Mockup</span> 378 <button class="mockup-button is-active" type="button" data-theme-target="auto">Auto</button> 379 <button class="mockup-button" type="button" data-theme-target="light">Light</button> 380 <button class="mockup-button" type="button" data-theme-target="dark">Dark</button> 381 <span class="mockup-separator" aria-hidden="true"></span> 382 <span class="mockup-label">View as</span> 383 <button class="mockup-button is-active" type="button" data-role-target="system" aria-pressed="true">System admin</button> 384 <button class="mockup-button" type="button" data-role-target="owner" aria-pressed="false">Realm owner</button> 385 <button class="mockup-button" type="button" data-role-target="admin" aria-pressed="false">Realm admin</button> 386 </div> 387 388 <script> 389 const root = document.documentElement; 390 const themeButtons = document.querySelectorAll('[data-theme-target]'); 391 const userThemeButtons = document.querySelectorAll('[data-user-theme]'); 392 const userThemeValues = document.querySelectorAll('[data-user-theme-value]'); 393 let currentTheme = 'auto'; 394 395 function setTheme(value) { 396 currentTheme = value; 397 if (value === 'auto') { 398 root.removeAttribute('data-theme'); 399 } else { 400 root.setAttribute('data-theme', value); 401 } 402 403 themeButtons.forEach((button) => { 404 button.classList.toggle('is-active', button.dataset.themeTarget === value); 405 }); 406 userThemeValues.forEach((element) => { 407 element.textContent = value.charAt(0).toUpperCase() + value.slice(1); 408 }); 409 410 if (typeof syncUrl === 'function') syncUrl(); 411 if (typeof syncRealmLinks === 'function') syncRealmLinks(); 412 } 413 414 themeButtons.forEach((button) => { 415 button.addEventListener('click', () => setTheme(button.dataset.themeTarget)); 416 }); 417 418 userThemeButtons.forEach((button) => { 419 button.addEventListener('click', () => { 420 const themes = ['auto', 'light', 'dark']; 421 setTheme(themes[(themes.indexOf(currentTheme) + 1) % themes.length]); 422 }); 423 }); 424 425 const userMenu = document.querySelector('.user-menu'); 426 document.addEventListener('click', (event) => { 427 if (userMenu && userMenu.open && !userMenu.contains(event.target)) { 428 userMenu.open = false; 429 } 430 }); 431 432 document.querySelectorAll('[data-dialog-close]').forEach((button) => { 433 button.addEventListener('click', () => { 434 button.closest('.overlay').hidden = true; 435 }); 436 }); 437 438 document.querySelectorAll('.overlay').forEach((overlay) => { 439 overlay.addEventListener('mousedown', (event) => { 440 if (event.target === overlay) overlay.hidden = true; 441 }); 442 }); 443 444 document.addEventListener('keydown', (event) => { 445 if (event.key === 'Escape') { 446 document.querySelectorAll('.overlay:not([hidden])').forEach((dialog) => { 447 dialog.hidden = true; 448 }); 449 } 450 }); 451 452 const identities = { 453 system: { name: 'System Admin', email: 'admin@system.test' }, 454 owner: { name: 'Realm Owner', email: 'owner@acme.test' }, 455 admin: { name: 'Realm Admin', email: 'realm-admin@managed.test' }, 456 }; 457 458 const realmInfo = { 459 acme: { label: 'Acme', roles: ['system', 'owner'] }, 460 globex: { label: 'Globex', roles: ['system', 'admin'] }, 461 northwind: { label: 'Northwind', roles: ['system'] }, 462 }; 463 const realmOrder = ['acme', 'globex', 'northwind']; 464 465 const providers = { 466 acme: [ 467 { 468 slug: 'example-sso', 469 name: 'Example SSO', 470 issuer: 'https://idp.example.com', 471 clientId: 'auth-example', 472 hasSecret: true, 473 enabled: true, 474 domains: ['sso.acme.test'], 475 }, 476 { 477 slug: 'legacy-sso', 478 name: 'Legacy SSO', 479 issuer: 'https://old-idp.example.net', 480 clientId: 'legacy-app', 481 hasSecret: false, 482 enabled: false, 483 domains: [], 484 }, 485 ], 486 globex: [ 487 { 488 slug: 'globex-id', 489 name: 'Globex Identity', 490 issuer: 'https://login.globex.test', 491 clientId: 'gx-auth', 492 hasSecret: true, 493 enabled: true, 494 domains: ['globex.test'], 495 }, 496 ], 497 northwind: [], 498 }; 499 500 const currentRole = { value: 'system' }; 501 let currentRealm = 'acme'; 502 503 const roleButtons = document.querySelectorAll('[data-role-target]'); 504 const realmNavLinks = document.querySelectorAll('[data-realm-nav]'); 505 const realmNavLabels = document.querySelectorAll('[data-realm-nav-label]'); 506 const settingsNavLinks = document.querySelectorAll('[data-settings-nav]'); 507 const breadcrumbRootLink = document.getElementById('providers-breadcrumb-root'); 508 const breadcrumbRealmLink = document.getElementById('providers-breadcrumb-realm'); 509 const breadcrumbRootLabels = document.querySelectorAll('[data-realm-breadcrumb-root]'); 510 511 const realmSelect = document.getElementById('providers-realm-select'); 512 const realmSelectValue = realmSelect.querySelector('.select-value'); 513 const realmSelectOptions = [...realmSelect.querySelectorAll('.select-option')]; 514 515 const notice = document.getElementById('providers-notice'); 516 const searchInput = document.getElementById('providers-search'); 517 const searchEmpty = document.getElementById('providers-search-empty'); 518 const realmEmpty = document.getElementById('providers-realm-empty'); 519 const providerRows = document.getElementById('providers-rows'); 520 const addButton = document.getElementById('providers-add-button'); 521 522 function accessibleRealms() { 523 return realmOrder.filter((slug) => realmInfo[slug].roles.includes(currentRole.value)); 524 } 525 526 function providerRowList() { 527 return [...providerRows.querySelectorAll('.provider-row')]; 528 } 529 530 function showNotice(message) { 531 notice.textContent = message; 532 notice.hidden = false; 533 } 534 535 function escapeHtml(value) { 536 return String(value).replace(/[&<>"']/g, (character) => { 537 const entities = { '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }; 538 return entities[character]; 539 }); 540 } 541 542 function findProvider(slug) { 543 return (providers[currentRealm] || []).find((entry) => entry.slug === slug); 544 } 545 546 function providerRowElement(entry) { 547 const row = document.createElement('tr'); 548 row.className = 'provider-row'; 549 row.dataset.search = `${entry.name} ${entry.slug} ${entry.issuer}`.toLowerCase(); 550 row.dataset.slug = entry.slug; 551 552 row.innerHTML = ` 553 <td data-label="Provider">${escapeHtml(entry.name)}</td> 554 <td data-label="Issuer"><span class="table-mono">${escapeHtml(entry.issuer)}</span></td> 555 <td data-label="Status"><span class="status"><span class="status-dot" aria-hidden="true"></span>${entry.enabled ? 'Enabled' : 'Disabled'}</span></td> 556 <td data-label="Domains">${entry.domains.length}</td> 557 <td data-label="Actions"> 558 <a class="button-inline" href="#" data-edit-provider="${escapeHtml(entry.slug)}">Edit</a> 559 <button class="button-inline" type="button" data-toggle-provider="${escapeHtml(entry.slug)}">${entry.enabled ? 'Disable' : 'Enable'}</button> 560 <button class="button-inline button-danger" type="button" data-delete-provider="${escapeHtml(entry.slug)}">Delete</button> 561 </td>`; 562 return row; 563 } 564 565 function renderProviders() { 566 const list = providers[currentRealm] || []; 567 providerRows.replaceChildren(...list.map(providerRowElement)); 568 applySearch(); 569 } 570 571 function applySearch() { 572 const term = searchInput.value.trim().toLowerCase(); 573 const total = (providers[currentRealm] || []).length; 574 let visible = 0; 575 576 providerRowList().forEach((row) => { 577 const match = !term || (row.dataset.search || '').includes(term); 578 row.hidden = !match; 579 if (match) visible += 1; 580 }); 581 582 searchEmpty.hidden = total === 0 || visible !== 0; 583 realmEmpty.hidden = total !== 0; 584 } 585 586 function syncSelector() { 587 realmSelectOptions.forEach((option) => { 588 const slug = option.dataset.value; 589 const accessible = realmInfo[slug].roles.includes(currentRole.value); 590 option.hidden = !accessible; 591 const selected = slug === currentRealm; 592 option.classList.toggle('is-selected', selected); 593 option.setAttribute('aria-selected', String(selected)); 594 }); 595 realmSelectValue.textContent = realmInfo[currentRealm].label; 596 realmSelect.dataset.value = currentRealm; 597 } 598 599 function editParams() { 600 const params = new URLSearchParams(); 601 params.set('realm', currentRealm); 602 params.set('role', currentRole.value); 603 if (currentTheme !== 'auto') params.set('theme', currentTheme); 604 return params.toString(); 605 } 606 607 function subpageUrl(path, extraParams) { 608 const params = new URLSearchParams(editParams()); 609 if (extraParams) { 610 new URLSearchParams(extraParams).forEach((value, key) => params.set(key, value)); 611 } 612 return `./${path}?${params.toString()}`; 613 } 614 615 function realmListParams() { 616 const params = new URLSearchParams(); 617 params.set('role', currentRole.value); 618 if (currentTheme !== 'auto') params.set('theme', currentTheme); 619 return params.toString(); 620 } 621 622 function realmNavHref() { 623 return accessibleRealms().length === 1 624 ? subpageUrl('admin-settings.html') 625 : `./admin-realms.html?${realmListParams()}`; 626 } 627 628 function syncRealmLinks() { 629 const count = accessibleRealms().length; 630 const label = count === 1 ? 'Realm' : 'Realms'; 631 const href = realmNavHref(); 632 633 realmNavLabels.forEach((element) => { 634 element.textContent = label; 635 }); 636 realmNavLinks.forEach((link) => { 637 link.href = href; 638 link.classList.add('is-active'); 639 link.removeAttribute('aria-current'); 640 }); 641 breadcrumbRootLabels.forEach((element) => { 642 element.textContent = label; 643 }); 644 breadcrumbRootLink.href = href; 645 breadcrumbRealmLink.textContent = realmInfo[currentRealm].label; 646 breadcrumbRealmLink.href = subpageUrl('admin-settings.html'); 647 } 648 649 function syncUrl() { 650 const params = new URLSearchParams(); 651 params.set('realm', currentRealm); 652 params.set('role', currentRole.value); 653 if (currentTheme !== 'auto') params.set('theme', currentTheme); 654 try { 655 window.history.replaceState({}, '', `${window.location.pathname}?${params.toString()}`); 656 } catch (e) { 657 /* ignore history updates when opened from file:// */ 658 } 659 } 660 661 function setRole(role) { 662 currentRole.value = role; 663 const identity = identities[role]; 664 665 document.querySelectorAll('.menu-heading-title').forEach((element) => { 666 element.textContent = identity.name; 667 }); 668 document.querySelectorAll('.menu-heading-meta').forEach((element) => { 669 element.textContent = identity.email; 670 }); 671 672 roleButtons.forEach((button) => { 673 const active = button.dataset.roleTarget === role; 674 button.classList.toggle('is-active', active); 675 button.setAttribute('aria-pressed', String(active)); 676 }); 677 678 settingsNavLinks.forEach((link) => { 679 link.hidden = role !== 'system'; 680 }); 681 682 if (!accessibleRealms().includes(currentRealm)) { 683 currentRealm = accessibleRealms()[0] || 'acme'; 684 } 685 686 syncSelector(); 687 renderProviders(); 688 syncRealmLinks(); 689 syncUrl(); 690 } 691 692 roleButtons.forEach((button) => { 693 button.addEventListener('click', () => setRole(button.dataset.roleTarget)); 694 }); 695 696 const selectObserver = new MutationObserver(() => { 697 const value = realmSelect.dataset.value; 698 if (value && value !== currentRealm) { 699 currentRealm = value; 700 renderProviders(); 701 syncSelector(); 702 syncRealmLinks(); 703 syncUrl(); 704 } 705 }); 706 selectObserver.observe(realmSelect, { attributes: true, attributeFilter: ['data-value'] }); 707 708 addButton.addEventListener('click', () => { 709 window.location.href = subpageUrl('admin-realm-provider-edit.html', 'mode=create'); 710 }); 711 712 searchInput.addEventListener('input', applySearch); 713 714 const toggleDialog = document.getElementById('providers-toggle-dialog'); 715 const toggleMessage = document.getElementById('providers-toggle-message'); 716 const toggleConfirmButton = document.getElementById('providers-toggle-confirm-button'); 717 let pendingToggleSlug = ''; 718 719 function toggleProvider(slug, enabled) { 720 const entry = findProvider(slug); 721 if (!entry) return; 722 entry.enabled = enabled; 723 renderProviders(); 724 showNotice(`Provider ${entry.name} ${enabled ? 'enabled' : 'disabled'}.`); 725 } 726 727 function openToggleDialog(slug) { 728 const entry = findProvider(slug); 729 if (!entry) return; 730 pendingToggleSlug = slug; 731 if (entry.domains.length) { 732 toggleMessage.textContent = `While ${entry.name} is disabled, sign-in for ${entry.domains.join(', ')} falls back to password. Existing sessions are not affected.`; 733 toggleDialog.hidden = false; 734 requestAnimationFrame(() => toggleConfirmButton.focus()); 735 return; 736 } 737 toggleProvider(slug, !entry.enabled); 738 } 739 740 toggleConfirmButton.addEventListener('click', () => { 741 if (!pendingToggleSlug) return; 742 const entry = findProvider(pendingToggleSlug); 743 if (entry) toggleProvider(pendingToggleSlug, !entry.enabled); 744 pendingToggleSlug = ''; 745 toggleDialog.hidden = true; 746 }); 747 748 const deleteDialog = document.getElementById('providers-delete-dialog'); 749 const deleteMessage = document.getElementById('providers-delete-message'); 750 const deleteInput = document.getElementById('providers-delete-confirm'); 751 const confirmDeleteButton = document.getElementById('providers-delete-confirm-button'); 752 let pendingDeleteSlug = ''; 753 754 function openDeleteDialog(slug) { 755 const entry = findProvider(slug); 756 if (!entry) return; 757 pendingDeleteSlug = slug; 758 const domainNote = entry.domains.length 759 ? ` Connected domains ${entry.domains.join(', ')} will be unlinked and fall back to password sign-in.` 760 : ' No email domains are connected to this provider.'; 761 deleteMessage.textContent = `Delete ${entry.name}? This cannot be undone.${domainNote}`; 762 deleteInput.value = ''; 763 deleteInput.placeholder = slug; 764 confirmDeleteButton.disabled = true; 765 deleteDialog.hidden = false; 766 requestAnimationFrame(() => deleteInput.focus()); 767 } 768 769 deleteInput.addEventListener('input', () => { 770 confirmDeleteButton.disabled = deleteInput.value.trim().toLowerCase() !== pendingDeleteSlug; 771 }); 772 773 confirmDeleteButton.addEventListener('click', () => { 774 if (!pendingDeleteSlug || confirmDeleteButton.disabled) return; 775 providers[currentRealm] = (providers[currentRealm] || []).filter((entry) => entry.slug !== pendingDeleteSlug); 776 const deleted = pendingDeleteSlug; 777 pendingDeleteSlug = ''; 778 deleteDialog.hidden = true; 779 renderProviders(); 780 showNotice(`Provider ${deleted} deleted.`); 781 }); 782 783 providerRows.addEventListener('click', (event) => { 784 const editLink = event.target.closest('[data-edit-provider]'); 785 if (editLink) { 786 event.preventDefault(); 787 event.stopPropagation(); 788 window.location.href = subpageUrl('admin-realm-provider-edit.html', `provider=${encodeURIComponent(editLink.dataset.editProvider)}`); 789 return; 790 } 791 792 const toggleButton = event.target.closest('[data-toggle-provider]'); 793 if (toggleButton) { 794 event.stopPropagation(); 795 openToggleDialog(toggleButton.dataset.toggleProvider); 796 return; 797 } 798 799 const deleteButton = event.target.closest('[data-delete-provider]'); 800 if (deleteButton) { 801 event.stopPropagation(); 802 openDeleteDialog(deleteButton.dataset.deleteProvider); 803 } 804 }); 805 806 const initialParams = new URLSearchParams(window.location.search); 807 const initialTheme = initialParams.get('theme'); 808 if (initialTheme === 'light' || initialTheme === 'dark') setTheme(initialTheme); 809 810 const initialRole = initialParams.get('role'); 811 if (identities[initialRole]) currentRole.value = initialRole; 812 813 const initialRealm = initialParams.get('realm'); 814 if (realmInfo[initialRealm] && realmInfo[initialRealm].roles.includes(currentRole.value)) { 815 currentRealm = initialRealm; 816 } else { 817 currentRealm = accessibleRealms()[0] || 'acme'; 818 } 819 820 setRole(currentRole.value); 821 822 const returnedFrom = initialParams.get('saved'); 823 if (returnedFrom) showNotice(`Provider ${returnedFrom} saved.`); 824 </script> 825 <script src="./shell.js"></script> 826 </body> 827 </html>