mirror of
https://github.com/lukaszraczylo/traefik-llmgateway.git
synced 2026-11-26 10:06:31 +00:00
feat(webui): make the dashboard responsive and add loading and empty states
Every tab row scrolls sideways instead of being clipped by its card. On phones this hid tabs, such as the Config change helper's last forms at 360-390px. The login button has a larger touch target, and long names are truncated with a tooltip. Loading and empty states: - Skeletons show only while a selection has no data yet, never over data already on screen during a refresh. - Empty states name the next step to take. - Error states offer a Retry button that shows progress, and each card keeps its own error. - Toasts confirm copies and key generation, and report background failures once per streak through polite and assertive live regions. Other changes: - The access matrix switches between Models, MCP servers and Agents, and says "none configured" only once its data has loaded. - Home ranks the top 5 users by cost, requests or tokens. It requests only the needed metrics and warns before a range exceeds the server's key cap. - MCP and agent deep links accept a bare target name. admin_assets_gen.go is regenerated. Claude-Session: https://claude.ai/code/session_01V5jYJNxpDFdJkyyExpADrv
This commit is contained in:
@@ -3,7 +3,9 @@ import { computed, onMounted } from 'vue'
|
||||
|
||||
import ChangeHelper from '@/components/ChangeHelper.vue'
|
||||
import ConfigTree from '@/components/ConfigTree.vue'
|
||||
import ErrorState from '@/components/ErrorState.vue'
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'
|
||||
import { Skeleton } from '@/components/ui/skeleton'
|
||||
import { useConfigStore } from '@/stores/config'
|
||||
import { useConsumersStore } from '@/stores/consumers'
|
||||
import { useDashboardStore } from '@/stores/dashboard'
|
||||
@@ -32,13 +34,21 @@ const userNames = computed(() => (consumers.data?.users ?? []).map((u) => u.name
|
||||
|
||||
<template>
|
||||
<div class="flex flex-col gap-6">
|
||||
<Card v-if="config.error">
|
||||
<Card v-if="config.error && !config.data">
|
||||
<CardHeader>
|
||||
<CardTitle>Config</CardTitle>
|
||||
<CardDescription class="text-destructive">{{ config.error }}</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<ErrorState :message="config.error" :on-retry="config.fetchConfig" />
|
||||
</CardContent>
|
||||
</Card>
|
||||
<!-- Mirrors ConfigTree's own final SnippetBlock shape (a label line above a bordered block) so it causes no layout shift once the real config arrives. -->
|
||||
<Card v-else-if="config.loading && !config.data">
|
||||
<CardContent class="flex flex-col gap-1.5">
|
||||
<Skeleton class="h-3 w-56" />
|
||||
<Skeleton class="h-64 w-full rounded-md" />
|
||||
</CardContent>
|
||||
</Card>
|
||||
<p v-else-if="config.loading && !config.data" class="text-sm text-muted-foreground">loading…</p>
|
||||
<ConfigTree v-else-if="config.data" :config="config.data.config" :warnings="config.data.warnings" />
|
||||
|
||||
<Card>
|
||||
|
||||
Reference in New Issue
Block a user