fix: correct response field mappings and add logout button
All checks were successful
CI / build (push) Successful in 1m28s
CI / cleanup-branch (push) Has been skipped
CI / docker (push) Successful in 50s
CI / deploy (push) Successful in 38s
CI / deploy-feature (push) Has been skipped

- SearchResult uses 'data' not 'items', 'total' not 'totalCount'
- ExecutionStats uses 'p99LatencyMs' not 'p99DurationMs'
- TimeseriesBucket uses 'time' not 'timestamp'
- Add user Dropdown with logout action to LayoutShell

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
hsiegeln
2026-03-19 18:06:49 +01:00
parent ea5b5a685d
commit f2744e3094
4 changed files with 28 additions and 14 deletions

View File

@@ -1,5 +1,5 @@
import { Outlet, useNavigate, useLocation } from 'react-router';
import { AppShell, Sidebar, TopBar, CommandPalette, CommandPaletteProvider, GlobalFilterProvider, useCommandPalette } from '@cameleer/design-system';
import { AppShell, Sidebar, TopBar, CommandPalette, CommandPaletteProvider, GlobalFilterProvider, useCommandPalette, Dropdown, Avatar } from '@cameleer/design-system';
import { useRouteCatalog } from '../api/queries/catalog';
import { useAuthStore } from '../auth/auth-store';
import { useMemo, useCallback } from 'react';
@@ -9,7 +9,7 @@ function LayoutContent() {
const navigate = useNavigate();
const location = useLocation();
const { data: catalog } = useRouteCatalog();
const { username, roles } = useAuthStore();
const { username, roles, logout } = useAuthStore();
const { open: paletteOpen, setOpen: setPaletteOpen } = useCommandPalette();
const sidebarApps: SidebarApp[] = useMemo(() => {
@@ -56,10 +56,22 @@ function LayoutContent() {
/>
}
>
<TopBar
breadcrumb={breadcrumb}
user={username ? { name: username } : undefined}
/>
<div style={{ display: 'flex', alignItems: 'center' }}>
<TopBar
breadcrumb={breadcrumb}
user={username ? { name: username } : undefined}
/>
{username && (
<Dropdown
trigger={<Avatar name={username} size="sm" />}
items={[
{ label: `Signed in as ${username}`, disabled: true },
{ divider: true, label: '' },
{ label: 'Logout', onClick: () => { logout(); navigate('/login'); } },
]}
/>
)}
</div>
<CommandPalette
open={paletteOpen}
onClose={() => setPaletteOpen(false)}