auth

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

admin-dashboard.html (10828B)


      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" />
      6     <title>Admin dashboard mockup</title>
      7     <link rel="stylesheet" href="./global.css" />
      8     <style>
      9       .stats {
     10         display: grid;
     11         grid-template-columns: minmax(0, 1fr);
     12         gap: 1rem;
     13         margin-bottom: 1rem;
     14       }
     15 
     16       .stat {
     17         padding: 1.25rem 1.5rem;
     18         background: var(--surface);
     19         box-shadow: var(--shadow);
     20       }
     21 
     22       .stat-label {
     23         display: block;
     24         color: var(--muted);
     25         font-size: 0.8125rem;
     26         line-height: 1.4;
     27       }
     28 
     29       .stat-value {
     30         display: block;
     31         margin-top: 0.5rem;
     32         font-size: 1.75rem;
     33         font-weight: 300;
     34         line-height: 1.2;
     35       }
     36 
     37       @media (min-width: 60em) {
     38         .stats {
     39           grid-template-columns: repeat(4, minmax(0, 1fr));
     40         }
     41       }
     42     </style>
     43   </head>
     44   <body>
     45     <header class="topbar">
     46       <div class="brand">
     47         <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">
     48           <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" />
     49         </svg>
     50         <span class="brand-name">Auth</span>
     51       </div>
     52       <details class="user-menu" open>
     53         <summary aria-label="Account menu">
     54           <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
     55             <circle cx="12" cy="12" r="10" />
     56             <circle cx="12" cy="10" r="3" />
     57             <path d="M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662" />
     58           </svg>
     59         </summary>
     60         <div class="user-panel">
     61           <div class="user-summary">
     62             <span class="user-name">System Admin</span>
     63             <span class="user-meta">admin@system.test</span>
     64           </div>
     65           <div class="user-menu-list">
     66             <a class="user-menu-item" href="#">
     67               <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
     68                 <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" />
     69                 <circle cx="12" cy="12" r="3" />
     70               </svg>
     71               <span>Account settings</span>
     72             </a>
     73             <button class="user-menu-item" type="button" data-user-theme>
     74               <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
     75                 <circle cx="12" cy="12" r="4" />
     76                 <path d="M12 2v2" />
     77                 <path d="M12 20v2" />
     78                 <path d="m4.93 4.93 1.41 1.41" />
     79                 <path d="m17.66 17.66 1.41 1.41" />
     80                 <path d="M2 12h2" />
     81                 <path d="M20 12h2" />
     82                 <path d="m6.34 17.66-1.41 1.41" />
     83                 <path d="m19.07 4.93-1.41 1.41" />
     84               </svg>
     85               <span>Theme</span>
     86               <span class="user-menu-value" data-user-theme-value>Auto</span>
     87             </button>
     88             <a class="user-menu-item" href="#">
     89               <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
     90                 <path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" />
     91                 <path d="m16 17 5-5-5-5" />
     92                 <path d="M21 12H9" />
     93               </svg>
     94               <span>Sign out</span>
     95             </a>
     96           </div>
     97         </div>
     98       </details>
     99     </header>
    100 
    101     <div class="app">
    102       <aside class="sidebar">
    103         <nav class="nav" aria-label="Administration">
    104           <p class="nav-label">Administration</p>
    105           <a class="nav-item is-active" href="#" aria-current="page">
    106             <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
    107               <rect x="3" y="3" width="7" height="7" />
    108               <rect x="14" y="3" width="7" height="7" />
    109               <rect x="3" y="14" width="7" height="7" />
    110               <rect x="14" y="14" width="7" height="7" />
    111             </svg>
    112             <span>Overview</span>
    113           </a>
    114           <a class="nav-item" href="#">
    115             <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
    116               <path d="M22 12h-4l-3 8-6-16-3 8H2" />
    117             </svg>
    118             <span>Sessions</span>
    119           </a>
    120           <a class="nav-item" href="#">
    121             <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
    122               <circle cx="12" cy="12" r="9" />
    123               <path d="M3 12h18" />
    124               <path d="M12 3a15 15 0 0 1 0 18a15 15 0 0 1 0-18" />
    125             </svg>
    126             <span>Realms</span>
    127           </a>
    128           <a class="nav-item" href="#">
    129             <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
    130               <path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" />
    131               <circle cx="12" cy="7" r="4" />
    132             </svg>
    133             <span>Users</span>
    134           </a>
    135           <a class="nav-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               <circle cx="8" cy="15" r="4" />
    138               <path d="m11 12 9-9" />
    139               <path d="m17 6 3 3" />
    140             </svg>
    141             <span>Clients</span>
    142           </a>
    143         </nav>
    144       </aside>
    145 
    146       <div class="main">
    147         <main class="content">
    148           <div class="page-header">
    149             <h1>Overview</h1>
    150             <p>Provider summary and administration.</p>
    151           </div>
    152 
    153           <section class="stats" aria-label="Provider summary">
    154             <article class="stat">
    155               <span class="stat-label">Realms</span>
    156               <strong class="stat-value">2</strong>
    157             </article>
    158             <article class="stat">
    159               <span class="stat-label">Users</span>
    160               <strong class="stat-value">6</strong>
    161             </article>
    162             <article class="stat">
    163               <span class="stat-label">OIDC clients</span>
    164               <strong class="stat-value">6</strong>
    165             </article>
    166             <article class="stat">
    167               <span class="stat-label">Active sessions</span>
    168               <strong class="stat-value">3</strong>
    169             </article>
    170           </section>
    171 
    172           <div class="grid">
    173             <section class="panel">
    174               <h2>Account</h2>
    175               <dl class="details">
    176                 <div>
    177                   <dt>User</dt>
    178                   <dd>System Admin</dd>
    179                 </div>
    180                 <div>
    181                   <dt>Email</dt>
    182                   <dd>admin@system.test</dd>
    183                 </div>
    184                 <div>
    185                   <dt>Username</dt>
    186                   <dd>admin</dd>
    187                 </div>
    188                 <div>
    189                   <dt>Role</dt>
    190                   <dd>System administrator</dd>
    191                 </div>
    192               </dl>
    193             </section>
    194 
    195             <section class="panel">
    196               <h2>Access</h2>
    197               <dl class="details">
    198                 <div>
    199                   <dt>Client</dt>
    200                   <dd>admin</dd>
    201                 </div>
    202                 <div>
    203                   <dt>Refresh</dt>
    204                   <dd>Automatic</dd>
    205                 </div>
    206                 <div>
    207                   <dt>Scope</dt>
    208                   <dd>openid profile email</dd>
    209                 </div>
    210                 <div>
    211                   <dt>Session</dt>
    212                   <dd>Active</dd>
    213                 </div>
    214               </dl>
    215             </section>
    216           </div>
    217 
    218           <section class="panel panel-wide">
    219             <h2>Administration</h2>
    220             <p class="note">
    221               Manage realms, sessions, users and OIDC clients from the navigation.
    222             </p>
    223           </section>
    224         </main>
    225       </div>
    226     </div>
    227 
    228     <div class="mockup-controls" aria-label="Mockup theme">
    229       <span class="mockup-label">Mockup</span>
    230       <button class="mockup-button is-active" type="button" data-theme-target="auto">Auto</button>
    231       <button class="mockup-button" type="button" data-theme-target="light">Light</button>
    232       <button class="mockup-button" type="button" data-theme-target="dark">Dark</button>
    233     </div>
    234 
    235     <script>
    236       const root = document.documentElement;
    237       const themeButtons = document.querySelectorAll('[data-theme-target]');
    238       const userThemeButton = document.querySelector('[data-user-theme]');
    239       const userThemeValue = document.querySelector('[data-user-theme-value]');
    240       let currentTheme = 'auto';
    241 
    242       function setTheme(value) {
    243         currentTheme = value;
    244         if (value === 'auto') {
    245           root.removeAttribute('data-theme');
    246         } else {
    247           root.setAttribute('data-theme', value);
    248         }
    249 
    250         themeButtons.forEach((button) => {
    251           button.classList.toggle('is-active', button.dataset.themeTarget === value);
    252         });
    253         if (userThemeValue) {
    254           userThemeValue.textContent = value.charAt(0).toUpperCase() + value.slice(1);
    255         }
    256       }
    257 
    258       themeButtons.forEach((button) => {
    259         button.addEventListener('click', () => setTheme(button.dataset.themeTarget));
    260       });
    261 
    262       userThemeButton?.addEventListener('click', () => {
    263         const themes = ['auto', 'light', 'dark'];
    264         setTheme(themes[(themes.indexOf(currentTheme) + 1) % themes.length]);
    265       });
    266 
    267       const userMenu = document.querySelector('.user-menu');
    268       document.addEventListener('click', (event) => {
    269         if (userMenu.open && !userMenu.contains(event.target)) {
    270           userMenu.open = false;
    271         }
    272       });
    273     </script>
    274   </body>
    275 </html>