swarm-ui: header profile menu — initials avatar, authelia settings + logout (#3570)
Adds an "/api/whoami" same-origin nginx proxy to authelia's own GET /api/user/info (session-cookie authenticated, no swarm-controller code needed) and a new UserMenu header component: a generated initials avatar (first letter of display name, coloured from the same seven base16 chromatic slots the nav accent already cycles through) opening a popover with the signed-in name, a link to authelia settings, and log out — both reusing the existing "Authelia" entry from GET /api/links rather than a second source of the domain. Per mara's call on the open avatar-mechanism question: initials now, a real uploaded photo (authelia's settings UI implies pics are settable) is an explicit future item, not blocking this.
This commit is contained in:
parent
9ac037b21a
commit
dabd0fc823
4 changed files with 249 additions and 0 deletions
|
|
@ -31,6 +31,7 @@ import type { ComponentChildren } from 'preact';
|
|||
import { Link, useLocation } from 'wouter-preact';
|
||||
import { LinksMenu } from './LinksMenu.js';
|
||||
import { SettingsMenu } from './SettingsMenu.js';
|
||||
import { UserMenu } from './UserMenu.js';
|
||||
import { useApplyThemeOverride } from '../lib/theme-apply.js';
|
||||
import { useApplyMotionOverride } from '../lib/motion-apply.js';
|
||||
import './Shell.css';
|
||||
|
|
@ -284,6 +285,7 @@ export function Shell({ children }: { children: ComponentChildren }) {
|
|||
<div class="shell-header-actions">
|
||||
<SettingsMenu />
|
||||
<LinksMenu />
|
||||
<UserMenu />
|
||||
</div>
|
||||
</header>
|
||||
{/* Keyed by route so it remounts (and replays its entrance
|
||||
|
|
|
|||
Loading…
Reference in a new issue