feat: add token usage tracking and leaderboard
- Add token_usage table with composite unique index for claw_id + date - Add API endpoints: POST /token, GET /token/leaderboard, GET /token/stats - Add TokenLeaderboard component with daily/total period toggle - Add CLI commands: `token` and `stats` for reporting and viewing usage - Add Redis caching for leaderboard with 1-minute TTL - Add shared utilities: authenticateRequest, getTodayDateString - Use UPSERT pattern for atomic token updates - Add i18n translations (en/zh) for new UI elements
This commit is contained in:
@@ -12,6 +12,7 @@ import { StatsPanel } from "@/components/dashboard/stats-panel";
|
||||
import { ActivityTimeline } from "@/components/dashboard/activity-timeline";
|
||||
import { ClawFeed } from "@/components/dashboard/claw-feed";
|
||||
import { RegionRanking } from "@/components/dashboard/region-ranking";
|
||||
import { TokenLeaderboard } from "@/components/dashboard/token-leaderboard";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
const WorldMap = dynamic(
|
||||
@@ -55,6 +56,7 @@ export default function HomePage() {
|
||||
<div className="flex flex-col gap-4">
|
||||
<StatsPanel />
|
||||
<RegionRanking />
|
||||
<TokenLeaderboard />
|
||||
</div>
|
||||
|
||||
{/* Center - Map/Globe + Timeline */}
|
||||
|
||||
Reference in New Issue
Block a user