Commit Graph

61 Commits

Author SHA1 Message Date
Apple\Apple
6282eccf16 🎨 refactor: migrate sidebar inline styles to CSS classes and improve code organization
This commit improves the codebase structure by:
- Moving all inline styles from SiderBar.js to CSS classes in index.css
- Organizing CSS with clear section comments for better maintainability
- Removing unused imports and components
- Improving sidebar design with cleaner styling and consistent color management
- Restructuring CSS to group related styles together
- Adjusting sidebar width from 200px to 180px
- Replacing Text components with semantic divs for group labels
- Creating a color management function for sidebar icons
2025-06-06 20:55:52 +08:00
Apple\Apple
5a7314eea0 🎨 refactor: standardize model tag rendering across components
Refactor model tag rendering to ensure consistency throughout the application:

- Replace direct Tag component in ModelPricing with centralized renderModelTag function
- Update renderModelTag in render.js to use stringToColor for consistent color generation
- Remove redundant stringToColor calls in LogsTable.js renderModelName function

This change improves UI consistency by ensuring all model tags have the same styling, iconography, and color generation logic. Model tags now automatically display appropriate vendor icons based on the model name pattern.
2025-06-04 20:13:02 +08:00
Apple\Apple
f2bca12d9a feat(ui): Enhance model tag rendering in logs table with icons
Improve the logs table by implementing brand-specific model icons and better
redirection visualization:

- Replace standard tags with `renderModelTag` to display appropriate brand
  icons for each model (OpenAI, Claude, Gemini, etc.)
- Fix background colors by explicitly passing color parameters
- Restore descriptive text for model redirection in popover
- Replace refresh icon with forward icon for better representation of model
  redirection
- Clean up unused imports

This change provides a more intuitive visual representation of models and
their relationships, making the logs table easier to understand at a glance.
2025-06-04 14:31:54 +08:00
Apple\Apple
4794a7cadc 🐛 fix(api): resolve missing imports in buildApiPayload function
Fix ReferenceError caused by undefined `isValidMessage` and `MESSAGE_ROLES`
in the buildApiPayload function within api.js.

Changes:
- Add missing `isValidMessage` import from utils.js
- Add missing `MESSAGE_ROLES` import from playground constants
- Consolidate duplicate `formatMessageForAPI` import
- Clean up import statements organization

Resolves: ReferenceError: isValidMessage is not defined at buildApiPayload (api.js:39:13)
2025-06-04 00:01:41 +08:00
Apple\Apple
61d1add156 ♻️ refactor(helpers): refactor the helpers folder and related imports 2025-06-03 23:56:39 +08:00
Apple\Apple
192049d932 ♻️Refactor: Token Page 2025-05-23 00:24:08 +08:00
creamlike1024
58cd3d22aa fix: tool quota calculate 2025-05-08 23:19:37 +08:00
creamlike1024
6eda56bd45 feat: 添加 built in tools 计费前端显示 2025-05-07 01:08:20 +08:00
CaIon
9246dd2070 fix: handle optional user_group_ratio in LogsTable and render helper 2025-04-26 15:59:49 +08:00
CaIon
0647872c15 feat: support image edit model mapping
(cherry picked from commit 1a869d8ad77f262ee27675ec2deaf451b1743eb7)
2025-04-26 15:48:59 +08:00
QuentinHsu
775b1c458b style(web): format code 2025-04-04 17:37:27 +08:00
1808837298@qq.com
78fc3a191c feat: claude relay 2025-03-12 21:31:46 +08:00
1808837298@qq.com
98e2443563 refactor: Improve price rendering with clearer token and price calculations 2025-03-08 23:47:02 +08:00
1808837298@qq.com
ec818773f5 chore: Update terminology from "cache ratio" to "cache multiplier" in UI and add placeholder for default create cache ratio 2025-03-08 02:44:09 +08:00
1808837298@qq.com
b640118d74 feat: Implement cache token ratio for more precise token pricing 2025-03-08 01:30:50 +08:00
CalciumIon
1f6cb4bd5d feat: Improve mobile text truncation and sidebar visibility 2025-02-19 23:25:42 +08:00
1808837298@qq.com
0fcd243f56 feat: Add user notification settings with quota warning and multiple notification methods
- Implement user notification settings with email and webhook options
- Add new user settings for quota warning threshold and notification preferences
- Create backend API and database support for user notification configuration
- Enhance frontend personal settings with notification configuration UI
- Support custom notification email and webhook URL
- Add service layer for sending user notifications
2025-02-18 14:54:21 +08:00
1808837298@qq.com
e954913f19 refactor: realtime log render 2025-01-04 17:54:02 +08:00
1808837298@qq.com
44a097243e refactor: realtime i18n 2025-01-04 17:46:06 +08:00
CalciumIon
2de4de0006 fix redis 2024-12-30 22:05:41 +08:00
CalciumIon
72d7e3eb81 refactor: update group handling and rendering logic
- Changed the structure of usableGroups in GetUserGroups to store additional information (ratio and description) for each group.
- Introduced a new renderRatio function to visually represent group ratios with color coding.
- Updated the Playground and EditToken components to utilize the new group structure and rendering options.
- Enhanced the renderGroupOption function for better UI representation of group options.
- Fixed minor comments and improved code readability.
2024-12-30 19:51:00 +08:00
CalciumIon
9e25f05930 refactor: enhance log retrieval and user interaction in LogsTable component 2024-12-28 15:34:28 +08:00
CalciumIon
620f9f19b1 fix: validate number input in renderQuotaNumberWithDigit and improve data handling in Detail page
- Added input validation to ensure that the `num` parameter in `renderQuotaNumberWithDigit` is a valid number, returning 0 for invalid inputs.
- Updated the `Detail` component to use `datum['rawQuota']` instead of `datum['Usage']` for rendering quota values, ensuring more accurate data representation.
- Enhanced data aggregation logic to handle cases where quota values may be missing or invalid, improving overall data integrity in charts and tables.
- Removed unnecessary time granularity calculations and streamlined the data processing for better performance.
2024-12-25 23:16:35 +08:00
CalciumIon
a771ecbe0b feat: Integrate i18n support and enhance UI text localization
- Added internationalization (i18n) support across various components, enabling dynamic language switching and improved user experience.
- Updated multiple components to utilize translation functions for labels, buttons, and messages, ensuring consistent language display.
- Enhanced the user interface by refining text elements in the ChannelsTable, LogsTable, and various settings pages, improving clarity and accessibility.
- Adjusted CSS styles for better responsiveness and layout consistency across different screen sizes.
2024-12-13 19:03:14 +08:00
CalciumIon
74a307f10c feat: Enhance color mapping and chart rendering in Detail component
- Added base and extended color palettes for improved model color mapping.
- Introduced a new `modelToColor` function to dynamically assign colors based on model names.
- Updated the Detail component to utilize the new color mapping for pie and line charts.
- Refactored chart data handling to support dynamic color assignment and improved data visualization.
- Cleaned up unused state variables and optimized data loading logic for better performance.
2024-12-12 14:56:16 +08:00
CalciumIon
c76a0fedc3 feat: Add renderModelPriceSimple function and update LogsTable component
- Introduced a new helper function `renderModelPriceSimple` to simplify the rendering of model price information.
- Updated the `LogsTable` component to utilize `renderModelPriceSimple`, enhancing the display of model pricing and grouping information.
- Removed the previous implementation of `renderModelPrice` from the `LogsTable` for cleaner code.
2024-12-11 21:06:26 +08:00
CalciumIon
325de98738 feat: 渠道标签分组 2024-11-19 01:13:18 +08:00
CalciumIon
37d6925ef6 feat: 完善audio计费 2024-11-07 16:12:09 +08:00
1808837298@qq.com
e3620c1c0e chore: 更新令牌分组描述 2024-09-22 19:43:06 +08:00
CalciumIon
4a02eb1b7f feat: 令牌分组 2024-09-18 05:19:49 +08:00
CalciumIon
ccd0ac8dea fix: 日志详情 2024-07-08 15:48:28 +08:00
CalciumIon
dcbfba1c1e feat: 完善日志扣费计算过程 2024-07-01 00:56:37 +08:00
1808837298@qq.com
5bf8cb74c8 chore: 添加注释 2024-05-21 21:16:17 +08:00
1808837298@qq.com
f84c9d3434 fix: 模型价格 2024-05-21 21:07:32 +08:00
1808837298@qq.com
99f00404d8 chore: 删除无用代码 2024-05-21 20:50:48 +08:00
CaIon
97acc9e5c4 feat: add pricing page 2024-05-13 23:02:35 +08:00
CaIon
0fe4c98b3f feat: dalle系列改为使用模型固定价格计费 2024-05-13 16:04:02 +08:00
CaIon
7ef1636321 feat: 完善日志详情 2024-05-13 15:08:01 +08:00
CaIon
5cf33f35ae fix: 修复自定义渠道出错 #243 2024-05-13 14:32:32 +08:00
CaIon
391f0404a5 feat: 日志详情展示模型价格 2024-05-12 15:35:57 +08:00
CaIon
3721ed796c feat: support aws claude 2024-04-23 11:44:40 +08:00
CaIon
08a7738bd4 fix: add group tag 'unknown' 2024-04-04 21:20:54 +08:00
CaIon
f5dd4ea293 feat: 钱包兼容非货币形式显示额度 2024-04-04 18:18:18 +08:00
QuentinHsu
f2f5b73c79 refactor(helpers): renderGroup function 2024-04-02 13:16:02 +08:00
QuentinHsu
f16eac3140 fix(helpers): add key prop to Tag components 2024-04-02 10:58:44 +08:00
CaIon
eb955ae4b1 chore: lint fix 2024-03-23 21:24:39 +08:00
1808837298@qq.com
7739dbb355 feat: 数据看板颜色统一 2024-03-02 20:56:29 +08:00
CaIon
dec5aeaff2 perf: 美化数据看板 2024-01-10 17:49:55 +08:00
CaIon
6e906442f6 perf: 美化数据看板 2024-01-08 11:32:27 +08:00
CaIon
dd0abc9447 feat: 新增数据看板 2024-01-07 18:31:14 +08:00