- TenantConfig gains themes: { dark, bright } — CSS data-theme names per mode
- tenants/loop42/theme.css: dark + bright CSS blocks (moved out of base.css)
- tenants/dev/theme.css: titan-bright CSS block (titan dark stays as :root)
- useTheme: stores 'dark'|'bright' in nyx_mode, toggles via tenant themes config
- AppToolbar: single sun/moon toggle replaces multi-button brand switcher
- AppSidebar, HomeView, router: brand name/icon from tenant.name directly, not theme
- themeSwitcher feature flag removed (replaced by universal toggle)
- Fix: local K3s auth mismatch — VITE_AUTH_DISABLED removed from .env.local;
infra/k8s/local/runtime.yaml sets AUTH_ENABLED=false to match test namespace
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
44 lines
1.1 KiB
TypeScript
44 lines
1.1 KiB
TypeScript
/**
|
|
* tenant.ts — Build-time tenant configuration
|
|
*
|
|
* VITE_TENANT selects which tenant config to load.
|
|
* Direct dynamic import ensures only the active tenant is bundled.
|
|
*/
|
|
|
|
export interface TenantFeatures {
|
|
graph: boolean;
|
|
trace: boolean;
|
|
viewer: boolean;
|
|
devTools: boolean;
|
|
}
|
|
|
|
export interface TenantThemes {
|
|
dark: string;
|
|
bright: string;
|
|
}
|
|
|
|
export interface TenantConfig {
|
|
id: string;
|
|
name: string;
|
|
domain: string;
|
|
defaultTheme: string;
|
|
oidcClientId: string;
|
|
features: TenantFeatures;
|
|
themes: TenantThemes;
|
|
}
|
|
|
|
// Vite replaces import.meta.env.VITE_TENANT at build time,
|
|
// making the import path a string literal → only one tenant bundled.
|
|
const modules: Record<string, { default: TenantConfig }> = import.meta.glob('../tenants/*/config.ts', { eager: true });
|
|
|
|
const tenantId = import.meta.env.VITE_TENANT || 'loop42';
|
|
const key = `../tenants/${tenantId}/config.ts`;
|
|
const mod = modules[key];
|
|
|
|
if (!mod) {
|
|
throw new Error(`Unknown tenant: ${tenantId}. Available: ${Object.keys(modules).join(', ')}`);
|
|
}
|
|
|
|
const config: TenantConfig = mod.default;
|
|
export default config;
|