auth

Main authentication module for my projects
git clone git://git.finwo.net/app/auth
Log | Files | Refs

admin-client-detail.html (32671B)


      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 client detail mockup</title>
      7     <link rel="stylesheet" href="../../app/shared/style/global.css" />
      8     <link rel="stylesheet" href="../../app/shared/component/user-menu.css" />
      9     <link rel="stylesheet" href="./mockups.css" />
     10   </head>
     11   <body>
     12     <header class="topbar">
     13       <a class="brand" href="./admin-dashboard.html">
     14         <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">
     15           <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" />
     16         </svg>
     17         <span class="brand-name">Auth</span>
     18       </a>
     19       <div class="topbar-actions">
     20         <button class="mobile-nav-toggle" type="button" id="mobile-nav-toggle" aria-controls="mobile-navigation" aria-expanded="false" aria-label="Open navigation">
     21           <span class="mobile-nav-toggle-bars" aria-hidden="true"></span>
     22         </button>
     23         <details class="menu user-menu">
     24           <summary class="menu-trigger" aria-label="Account menu">
     25             <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
     26               <circle cx="12" cy="12" r="10" />
     27               <circle cx="12" cy="10" r="3" />
     28               <path d="M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662" />
     29             </svg>
     30           </summary>
     31           <div class="menu-panel">
     32             <div class="menu-heading">
     33               <span class="menu-heading-title">System Admin</span>
     34               <span class="menu-heading-meta">admin@system.test</span>
     35             </div>
     36             <div class="menu-list">
     37               <a class="menu-item" href="#">
     38                 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
     39                   <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" />
     40                   <circle cx="12" cy="12" r="3" />
     41                 </svg>
     42                 <span>Account settings</span>
     43               </a>
     44               <button class="menu-item" type="button" data-user-theme>
     45                 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
     46                   <circle cx="12" cy="12" r="4" />
     47                   <path d="M12 2v2" />
     48                   <path d="M12 20v2" />
     49                   <path d="m4.93 4.93 1.41 1.41" />
     50                   <path d="m17.66 17.66 1.41 1.41" />
     51                   <path d="M2 12h2" />
     52                   <path d="M20 12h2" />
     53                   <path d="m6.34 17.66-1.41 1.41" />
     54                   <path d="m19.07 4.93-1.41 1.41" />
     55                 </svg>
     56                 <span>Theme</span>
     57                 <span class="menu-value" data-user-theme-value>Auto</span>
     58               </button>
     59               <a class="menu-item" href="#">
     60                 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
     61                   <path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" />
     62                   <path d="m16 17 5-5-5-5" />
     63                   <path d="M21 12H9" />
     64                 </svg>
     65                 <span>Sign out</span>
     66               </a>
     67             </div>
     68           </div>
     69         </details>
     70       </div>
     71     </header>
     72 
     73     <div class="mobile-nav" id="mobile-navigation" aria-hidden="true">
     74       <nav class="nav" aria-label="Administration">
     75         <p class="nav-label">Administration</p>
     76         <a class="nav-item" href="./admin-dashboard.html">
     77           <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
     78             <rect x="3" y="3" width="7" height="7" />
     79             <rect x="14" y="3" width="7" height="7" />
     80             <rect x="3" y="14" width="7" height="7" />
     81             <rect x="14" y="14" width="7" height="7" />
     82           </svg>
     83           <span>Overview</span>
     84         </a>
     85         <a class="nav-item" href="./admin-realms.html">
     86           <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
     87             <path d="M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z" />
     88             <path d="M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2" />
     89             <path d="M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2" />
     90             <path d="M10 6h4" />
     91             <path d="M10 10h4" />
     92             <path d="M10 14h4" />
     93             <path d="M10 18h4" />
     94           </svg>
     95             <span>Realms</span>
     96         </a>
     97         <a class="nav-item is-active" href="./admin-clients.html" aria-current="page">
     98           <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
     99             <rect x="2" y="4" width="20" height="16" rx="2" />
    100             <path d="M10 4v4" />
    101             <path d="M2 8h20" />
    102             <path d="M6 4v4" />
    103           </svg>
    104           <span>Clients</span>
    105         </a>
    106         <a class="nav-item" href="#">
    107           <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
    108             <path d="M22 12h-4l-3 8-6-16-3 8H2" />
    109           </svg>
    110           <span>Sessions</span>
    111         </a>
    112         <a class="nav-item" href="./admin-users.html">
    113           <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
    114             <path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" />
    115             <circle cx="12" cy="7" r="4" />
    116           </svg>
    117           <span>Users</span>
    118         </a>
    119         <a class="nav-item" href="./admin-system-settings.html">
    120           <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
    121             <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" />
    122             <circle cx="12" cy="12" r="3" />
    123           </svg>
    124           <span>Settings</span>
    125         </a>
    126       </nav>
    127       <div class="mobile-nav-divider" aria-hidden="true"></div>
    128       <section class="mobile-nav-account" aria-label="Account">
    129         <div class="menu-heading">
    130           <span class="menu-heading-title">System Admin</span>
    131           <span class="menu-heading-meta">admin@system.test</span>
    132         </div>
    133         <div class="menu-list">
    134           <a class="menu-item" href="#">
    135             <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
    136               <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" />
    137               <circle cx="12" cy="12" r="3" />
    138             </svg>
    139             <span>Account settings</span>
    140           </a>
    141           <button class="menu-item" type="button" data-user-theme>
    142             <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
    143               <circle cx="12" cy="12" r="4" />
    144               <path d="M12 2v2" />
    145               <path d="M12 20v2" />
    146               <path d="m4.93 4.93 1.41 1.41" />
    147               <path d="m17.66 17.66 1.41 1.41" />
    148               <path d="M2 12h2" />
    149               <path d="M20 12h2" />
    150               <path d="m6.34 17.66-1.41 1.41" />
    151               <path d="m19.07 4.93-1.41 1.41" />
    152             </svg>
    153             <span>Theme</span>
    154             <span class="menu-value" data-user-theme-value>Auto</span>
    155           </button>
    156           <a class="menu-item" href="#">
    157             <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
    158               <path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" />
    159               <path d="m16 17 5-5-5-5" />
    160               <path d="M21 12H9" />
    161             </svg>
    162             <span>Sign out</span>
    163           </a>
    164         </div>
    165       </section>
    166     </div>
    167 
    168     <div class="app">
    169       <aside class="sidebar">
    170         <nav class="nav" aria-label="Administration">
    171           <p class="nav-label">Administration</p>
    172           <a class="nav-item" href="./admin-dashboard.html">
    173             <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
    174               <rect x="3" y="3" width="7" height="7" />
    175               <rect x="14" y="3" width="7" height="7" />
    176               <rect x="3" y="14" width="7" height="7" />
    177               <rect x="14" y="14" width="7" height="7" />
    178             </svg>
    179             <span>Overview</span>
    180           </a>
    181           <a class="nav-item" href="./admin-realms.html">
    182             <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
    183               <path d="M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z" />
    184               <path d="M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2" />
    185               <path d="M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2" />
    186               <path d="M10 6h4" />
    187               <path d="M10 10h4" />
    188               <path d="M10 14h4" />
    189               <path d="M10 18h4" />
    190             </svg>
    191               <span>Realms</span>
    192           </a>
    193           <a class="nav-item is-active" href="./admin-clients.html" aria-current="page">
    194             <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
    195               <rect x="2" y="4" width="20" height="16" rx="2" />
    196               <path d="M10 4v4" />
    197               <path d="M2 8h20" />
    198               <path d="M6 4v4" />
    199             </svg>
    200             <span>Clients</span>
    201           </a>
    202           <a class="nav-item" href="#">
    203             <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
    204               <path d="M22 12h-4l-3 8-6-16-3 8H2" />
    205             </svg>
    206             <span>Sessions</span>
    207           </a>
    208           <a class="nav-item" href="./admin-users.html">
    209             <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
    210               <path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" />
    211               <circle cx="12" cy="7" r="4" />
    212             </svg>
    213             <span>Users</span>
    214           </a>
    215           <a class="nav-item" href="./admin-system-settings.html">
    216             <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
    217               <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" />
    218               <circle cx="12" cy="12" r="3" />
    219             </svg>
    220             <span>Settings</span>
    221           </a>
    222         </nav>
    223       </aside>
    224 
    225       <div class="main">
    226         <main class="content">
    227           <div class="page-header page-header-row">
    228             <div>
    229               <div class="breadcrumb">
    230                 <a href="./admin-clients.html">Clients</a>
    231                 <span aria-hidden="true">/</span>
    232                 <span>Internal App</span>
    233               </div>
    234               <h1>Internal App</h1>
    235               <p>internal-app</p>
    236             </div>
    237             <button class="button button-primary" type="button">Save changes</button>
    238           </div>
    239 
    240           <div class="stack">
    241             <section class="panel">
    242               <h2>Settings</h2>
    243               <dl class="details">
    244                 <div>
    245                   <dt>Access mode</dt>
    246                   <dd>Internal</dd>
    247                 </div>
    248                 <div>
    249                   <dt>Consent</dt>
    250                   <dd>Remembered</dd>
    251                 </div>
    252                 <div>
    253                   <dt>Token authentication</dt>
    254                   <dd>Public client: PKCE</dd>
    255                 </div>
    256                 <div>
    257                   <dt>Scopes</dt>
    258                   <dd>openid profile email</dd>
    259                 </div>
    260                 <div>
    261                   <dt>Redirect URIs</dt>
    262                   <dd>https://app.acme.localhost/callback</dd>
    263                 </div>
    264                 <div>
    265                   <dt>Required roles</dt>
    266                   <dd>None</dd>
    267                 </div>
    268               </dl>
    269             </section>
    270 
    271             <section class="panel">
    272               <h2>Secret</h2>
    273               <p class="note">No client secret is configured. Creating one switches this client to confidential authentication.</p>
    274               <div class="action-row">
    275                 <button class="button button-primary" type="button">Create secret</button>
    276               </div>
    277             </section>
    278 
    279             <section class="panel" aria-labelledby="client-hosts-title">
    280               <h2 id="client-hosts-title">Hosts</h2>
    281               <p class="note">Hostnames that resolve to this client.</p>
    282 
    283               <div id="client-hosts-notice" class="notice" role="status" hidden></div>
    284 
    285               <div class="toolbar toolbar-panel">
    286                 <div class="toolbar-search">
    287                   <input id="client-hosts-search" type="search" aria-label="Search hosts" placeholder="Search hosts" />
    288                 </div>
    289                 <div class="toolbar-actions">
    290                   <button id="client-hosts-add-button" class="button button-primary" type="button">Add host</button>
    291                 </div>
    292               </div>
    293 
    294               <table class="table">
    295                 <thead>
    296                   <tr>
    297                     <th scope="col">Hostname</th>
    298                     <th scope="col">Added</th>
    299                     <th scope="col">Actions</th>
    300                   </tr>
    301                 </thead>
    302                 <tbody id="client-hosts-rows"></tbody>
    303               </table>
    304               <p id="client-hosts-search-empty" class="empty" hidden>No hosts match this search.</p>
    305               <p id="client-hosts-empty" class="empty" hidden>No hosts are assigned to this client.</p>
    306             </section>
    307 
    308             <section class="panel danger-zone">
    309               <h2>Danger zone</h2>
    310               <p class="note">Deleting removes the client registration and related authorization state.</p>
    311               <div class="action-row">
    312                 <button class="button button-danger" type="button" data-dialog-open="client-delete-dialog">Delete client</button>
    313               </div>
    314             </section>
    315           </div>
    316         </main>
    317       </div>
    318     </div>
    319 
    320     <div id="client-delete-dialog" class="overlay" hidden>
    321       <div class="modal" role="dialog" aria-modal="true" aria-labelledby="client-delete-title">
    322         <div class="modal-header">
    323           <h2 id="client-delete-title">Delete client</h2>
    324           <button class="modal-close" type="button" aria-label="Close dialog" data-dialog-close>
    325             <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
    326               <path d="M18 6 6 18" />
    327               <path d="m6 6 12 12" />
    328             </svg>
    329           </button>
    330         </div>
    331         <div class="modal-body">
    332           <p class="modal-note">
    333             Delete Internal App (internal-app) from acme? This cannot be undone.
    334           </p>
    335           <div class="modal-actions">
    336             <button class="button button-secondary" type="button" data-dialog-close>Cancel</button>
    337             <button class="button button-danger" type="button" data-dialog-close>Delete client</button>
    338           </div>
    339         </div>
    340       </div>
    341     </div>
    342 
    343     <div id="client-hosts-create-dialog" class="overlay" hidden>
    344       <form id="client-hosts-create-form" class="modal" role="dialog" aria-modal="true" aria-labelledby="client-hosts-create-title" novalidate>
    345         <div class="modal-header">
    346           <h2 id="client-hosts-create-title">Add host</h2>
    347           <button class="modal-close" type="button" aria-label="Close dialog" data-dialog-close>
    348             <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
    349               <path d="M18 6 6 18" />
    350               <path d="m6 6 12 12" />
    351             </svg>
    352           </button>
    353         </div>
    354         <div class="modal-body">
    355           <div id="client-hosts-create-alert" class="alert" role="alert" hidden></div>
    356 
    357           <label class="field" for="client-hosts-host-input">
    358             <span class="field-label">Hostname</span>
    359             <input id="client-hosts-host-input" class="field-control" type="text" maxlength="253" placeholder="app.acme.test" autocomplete="off" spellcheck="false" />
    360           </label>
    361           <p class="modal-note">Lowercase hostname. Do not include a scheme, port, path or wildcard.</p>
    362 
    363           <div class="modal-actions">
    364             <button class="button button-secondary" type="button" data-dialog-close>Cancel</button>
    365             <button class="button button-primary" type="submit">Add host</button>
    366           </div>
    367         </div>
    368       </form>
    369     </div>
    370 
    371     <div id="client-hosts-remove-dialog" class="overlay" hidden>
    372       <div class="modal" role="dialog" aria-modal="true" aria-labelledby="client-hosts-remove-title">
    373         <div class="modal-header">
    374           <h2 id="client-hosts-remove-title">Remove host</h2>
    375           <button class="modal-close" type="button" aria-label="Close dialog" data-dialog-close>
    376             <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
    377               <path d="M18 6 6 18" />
    378               <path d="m6 6 12 12" />
    379             </svg>
    380           </button>
    381         </div>
    382         <div class="modal-body">
    383           <p id="client-hosts-remove-message" class="modal-note"></p>
    384           <label class="field" for="client-hosts-remove-confirm">
    385             <span class="field-label">Confirm hostname</span>
    386             <input id="client-hosts-remove-confirm" class="field-control" type="text" maxlength="253" autocomplete="off" spellcheck="false" />
    387           </label>
    388           <p class="modal-note">Type the hostname exactly to confirm.</p>
    389           <div class="modal-actions">
    390             <button class="button button-secondary" type="button" data-dialog-close>Cancel</button>
    391             <button id="client-hosts-remove-confirm-button" class="button button-danger" type="button" disabled>Remove host</button>
    392           </div>
    393         </div>
    394       </div>
    395     </div>
    396 
    397     <div class="mockup-controls" aria-label="Mockup theme">
    398       <span class="mockup-label">Mockup</span>
    399       <button class="mockup-button is-active" type="button" data-theme-target="auto">Auto</button>
    400       <button class="mockup-button" type="button" data-theme-target="light">Light</button>
    401       <button class="mockup-button" type="button" data-theme-target="dark">Dark</button>
    402     </div>
    403 
    404     <script>
    405       const root = document.documentElement;
    406       const themeButtons = document.querySelectorAll('[data-theme-target]');
    407       const userThemeButtons = document.querySelectorAll('[data-user-theme]');
    408       const userThemeValues = document.querySelectorAll('[data-user-theme-value]');
    409       let currentTheme = 'auto';
    410 
    411       function setTheme(value) {
    412         currentTheme = value;
    413         if (value === 'auto') {
    414           root.removeAttribute('data-theme');
    415         } else {
    416           root.setAttribute('data-theme', value);
    417         }
    418         themeButtons.forEach((button) => {
    419           button.classList.toggle('is-active', button.dataset.themeTarget === value);
    420         });
    421         userThemeValues.forEach((element) => {
    422           element.textContent = value.charAt(0).toUpperCase() + value.slice(1);
    423         });
    424       }
    425 
    426       themeButtons.forEach((button) => {
    427         button.addEventListener('click', () => setTheme(button.dataset.themeTarget));
    428       });
    429 
    430       userThemeButtons.forEach((button) => {
    431         button.addEventListener('click', () => {
    432         const themes = ['auto', 'light', 'dark'];
    433           setTheme(themes[(themes.indexOf(currentTheme) + 1) % themes.length]);
    434         });
    435       });
    436 
    437       const userMenu = document.querySelector('.user-menu');
    438       document.addEventListener('click', (event) => {
    439         if (userMenu && userMenu.open && !userMenu.contains(event.target)) {
    440           userMenu.open = false;
    441         }
    442       });
    443 
    444       function visibleDialogs() {
    445         return [...document.querySelectorAll('.overlay:not([hidden])')];
    446       }
    447 
    448       document.querySelectorAll('[data-dialog-open]').forEach((button) => {
    449         button.addEventListener('click', () => {
    450           const dialog = document.getElementById(button.dataset.dialogOpen);
    451           if (!dialog) return;
    452           dialog.hidden = false;
    453           dialog.querySelector('.modal-close')?.focus();
    454         });
    455       });
    456 
    457       document.querySelectorAll('[data-dialog-close]').forEach((button) => {
    458         button.addEventListener('click', () => {
    459           button.closest('.overlay').hidden = true;
    460         });
    461       });
    462 
    463       document.querySelectorAll('.overlay').forEach((overlay) => {
    464         overlay.addEventListener('mousedown', (event) => {
    465           if (event.target === overlay) overlay.hidden = true;
    466         });
    467       });
    468 
    469       document.addEventListener('keydown', (event) => {
    470         if (event.key === 'Escape') {
    471           visibleDialogs().forEach((dialog) => {
    472             dialog.hidden = true;
    473           });
    474         }
    475       });
    476     </script>
    477     <script>
    478       (function () {
    479         const clientName = 'Internal App';
    480         const clientId = 'internal-app';
    481 
    482         const hostAssignments = {
    483           'app.acme.localhost': { client: clientId },
    484           'acme.localhost': { realm: 'Acme' },
    485           'login.acme.test': { realm: 'Acme' },
    486           'globex.localhost': { realm: 'Globex' },
    487           'portal.globex.test': { client: 'globex-portal' },
    488           'auth.example.test': { reserved: true },
    489         };
    490 
    491         let hosts = [{ host: 'app.acme.localhost', added: '12 Mar 2026' }];
    492 
    493         const rowsEl = document.getElementById('client-hosts-rows');
    494         const searchInput = document.getElementById('client-hosts-search');
    495         const searchEmpty = document.getElementById('client-hosts-search-empty');
    496         const emptyEl = document.getElementById('client-hosts-empty');
    497         const notice = document.getElementById('client-hosts-notice');
    498         const addButton = document.getElementById('client-hosts-add-button');
    499 
    500         const createDialog = document.getElementById('client-hosts-create-dialog');
    501         const createForm = document.getElementById('client-hosts-create-form');
    502         const createAlert = document.getElementById('client-hosts-create-alert');
    503         const hostInput = document.getElementById('client-hosts-host-input');
    504 
    505         const removeDialog = document.getElementById('client-hosts-remove-dialog');
    506         const removeMessage = document.getElementById('client-hosts-remove-message');
    507         const removeInput = document.getElementById('client-hosts-remove-confirm');
    508         const confirmRemoveButton = document.getElementById('client-hosts-remove-confirm-button');
    509         let pendingRemoveHost = '';
    510 
    511         function escapeHtml(value) {
    512           return String(value).replace(/[&<>"']/g, (character) => {
    513             const entities = { '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' };
    514             return entities[character];
    515           });
    516         }
    517 
    518         function normalizeHost(value) {
    519           return value.trim().toLowerCase();
    520         }
    521 
    522         function showNotice(message) {
    523           notice.textContent = message;
    524           notice.hidden = false;
    525         }
    526 
    527         function render() {
    528           rowsEl.replaceChildren(
    529             ...hosts.map((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           applySearch();
    543         }
    544 
    545         function applySearch() {
    546           const term = searchInput.value.trim().toLowerCase();
    547           let visible = 0;
    548           [...rowsEl.querySelectorAll('.host-row')].forEach((row) => {
    549             const match = !term || (row.dataset.search || '').includes(term);
    550             row.hidden = !match;
    551             if (match) visible += 1;
    552           });
    553           searchEmpty.hidden = hosts.length === 0 || visible !== 0;
    554           emptyEl.hidden = hosts.length !== 0;
    555         }
    556 
    557         function hostnameError(raw) {
    558           const value = raw.trim();
    559           const host = normalizeHost(value);
    560 
    561           if (!host) return 'Hostname is required.';
    562           if (/\s/.test(value)) return 'Hostname must not contain spaces.';
    563           if (host.includes('://') || /^[a-z][a-z0-9+.-]*:\/\//i.test(value)) {
    564             return 'Hostname must not include a scheme such as https://.';
    565           }
    566           if (host.includes('@')) return 'Hostname must not include @.';
    567           if (host.includes('/')) return 'Hostname must not include a path.';
    568           if (host.includes('*')) return 'Wildcard hostnames are not supported.';
    569           if (host.startsWith('[')) {
    570             if (!host.endsWith(']')) return 'Enter a valid IPv6 hostname.';
    571           } else if (host.includes(':')) {
    572             return 'Hostname must not include a port.';
    573           }
    574           if (host.length > 253) return 'Hostname must be 253 characters or fewer.';
    575           if (host.startsWith('.') || host.endsWith('.')) return 'Hostname must not start or end with a dot.';
    576 
    577           if (!host.startsWith('[')) {
    578             const labels = host.split('.');
    579             if (labels.length < 2) return 'Enter a complete hostname such as app.acme.test.';
    580             for (const label of labels) {
    581               if (!/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/.test(label)) {
    582                 return 'Hostname labels may use lowercase letters, numbers and hyphens.';
    583               }
    584               if (label.length > 63) return 'Each hostname label must be 63 characters or fewer.';
    585             }
    586           }
    587 
    588           if (hostAssignments[host] && hostAssignments[host].reserved) {
    589             return 'This hostname is reserved for the authentication service.';
    590           }
    591 
    592           const assignment = hostAssignments[host];
    593           if (assignment) {
    594             if (assignment.client === clientId) return 'This hostname is already assigned to this client.';
    595             if (assignment.client) return 'This hostname is already assigned to a client application.';
    596             if (assignment.realm) return 'This hostname is already assigned to the ' + assignment.realm + ' realm.';
    597             return 'This hostname is already assigned.';
    598           }
    599 
    600           return null;
    601         }
    602 
    603         function clearCreateError() {
    604           createAlert.hidden = true;
    605           createAlert.textContent = '';
    606           hostInput.removeAttribute('aria-invalid');
    607         }
    608 
    609         function showCreateError(message) {
    610           createAlert.hidden = false;
    611           createAlert.textContent = message;
    612           hostInput.setAttribute('aria-invalid', 'true');
    613         }
    614 
    615         addButton.addEventListener('click', () => {
    616           createForm.reset();
    617           clearCreateError();
    618           createDialog.hidden = false;
    619           requestAnimationFrame(() => hostInput.focus());
    620         });
    621 
    622         hostInput.addEventListener('input', clearCreateError);
    623 
    624         createForm.addEventListener('submit', (event) => {
    625           event.preventDefault();
    626           const error = hostnameError(hostInput.value);
    627           if (error) {
    628             showCreateError(error);
    629             return;
    630           }
    631 
    632           const host = normalizeHost(hostInput.value);
    633           hosts = [{ host, added: 'Just now' }, ...hosts];
    634           hostAssignments[host] = { client: clientId };
    635           createDialog.hidden = true;
    636           render();
    637           showNotice('Host ' + host + ' added.');
    638         });
    639 
    640         function openRemoveDialog(host) {
    641           pendingRemoveHost = host;
    642           removeMessage.textContent =
    643             'Remove ' + host + '? This hostname will stop resolving to ' + clientName + '. ' +
    644             'Sessions for this client on that host will end. Client settings and users are unaffected.';
    645           removeInput.value = '';
    646           removeInput.placeholder = host;
    647           confirmRemoveButton.disabled = true;
    648           removeDialog.hidden = false;
    649           requestAnimationFrame(() => removeInput.focus());
    650         }
    651 
    652         removeInput.addEventListener('input', () => {
    653           confirmRemoveButton.disabled = normalizeHost(removeInput.value) !== pendingRemoveHost;
    654         });
    655 
    656         confirmRemoveButton.addEventListener('click', () => {
    657           if (!pendingRemoveHost || confirmRemoveButton.disabled) return;
    658 
    659           hosts = hosts.filter((entry) => entry.host !== pendingRemoveHost);
    660           delete hostAssignments[pendingRemoveHost];
    661           const removed = pendingRemoveHost;
    662           pendingRemoveHost = '';
    663           removeDialog.hidden = true;
    664           render();
    665           showNotice('Host ' + removed + ' removed.');
    666         });
    667 
    668         rowsEl.addEventListener('click', (event) => {
    669           const removeButton = event.target.closest('[data-remove-host]');
    670           if (removeButton) {
    671             event.stopPropagation();
    672             openRemoveDialog(removeButton.dataset.removeHost);
    673           }
    674         });
    675 
    676         searchInput.addEventListener('input', applySearch);
    677 
    678         render();
    679       })();
    680     </script>
    681     <script src="./shell.js"></script>
    682   </body>
    683 </html>