Dashboard
An overview's totals, charts and top lists on one surface split by hairlines; the totals are tabs that pick what the chart shows.
Requests per day, UTC
- This period
- Prior 30 days
| Time | This period | Prior 30 days |
|---|---|---|
| Fri 9 Oct | 1,840 | 1,522 |
| Sat 10 Oct | 1,910 | 1,620 |
| Sun 11 Oct | 2,120 | 1,837 |
| Mon 12 Oct | 1,610 | 1,436 |
| Tue 13 Oct | 1,730 | 1,456 |
| Wed 14 Oct | 1,980 | 1,708 |
| Thu 15 Oct | 1,820 | 1,607 |
| Fri 16 Oct | 1,860 | 1,559 |
| Sat 17 Oct | 1,880 | 1,613 |
| Sun 18 Oct | 1,930 | 1,693 |
| Mon 19 Oct | 1,870 | 1,558 |
| Tue 20 Oct | 1,850 | 1,578 |
| Wed 21 Oct | 1,900 | 1,658 |
| Thu 22 Oct | 4,170 | 3,527 |
| Fri 23 Oct | 1,950 | 1,655 |
| Sat 24 Oct | 2,090 | 1,812 |
| Sun 25 Oct | 2,080 | 1,841 |
| Mon 26 Oct | 2,060 | 1,741 |
| Tue 27 Oct | 2,010 | 1,735 |
| Wed 28 Oct | 1,990 | 1,754 |
| Thu 29 Oct | 1,970 | 1,654 |
| Fri 30 Oct | 1,960 | 1,683 |
| Sat 31 Oct | 2,200 | 1,926 |
| Sun 1 Nov | 2,050 | 1,714 |
| Mon 2 Nov | 1,880 | 1,605 |
| Tue 3 Nov | 1,990 | 1,736 |
| Wed 4 Nov | 2,010 | 1,671 |
| Thu 5 Nov | 2,060 | 1,751 |
| Fri 6 Nov | 2,030 | 1,762 |
| Sat 7 Nov | 1,460 | 1,309 |
Cache hit
48%↑0.5% better62.6M input tokens from cache
November so far$13.39
Forecast$60.45
Models by requests
function Overview() {
const [metric, setMetric] = useState("requests");
return (
<div className="w-full">
<Dashboard aria-label="Usage in the period" headingLevel={2}>
<MetricTabs aria-label="Metric to chart" items={TABS} value={metric} onValueChange={setMetric} controls="dashboard-chart" />
<DashboardCell className="lg:col-span-8" title="Requests per day, UTC">
<CellInset grow>
<Legend
items={[
{ id: "now", label: "This period", color: "var(--k-viz-1)" },
{ id: "before", label: "Prior 30 days", color: "var(--k-text-tertiary)", dashed: true },
]}
/>
<div id="dashboard-chart" className="mt-16">
<TimeseriesChart
aria-label="Requests per day"
kind="area"
hideLegend
height={220}
timeZone="UTC"
series={[
{ id: "now", label: "This period", color: "var(--k-viz-1)", points: points(NOW) },
{ id: "before", label: "Prior 30 days", color: "var(--k-text-tertiary)", dashed: true, points: points(BEFORE) },
]}
/>
</div>
</CellInset>
</DashboardCell>
<DashboardCell className="lg:col-span-4" title="Cache hit">
<Readout value="48%" change={{ value: 0.005 }} detail="62.6M input tokens from cache" />
<div className="mt-20 grid grid-cols-2">
<Readout size="sm" label="November so far" value="$13.39" />
<Readout size="sm" label="Forecast" value="$60.45" />
</div>
</DashboardCell>
<DashboardCell className="lg:col-span-12" title="Models by requests">
<RankList aria-label="Models by requests" items={MODELS} onOpen={() => {}} />
</DashboardCell>
</Dashboard>
</div>
);
}import { Dashboard, DashboardCell, CellInset, MetricTabs, Readout, RankList, Legend } from "@logicplanes/kaeso-ui";Props
aria-labelstringThe surface's accessible name, such as "Usage in the period".
busybooleanKeeps the numbers on screen, a step back, while the next ones load.
childrenReactNodeMetricTabsandDashboardCells.columns4 | 2 | 3 | 5 | 6 | 12 = 12Columns from 1024px. Give it as many as
MetricTabshas tabs, and let every cell span whole tabs, so each hairline below continues a tab's edge; 12 for free layouts.headingLevel2 | 3 = 3The level of the cells' titles: 3 below a section's heading (the default), 2 when the page's title is the only heading above.
wideColumns4 | 2 | 3 | 6 | 12Columns from 1280px, when the surface needs more room per cell than
columnsgives at 1024px: two at 1024px and four at 1280px keeps every cell wide enough to read.