Add a full-featured gateway dashboard UI built on Lit web components. Shell & plumbing: - App shell with router, controllers, and dependency wiring - Login gate, i18n keys, and base layout scaffolding Styles & theming: - Base styles, chat styles, and responsive layout CSS - 6-theme glassmorphism system (Obsidian, Aurora, Solar, etc.) - Glass card, glass panel, and glass input components - Favicon logo in expanded sidebar header Views & features: - Overview with attention cards, event log, quick actions, and log tail - Chat view with markdown rendering, tool-call collapse, and delete support - Command palette with fuzzy search - Agent overview with config display, slash commands, and sidebar filtering - Session list navigation and agent selector Privacy & polish: - Redact toggle with stream-mode default - Blur host/IP in Connected Instances with reveal toggle - Sensitive config value masking with count badge - Card accent borders, hover lift effects, and responsive grid
19 lines
647 B
TypeScript
19 lines
647 B
TypeScript
import type { GatewayBrowserClient } from "../gateway.ts";
|
|
import type { ModelCatalogEntry } from "../types.ts";
|
|
|
|
/**
|
|
* Fetch the model catalog from the gateway.
|
|
*
|
|
* Accepts a {@link GatewayBrowserClient} (matching the existing ui/ controller
|
|
* convention). Returns an array of {@link ModelCatalogEntry}; on failure the
|
|
* caller receives an empty array rather than throwing.
|
|
*/
|
|
export async function loadModels(client: GatewayBrowserClient): Promise<ModelCatalogEntry[]> {
|
|
try {
|
|
const result = await client.request<{ models: ModelCatalogEntry[] }>("models.list", {});
|
|
return result?.models ?? [];
|
|
} catch {
|
|
return [];
|
|
}
|
|
}
|