diff --git a/src/components/DkProgress.vue b/src/components/DkProgress.vue new file mode 100644 index 0000000..b2b340c --- /dev/null +++ b/src/components/DkProgress.vue @@ -0,0 +1,80 @@ + + + + + + {{ label }} + + + + {{ Math.round(percent) }}% + + + + + + + + + + + diff --git a/src/pages/DashboardPage.vue b/src/pages/DashboardPage.vue index 88bd8f1..29b72ac 100644 --- a/src/pages/DashboardPage.vue +++ b/src/pages/DashboardPage.vue @@ -20,6 +20,7 @@ import DkCommandPalette from '../components/DkCommandPalette.vue' import DkLogo from '../components/DkLogo.vue' import DkCreateKeyDialog from '../components/DkCreateKeyDialog.vue' + import DkProgress from '../components/DkProgress.vue' import { useKeys } from '../composables/useKeys' defineOptions({ name: 'DkDashboardPage' }) @@ -37,6 +38,39 @@ { label: 'Error Rate', value: '0.3%', icon: mdiAlertCircleOutline }, ] + // Demo analytics quotas — product-shaped Progress surfaces, not live metrics. + const analytics = [ + { + id: 'requests', + label: 'Monthly request quota', + value: 240_000, + max: 1_000_000, + format: (total: number, max: number) => + `${(total / 1000).toFixed(0)}k / ${(max / 1000).toFixed(0)}k`, + }, + { + id: 'keys', + label: 'Active keys vs plan limit', + value: 24, + max: 50, + format: (total: number, max: number) => `${total} / ${max}`, + }, + { + id: 'errors', + label: 'Error budget remaining', + value: 97, + max: 100, + format: (total: number) => `${total}% remaining`, + }, + { + id: 'rate', + label: 'Rate-limit headroom', + value: 720, + max: 1000, + format: (total: number, max: number) => `${total} / ${max} rpm`, + }, + ] + const sidebarSections = [ { label: 'Overview', icon: mdiViewDashboard, items: ['All Keys', 'Create New', 'Rotate'] }, { label: 'Management', icon: mdiCog, items: ['Overview', 'Usage', 'Errors'] }, @@ -159,10 +193,23 @@ /> - - Analytics - Usage analytics and charts coming soon. - + + + + + {{ metric.format(total, max) }} + + + + @@ -315,4 +362,22 @@ .dk-dashboard__tab-desc { color: var(--v0-theme-muted); } + + .dk-dashboard__analytics { + display: grid; + grid-template-columns: repeat(2, 1fr); + gap: 1rem; + } + + .dk-dashboard__metric { + display: flex; + flex-direction: column; + gap: 0.25rem; + } + + @media (max-width: 720px) { + .dk-dashboard__analytics { + grid-template-columns: 1fr; + } + }
Usage analytics and charts coming soon.