- New /models page: LLM cards (type tag, agent-default badge, test state with latency/consecutive failures), add/edit form (OpenAI-compatible segment, mono base URL/model, masked key with sk-****tail, timeout dropdown, save gated on a passing test), agent default-model panel for the five AIGC agents, dashed server-connectivity notice, disabled image/video tabs as future placeholders; responsive 1440/1024/768 breakpoints per spec-v2 §9. - Scoped A darkroom design tokens in app.css (.a-darkroom) + Noto Sans SC. - Top nav: add Agents and Models entries before Settings. - Backend: add 'style' agent role, llm-test timeout_sec (5-60, default 10), api_key_tail (last 4 chars) in public profiles; 4 new tests. - i18n: 84 models.* keys + nav.agents/nav.models in all 7 dictionaries. Co-authored-by: multica-agent <github@multica.ai>
141 lines
3.3 KiB
Svelte
141 lines
3.3 KiB
Svelte
<script lang="ts">
|
|
import LanguageSwitcher from '$lib/components/LanguageSwitcher.svelte';
|
|
import { t } from '$lib/i18n.svelte';
|
|
|
|
interface Props {
|
|
active?: 'projects' | 'canvas' | 'build-scene' | 'library' | 'agents' | 'models' | 'settings';
|
|
crumb?: string;
|
|
/** Optional status content rendered between the crumb and the nav. */
|
|
status?: import('svelte').Snippet;
|
|
children?: import('svelte').Snippet;
|
|
}
|
|
|
|
let { active, crumb, status, children }: Props = $props();
|
|
</script>
|
|
|
|
<header class="header">
|
|
<div class="header-left">
|
|
<a class="logo" href="/canvas" title="Calliope Lab">
|
|
Calliope <span>Lab</span>
|
|
</a>
|
|
{#if crumb}
|
|
<span class="crumb">{crumb}</span>
|
|
{/if}
|
|
{#if status}
|
|
<div class="header-status">
|
|
{@render status()}
|
|
</div>
|
|
{/if}
|
|
<nav class="top-nav" aria-label={t('nav.primary')}>
|
|
<a class="nav-link" class:active={active === 'canvas'} href="/canvas">{t('nav.canvas')}</a>
|
|
<a class="nav-link" class:active={active === 'projects'} href="/projects">{t('nav.projects')}</a>
|
|
<a class="nav-link" class:active={active === 'build-scene'} href="/build-scene">{t('nav.buildScene')}</a>
|
|
<a class="nav-link" class:active={active === 'library'} href="/library">{t('nav.library')}</a>
|
|
<a class="nav-link" class:active={active === 'agents'} href="/agents">{t('nav.agents')}</a>
|
|
<a class="nav-link" class:active={active === 'models'} href="/models">{t('nav.models')}</a>
|
|
<a class="nav-link" class:active={active === 'settings'} href="/settings">{t('nav.settings')}</a>
|
|
</nav>
|
|
</div>
|
|
<div class="header-right">
|
|
<LanguageSwitcher />
|
|
{#if children}
|
|
{@render children()}
|
|
{/if}
|
|
</div>
|
|
</header>
|
|
|
|
<style>
|
|
.header {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
gap: var(--space-md);
|
|
padding: 14px 24px;
|
|
border-bottom: 1px solid var(--border);
|
|
background: var(--bg-surface);
|
|
flex-shrink: 0;
|
|
}
|
|
.header-left {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: var(--space-md);
|
|
min-width: 0;
|
|
flex-wrap: wrap;
|
|
}
|
|
.header-right {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
flex-shrink: 0;
|
|
}
|
|
.logo {
|
|
font-family: var(--font-display);
|
|
font-size: 18px;
|
|
font-weight: 700;
|
|
color: var(--text-primary);
|
|
text-decoration: none;
|
|
letter-spacing: -0.02em;
|
|
white-space: nowrap;
|
|
}
|
|
.logo span {
|
|
color: var(--accent);
|
|
font-weight: 500;
|
|
}
|
|
.crumb {
|
|
color: var(--text-muted);
|
|
font-size: 13px;
|
|
}
|
|
.header-status {
|
|
display: flex;
|
|
align-items: center;
|
|
flex-shrink: 0;
|
|
}
|
|
.top-nav {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 4px;
|
|
margin-left: 8px;
|
|
}
|
|
.nav-link {
|
|
padding: 8px 12px;
|
|
border-radius: var(--radius-sm);
|
|
color: var(--text-secondary);
|
|
text-decoration: none;
|
|
font-size: 13px;
|
|
font-weight: 500;
|
|
transition: color 0.15s, background 0.15s;
|
|
min-height: 36px;
|
|
display: inline-flex;
|
|
align-items: center;
|
|
cursor: pointer;
|
|
}
|
|
.nav-link:hover {
|
|
color: var(--text-primary);
|
|
background: var(--bg-elevated);
|
|
}
|
|
.nav-link.active {
|
|
color: var(--text-primary);
|
|
background: var(--bg-elevated);
|
|
box-shadow: inset 0 -2px 0 var(--accent);
|
|
}
|
|
.nav-link:focus-visible {
|
|
outline: 2px solid var(--accent);
|
|
outline-offset: 2px;
|
|
}
|
|
@media (max-width: 640px) {
|
|
.header {
|
|
padding: 12px 16px;
|
|
flex-direction: column;
|
|
align-items: stretch;
|
|
}
|
|
.top-nav {
|
|
margin-left: 0;
|
|
width: 100%;
|
|
}
|
|
.nav-link {
|
|
flex: 1;
|
|
justify-content: center;
|
|
}
|
|
}
|
|
</style>
|