Sync upstream/main#12
Open
github-actions[bot] wants to merge 16 commits into
Open
Conversation
* fix: prevent duplicate channel action toasts * fix: localize api error fallbacks
- Restore StatusBadge sizes to h-5/text-xs (sm, md) and h-6/text-xs (lg). - Restore classic textColorMap coloring and status indicator dot. - Embed channel type icon directly inside StatusBadge as custom children. - Re-align status badge colors: danger for manual disabled, warning for auto disabled.
… Serif Adjust PRESET_DEFAULT_FONT so that the shipped 'default' preset falls back to the humanist 'sans' (Public Sans) out-of-the-box instead of forcing the editorial 'serif' (Lora). Keeps the 'anthropic' preset on 'serif' as intended.
…n spacing - Re-introduce the custom translucent background color and thin border scheme for timing and duration badges in common, drawing, and task logs. - Remove strict max-width constraints on model badges to ensure complete names (with version suffixes) are always visible and wrap gracefully. - Adjust spacing on model and token badges (h-6 height, larger gaps, and proper padding) to prevent crowded elements and restore a balanced, high-quality look in the log tables.
…inheritance - Remove explicit 'font-mono' and custom size classes from model and token badges in usage logs. - Allow model name and token badges to naturally inherit the active theme's font family (Sans or Serif) and text size from the parent container. - Restore visual consistency and proportion across all table badge components.
Ensure VChart labels and grid lines use theme-aware colors, and remove oversized rounded corners from ranking bar charts.
Set usage log tables to a balanced 13px default and keep log badges aligned with the active theme font.
…ssues System settings forms that used flat dotted API keys (e.g. `performance_setting.monitor_cpu_threshold`) with React Hook Form were broken: RHF stores dotted paths as nested objects on update, while dirty checks and submit comparisons still read flat keys from defaults. Users could edit values but always saw "No changes to save". Refactor affected sections to use nested Zod schemas and default values for RHF, with explicit helpers to convert between nested form state and flat API keys. Track a normalized baseline in refs for accurate change detection and post-save resets. Add `safeNumberFieldProps` to prevent native `<input type="number">` from writing NaN into form state when cleared. NaN caused Zod validation to fail silently and made the save button appear unresponsive. The helper ignores non-finite updates so controlled inputs snap back to the last valid value, matching legacy Semi InputNumber behavior. Sections refactored for dotted-key handling: - maintenance/performance-section - models/grok-settings-card - auth/passkey-section - auth/oauth-section - auth/section-registry (pass attachment_preference raw; normalize in section) Sections migrated to safeNumberFieldProps: - maintenance/performance-section - models/grok-settings-card - integrations/monitoring-settings-section - integrations/payment-settings-section - integrations/creem-product-dialog - general/pricing-section (USD exchange rate) - general/system-behavior-section - content/dashboard-section Optional numeric fields (e.g. custom currency exchange rate) keep their existing empty-to-undefined semantics and are intentionally unchanged.
…adge dots Implement the Simple Large-font theme preset and xl font scale options to enhance interface accessibility. Remove status indicator dots from channel badges in logs to keep the table layout visual and clean.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Codex审查:本次 upstream 主要是 web/default 的主题/日志/设置页 UI 调整,以及后端订阅余额购买、日志筛选和渠道测试修复;主要风险为前端构建与余额扣费/usage 查询行为,建议维护者跟进验证。
合并建议:谨慎合并。web/default 与后端核心均被触及,未见高危破坏性变更,但订阅余额支付和 usage/log 筛选需要手动确认。
更新文件:
controller/subscription.go、model/subscription.go、router/api-router.go新增余额购买订阅接口与扣费逻辑。model/log.go调整 model/username 日志筛选,默认精确匹配,显式%才走 LIKE。controller/channel-test.go渠道测试改用请求用户或 root 用户,不再固定 user_id=1。theme-customization.ts、theme-presets.css、status-badge.tsx增加 simple-large/xl 并改变 badge 默认视觉,可能间接影响“洛音云枢”全局观感。usage-logs-mobile-card.tsx,并调整日志表格列样式和筛选 schema。下一步:维护者最应先跑 web/default 类型检查/构建,并手动验证“洛音云枢”首页/登录页/后台在亮暗色和不同主题密度下的视觉。随后验证余额购买订阅、usage/log 精确/通配筛选、渠道测试是否符合预期。
Workflow note: 后续上游同步会更新这个 PR;详细审查和同步信息默认折叠,避免 PR 顶部过长。
这个同步流程如何工作
upstream/main拉取新提交。main的同步分支上尝试合并 upstream。Codex审查报告
风险等级
MEDIUM,原因是 web/default 改动面积大且包含全局主题/badge/usage logs 移动端新组件,同时后端新增余额购买订阅并调整日志筛选;未触及 web/classic、Docker、workflow、依赖锁,风险未升到 HIGH。
我查看了什么
git show --stat --oneline --decorate --no-renames HEADgit diff --name-status a64f26d..74985fagit diff a64f26d..74985fa -- model/log.go controller/subscription.go model/subscription.go model/topup.go router/api-router.gogit diff a64f26d..74985fa -- controller/channel-test.go controller/channel_test_internal_test.gogit diff a64f26d..74985fa -- web/default/src/lib/api.ts web/default/src/lib/theme-customization.ts web/default/src/styles/theme-presets.css web/default/src/components/status-badge.tsxgit diff a64f26d..74985fa -- web/default/src/features/usage-logs/components/usage-logs-table.tsx web/default/src/features/usage-logs/components/usage-logs-mobile-card.tsxgit diff a64f26d..74985fa -- web/default/src/features/subscriptions/api.ts web/default/src/features/subscriptions/components/dialogs/subscription-purchase-dialog.tsx web/default/src/features/wallet/index.tsxrg -n "洛音云枢|洛音|云枢" . -g '!dist' -g '!build' -g '!vendor' -g '!node_modules'git diff --name-only a64f26d..74985fa -- 'Dockerfile*' '.github/**' 'go.mod' 'go.sum' 'web/default/package.json' 'web/default/bun.lock*' 'web/classic/**'git diff --check a64f26d..74985fa影响范围
“洛音云枢”自定义文件
web/default/src/custom/luoyin/*未改动,但全局主题 preset、density scale、StatusBadge、日志表格样式会间接影响后台视觉;web/default 被大量触及,web/classic 未触及。后端 API 影响订阅余额支付、日志筛选和渠道测试;usage 统计会受日志筛选精确/通配语义影响;流式主链路未见直接 relay 改动,仅渠道测试仍会记录 stream 测试日志;Docker/构建/依赖/workflow 未触及。重点文件
model/subscription.go/controller/subscription.go:新增余额购买订阅,事务中扣用户 quota、创建订阅和订单;需确认 SQLite/MySQL/PostgreSQL 下扣费事务、购买上限、分组升级和 quota cache 一致。model/log.go:applyExplicitLogTextFilter让无%的 model/username 查询变成精确匹配,有%才走LIKE ESCAPE '!';这是预期修复,但会改变管理员 usage 查询习惯。web/default/src/features/usage-logs/components/usage-logs-mobile-card.tsx:新增移动端日志卡片;其中通用泛型组件直接访问row.original.created_at/type,未构建验证,存在 TypeScript 类型检查风险(不确定)。web/default/src/styles/theme-presets.css/theme-customization.ts/status-badge.tsx:新增 simple-large 和 xl scale,同时 StatusBadge 默认显示 dot、移除背景面,会影响多个表格和主题视觉。web/default/src/lib/api.ts/features/channels/api.ts:扩展 Axios config 并让渠道操作跳过全局错误 toast,改由调用处显示错误,需验证不会漏报 401 以外错误。controller/channel-test.go:渠道测试用当前用户或 root 用户获取 cache/group 并记录消费日志,修复 user_id=1 假设,但自动测试依赖存在 root 用户。手动检查
usage-logs-mobile-card.tsx泛型访问。gpt%、非法/过短%模式、username 精确/通配,以及统计总量一致。验证步骤
cd web/default && bun run build,先排除前端类型/构建错误。%的模型名,确认列表与统计口径符合预期;再执行一次单渠道测试和全部渠道测试。Codex审查:gpt-5.5
同步信息
Metadata
Automatic impact analysis
Module signals
File count
Upstream commits
Changed files
M controller/channel-test.go M controller/channel_test_internal_test.go M controller/subscription.go M model/log.go M model/subscription.go M model/topup.go M router/api-router.go M web/default/src/components/config-drawer.tsx M web/default/src/components/group-badge.tsx M web/default/src/components/status-badge.tsx M web/default/src/components/ui/select.tsx M web/default/src/components/ui/sidebar.tsx M web/default/src/features/channels/api.ts M web/default/src/features/channels/components/channels-columns.tsx M web/default/src/features/channels/components/dialogs/multi-key-manage-dialog.tsx M web/default/src/features/channels/components/dialogs/ollama-models-dialog.tsx M web/default/src/features/channels/components/drawers/channel-mutate-drawer.tsx M web/default/src/features/channels/constants.ts M web/default/src/features/channels/hooks/use-channel-upstream-updates.ts M web/default/src/features/channels/lib/channel-actions.ts M web/default/src/features/dashboard/components/overview/overview-dashboard.tsx M web/default/src/features/pricing/components/model-details-charts.tsx M web/default/src/features/rankings/components/market-share-section.tsx M web/default/src/features/rankings/components/models-section.tsx M web/default/src/features/subscriptions/api.ts M web/default/src/features/subscriptions/components/dialogs/subscription-purchase-dialog.tsx M web/default/src/features/system-settings/auth/oauth-section.tsx M web/default/src/features/system-settings/auth/passkey-section.tsx M web/default/src/features/system-settings/auth/section-registry.tsx M web/default/src/features/system-settings/content/dashboard-section.tsx M web/default/src/features/system-settings/general/pricing-section.tsx M web/default/src/features/system-settings/general/system-behavior-section.tsx M web/default/src/features/system-settings/integrations/creem-product-dialog.tsx M web/default/src/features/system-settings/integrations/monitoring-settings-section.tsx M web/default/src/features/system-settings/integrations/payment-settings-section.tsx M web/default/src/features/system-settings/integrations/waffo-pancake-settings-section.tsx M web/default/src/features/system-settings/integrations/waffo-settings-section.tsx M web/default/src/features/system-settings/maintenance/performance-section.tsx M web/default/src/features/system-settings/models/grok-settings-card.tsx A web/default/src/features/system-settings/utils/numeric-field.ts M web/default/src/features/usage-logs/components/columns/column-helpers.tsx M web/default/src/features/usage-logs/components/columns/common-logs-columns.tsx M web/default/src/features/usage-logs/components/columns/drawing-logs-columns.tsx M web/default/src/features/usage-logs/components/columns/task-logs-columns.tsx M web/default/src/features/usage-logs/components/model-badge.tsx A web/default/src/features/usage-logs/components/usage-logs-mobile-card.tsx M web/default/src/features/usage-logs/components/usage-logs-table.tsx M web/default/src/features/wallet/components/subscription-plans-card.tsx M web/default/src/features/wallet/index.tsx M web/default/src/i18n/locales/en.json M web/default/src/i18n/locales/fr.json M web/default/src/i18n/locales/ja.json M web/default/src/i18n/locales/ru.json M web/default/src/i18n/locales/vi.json M web/default/src/i18n/locales/zh.json M web/default/src/i18n/static-keys.ts M web/default/src/lib/api.ts M web/default/src/lib/currency.ts M web/default/src/lib/theme-customization.ts M web/default/src/routes/_authenticated/usage-logs/$section.tsx M web/default/src/styles/theme-presets.cssDiff stat
controller/channel-test.go | 40 +- controller/channel_test_internal_test.go | 11 + controller/subscription.go | 23 + model/log.go | 51 +- model/subscription.go | 101 ++++ model/topup.go | 2 + router/api-router.go | 1 + web/default/src/components/config-drawer.tsx | 3 +- web/default/src/components/group-badge.tsx | 2 +- web/default/src/components/status-badge.tsx | 48 +- web/default/src/components/ui/select.tsx | 55 +- web/default/src/components/ui/sidebar.tsx | 23 +- web/default/src/features/channels/api.ts | 128 ++-- .../channels/components/channels-columns.tsx | 79 +-- .../components/dialogs/multi-key-manage-dialog.tsx | 2 + .../components/dialogs/ollama-models-dialog.tsx | 22 +- .../components/drawers/channel-mutate-drawer.tsx | 18 +- web/default/src/features/channels/constants.ts | 4 +- .../channels/hooks/use-channel-upstream-updates.ts | 15 +- .../src/features/channels/lib/channel-actions.ts | 36 +- .../components/overview/overview-dashboard.tsx | 85 +-- .../pricing/components/model-details-charts.tsx | 51 +- .../rankings/components/market-share-section.tsx | 29 +- .../rankings/components/models-section.tsx | 29 +- web/default/src/features/subscriptions/api.ts | 7 + .../dialogs/subscription-purchase-dialog.tsx | 71 ++- .../system-settings/auth/oauth-section.tsx | 465 +++++++++------ .../system-settings/auth/passkey-section.tsx | 215 ++++--- .../system-settings/auth/section-registry.tsx | 10 +- .../system-settings/content/dashboard-section.tsx | 4 +- .../system-settings/general/pricing-section.tsx | 7 +- .../general/system-behavior-section.tsx | 7 +- .../integrations/creem-product-dialog.tsx | 7 +- .../integrations/monitoring-settings-section.tsx | 14 +- .../integrations/payment-settings-section.tsx | 394 +++++++++++-- .../waffo-pancake-settings-section.tsx | 647 +++++++++------------ .../integrations/waffo-settings-section.tsx | 201 +++---- .../maintenance/performance-section.tsx | 222 +++++-- .../system-settings/models/grok-settings-card.tsx | 93 ++- .../system-settings/utils/numeric-field.ts | 91 +++ .../components/columns/column-helpers.tsx | 13 +- .../components/columns/common-logs-columns.tsx | 68 ++- .../components/columns/drawing-logs-columns.tsx | 4 +- .../components/columns/task-logs-columns.tsx | 5 +- .../features/usage-logs/components/model-badge.tsx | 6 +- .../components/usage-logs-mobile-card.tsx | 402 +++++++++++++ .../usage-logs/components/usage-logs-table.tsx | 14 +- .../wallet/components/subscription-plans-card.tsx | 6 + web/default/src/features/wallet/index.tsx | 2 + web/default/src/i18n/locales/en.json | 6 + web/default/src/i18n/locales/fr.json | 6 + web/default/src/i18n/locales/ja.json | 6 + web/default/src/i18n/locales/ru.json | 6 + web/default/src/i18n/locales/vi.json | 6 + web/default/src/i18n/locales/zh.json | 6 + web/default/src/i18n/static-keys.ts | 1 + web/default/src/lib/api.ts | 62 +- web/default/src/lib/currency.ts | 2 +- web/default/src/lib/theme-customization.ts | 10 +- .../routes/_authenticated/usage-logs/$section.tsx | 2 +- web/default/src/styles/theme-presets.css | 135 ++++- 61 files changed, 2850 insertions(+), 1231 deletions(-)Actions Run
https://github.com/CharyeahOwO/new-api/actions/runs/26481695722