Files
OCR/openspec/changes/simplify-frontend-add-billing/specs/frontend-ui/spec.md
egg 65abd51d60 feat: add translation billing stats and remove Export/Settings pages
- Add TranslationLog model to track translation API usage per task
- Integrate Dify API actual price (total_price) into translation stats
- Display translation statistics in admin dashboard with per-task costs
- Remove unused Export and Settings pages to simplify frontend
- Add GET /api/v2/admin/translation-stats endpoint

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-12 17:38:12 +08:00

32 lines
1.1 KiB
Markdown

# Spec Delta: frontend-ui
## REMOVED Requirements
- REQ-FE-EXPORT: Export Page - The export page for batch exporting task results is removed.
- REQ-FE-SETTINGS: Settings Page - The settings page for managing export rules is removed.
## ADDED Requirements
### Requirement: Translation Statistics in Admin Dashboard
The admin dashboard SHALL display translation usage statistics and estimated costs.
#### Scenario: Admin views translation statistics
- GIVEN the user is logged in as admin
- WHEN the user views the admin dashboard
- THEN the page displays a translation statistics card showing:
- Total translation count
- Total token usage (input + output tokens)
- Estimated cost based on token pricing
- Breakdown by target language
## MODIFIED Requirements
### Requirement: Navigation Menu Updated
The navigation menu SHALL be updated to remove Export and Settings links.
#### Scenario: User views navigation menu
- GIVEN the user is logged in
- WHEN the user views the sidebar navigation
- THEN the menu shows: Upload, Processing, Results, Task History, Admin (if admin)
- AND the menu does NOT show: Export, Settings