Commit Graph

5840 Commits

Author SHA1 Message Date
Seefs 933ea0cddc fix: add relay idle connection timeout config (#5309) 2026-06-05 11:30:08 +08:00
Rain 87cc22d7ec fix(distributor): resolve model for GET /v1/video/generations/:task_id (#5133) 2026-06-04 18:48:30 +08:00
Rain 3aa113b5a3 fix(dify): initialize file pointer before remote-image field assignment (#5134) 2026-06-04 18:21:35 +08:00
同語 00d23abf64 fix: 修复余额显示时只切换了单位未切换数值 #5296
Merge pull request #5296 from feitianbubu/pr/27fe9a3a82f51bac2b7645213e3b1480cb7f14f2
2026-06-04 02:55:23 +08:00
feitianbubu 580ad97c02 fix: convert usd amount by exchange rate in classic quota display 2026-06-03 22:23:12 +08:00
t0ng7u b0ac0429cf fix(web): resolve TypeScript errors in usage logs mobile card
Cast row.original to Record<string, unknown> before accessing created_at and type in CommonLogsCard, matching the pattern used elsewhere in the same component.

Close: #5243
2026-06-03 12:37:36 +08:00
Seefs d17b566bcc docs: refine issue templates (#5271) 2026-06-03 12:04:40 +08:00
同語 7aaa533265 fix(channels): reveal advanced validation errors #5239
Merge pull request #5239 from QuantumNous/fix/channel-advanced-errors
2026-06-02 14:30:20 +08:00
t0ng7u 7791b78429 chore(fd): delete the test file 2026-06-02 14:28:35 +08:00
QuentinHsu cb5c0453f5 fix(channels): avoid expanding advanced settings for model mapping
- remove model mapping from advanced settings error detection so visible model configuration errors do not expand the advanced panel.
- update the edit-time advanced settings auto-expand check to only depend on fields actually rendered in the advanced section.
- add regression coverage to verify model_mapping errors are not classified as advanced settings errors.
2026-06-02 12:31:32 +08:00
QuentinHsu 4d20e053cb fix(channels): reveal advanced validation errors
- add channel form error detection for JSON validation errors inside advanced settings.
- expand advanced settings on invalid channel drawer submit and prompt users to fix highlighted fields.
- add regression tests for advanced error detection, non-advanced exclusions, and schema error classification.
2026-06-02 12:09:47 +08:00
同語 0ff9c35e62 feat(web): support classic Rsbuild dev and build
Merge pull request #5232 from QuantumNous/feat/classic-rsbuild-dev-workflow
2026-06-02 11:33:33 +08:00
QuentinHsu 0bbcaa8999 fix(classic): inject Semi React 19 adapter 2026-06-02 00:50:29 +08:00
QuentinHsu 1e9ff8a0de feat(web): support classic Rsbuild dev and build
- migrate the classic frontend from Vite to Rsbuild with JSX, Semi UI, proxy, and production build config.
- update make dev-web to run both default and classic frontends for local theme switching.
- fix classic public page height, footer, CORS proxy, error handling, and constant export warnings.
- update Dockerfile and release workflow to install from the web workspace root with the shared lockfile.
2026-06-02 00:32:16 +08:00
同語 9a2e60dff2 chore(web): centralize shared frontend dependency versions #5227
Merge pull request #5227 from QuantumNous/chore/web-shared-dependency-catalog
2026-06-01 19:19:13 +08:00
QuentinHsu b596de739d chore(web): centralize shared frontend dependency versions
- add a web workspace catalog to manage dependency versions shared by default and classic frontends.
- switch shared dependencies including @lobehub/icons to catalog references and align @lobehub/icons on 5.10.0.
- replace separate frontend Bun lockfiles with a unified web/bun.lock to reduce duplicate maintenance.
2026-06-01 19:12:39 +08:00
同語 45d54c1613 fix(pricing): sync custom model icons #5224
Merge pull request #5224 from QuantumNous/fix/pricing-model-icons
2026-06-01 18:17:58 +08:00
QuentinHsu 086044650d fix(pricing): sync custom model icons
- add the icon field to the pricing model type to consume model-level icons returned by the backend.
- prefer model icons in cards, table model cells, and detail headers while falling back to vendor icons.
2026-06-01 17:58:02 +08:00
GGXH 0c7aceb831 feat: add claude opus 4.8 support (#5177) 2026-05-31 13:50:52 +08:00
dependabot[bot] b2e25b7df2 chore(deps): bump axios from 1.15.2 to 1.16.0 in /web/classic (#5185)
Bumps [axios](https://github.com/axios/axios) from 1.15.2 to 1.16.0.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v1.15.2...v1.16.0)

---
updated-dependencies:
- dependency-name: axios
  dependency-version: 1.16.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-31 13:49:50 +08:00
skynono 230a3592f8 perf: order admin logs by created_at to use composite index (#5116) 2026-05-30 20:00:02 +08:00
YuPeng Wu afb470e405 fix(model): correct idx_created_at_id index column order to (created_at, id) (#5191)
The idx_created_at_id composite index on the logs table was defined as
(id, created_at) because the GORM `priority` values on Id and CreatedAt were
swapped. Since `id` is the auto-increment primary key, a secondary composite
index leading with `id` is redundant with the PK and cannot accelerate
`created_at` range scans (a range column must sit at the index prefix).

This defeats the common log-listing queries
(`WHERE created_at BETWEEN ? AND ? ORDER BY id DESC LIMIT n` in
GetAllLogs/GetUserLogs) that the index name implies it should serve — the
optimizer falls back to scanning the primary key, degrading to near full-table
scans on large logs tables.

Swap the priorities so the column order becomes (created_at, id), matching the
index name and its intended purpose. idx_user_id_id and idx_created_at_type are
unaffected.

Note: GORM AutoMigrate does not change the column order of an already-existing
index with the same name, so existing deployments must rebuild the index
manually (see PR description for per-database DDL).

Co-authored-by: wuyupeng <wuyupeng@floatmiracle.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-30 19:54:02 +08:00
CaIon 1588027084 feat: add subscription balance redemption toggle (#3071) 2026-05-29 12:54:00 +08:00
zengwei 38bf2d8daa feat(keys/cc-switch-dialog): 修复自定义cc-switch名称失焦后重置问题 (#5170) 2026-05-29 12:18:52 +08:00
同語 e8c836d705 fix(web): improve form validation error focus #5163
Merge pull request #5163 from QuantumNous/fix/form-validation-focus
2026-05-28 23:34:02 +08:00
QuentinHsu e79cee1e9e perf(form): focus first validation error on submit
- scope validation queries with a form root id so feedback stays inside the submitted form.
- scroll to the earliest invalid control or message and move focus without fighting scroll position.
- avoid handling the same failed submit twice to keep retries from jumping unexpectedly.
2026-05-28 15:10:17 +08:00
QuentinHsu 63ead2bf7f chore(repo): ignore playwright mcp artifacts 2026-05-28 15:02:00 +08:00
CaIon 5b86ce0d70 fix: optimize batch update process 2026-05-27 13:23:05 +08:00
CaIon 74985fa877 fix: keep token log filters exact v1.0.0-rc.10 2026-05-26 21:17:25 +08:00
yyhhyyyyyy 1d32037364 fix: keep usage log filters exact unless wildcard is explicit (#5097) 2026-05-26 21:00:32 +08:00
CaIon dc245ae764 fix(web): improve channel and usage log UI
Fixes #5121
2026-05-26 20:28:28 +08:00
CaIon f8add4ca49 feat(theme): add simple-large preset, xl scale and clean up channel badge 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.
2026-05-26 18:35:51 +08:00
t0ng7u 65f8afe922 🐛 fix(system-settings): resolve save detection and number input NaN issues
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.
2026-05-26 15:43:56 +08:00
CaIon 5bc4c74813 🎨 fix(logs): tune usage table typography
Set usage log tables to a balanced 13px default and keep log badges aligned with the active theme font.
v1.0.0-rc.9
2026-05-26 12:41:00 +08:00
Seefs 30025aeba3 fix: use actual user id for channel tests (#5109) 2026-05-26 12:32:20 +08:00
Seefs c91ba0c4eb fix: consolidate Waffo payment settings save flow (#5110) 2026-05-26 12:32:05 +08:00
CaIon f223db9330 🎨 fix(charts): improve dark mode chart readability
Ensure VChart labels and grid lines use theme-aware colors, and remove oversized rounded corners from ranking bar charts.
2026-05-26 12:30:13 +08:00
CaIon 9e283ab10b 🎨 fix(logs): remove hardcoded font-mono to support global theme font 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.
2026-05-26 12:23:52 +08:00
CaIon a8b7c92e5f 🎨 fix(logs): restore timing background badges and optimize model/token 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.
2026-05-26 12:03:43 +08:00
CaIon 6b6c9904ac feat(subscription): support balance purchases
Refs #3071.
2026-05-26 12:03:02 +08:00
CaIon 1011934987 🎨 fix(theme): default theme font preset falls back to Sans instead of 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.
2026-05-26 11:29:38 +08:00
CaIon bc8110ce36 🎨 refactor(badge): restore status-badge sizes and classic color scheme
- 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.
2026-05-26 11:23:18 +08:00
yyhhyyyyyy ad224ecf5b fix: prevent duplicate channel action toasts (#5015)
* fix: prevent duplicate channel action toasts

* fix: localize api error fallbacks
2026-05-26 10:20:54 +08:00
t0ng7u a64f26d1d2 🎨 feat(web/default): add Anthropic theme preset and configurable serif typography
Introduce a switchable Anthropic-inspired color preset and a new Font customization axis so users can adopt the editorial serif look across the entire UI, including sidebar navigation, tabs, form controls, buttons, and table headers.

Theme preset

Add anthropic to the theme preset registry with warm cream canvas, slate foreground, and clay/coral accent tokens for light and dark modes
Define explicit surface colors for the Anthropic preset instead of relying on the semantic surface bridge
Exclude anthropic from the primary-color surface bridge so bespoke warm neutrals are not overridden by accent-tinted mixes
Typography system

Add @fontsource-variable/lora and a global --font-serif token with CJK serif fallbacks (Noto Serif SC, Source Han Serif, Songti SC, etc.)
Introduce a --font-body token and drive <body> font-family from it
Add a Font axis (default | sans | serif) parallel to radius/scale
Resolve font: 'default' against preset defaults (anthropic → serif)
Persist font preference via cookie and apply data-theme-font on <body>
Apply serif OpenType features (kern, liga, calt, tnum) and heading display tuning when serif is active
Remove per-component sans opt-outs so serif inherits through sidebar, tabs, inputs, buttons, badges, and table headers via natural CSS cascade
Keep monospace contexts unchanged via Tailwind preflight and .font-mono
UI and i18n

Add Font selector to the theme config drawer (Auto / Sans / Serif)
Add "Font" and "Select body font" translations for en, zh, fr, ja, ru, vi
Misc

Tighten group and status badge sizing for better balance with serif text
2026-05-26 04:31:13 +08:00
t0ng7u 3360882642 ♻️ refactor(channels): rebuild channel editor UX with modular sections and Base UI multi-select
Restructure the default-theme channel create/edit experience to match classic
frontend behavior, improve form UX, and align with the project's Base UI design
system.

Channel editor architecture:
- Split the monolithic channel mutate drawer into focused section components
  (basic, API access, auth, models, advanced) with shared drawer layout
  primitives
- Extract submission, toast handling, and react-query cache invalidation into
  `useChannelMutateForm`
- Add a dedicated loading skeleton for channel detail fetch during edit mode
- Remove the top-level configuration summary block

Form validation and data handling:
- Strengthen `channel-form` Zod schema with JSON, model mapping, status code
  mapping, Codex credential, and Vertex AI key refinements
- Move type-specific conditional validation into `superRefine`
- Normalize base URL formatting and tighten model mapping value validation

Model mapping editor:
- Add Visual/JSON tabbed editing with inline JSON and duplicate-key feedback
- Improve accessibility for icon-only actions and add model suggestion datalists

MultiSelect component:
- Replace the custom cmdk-based implementation with Base UI Combobox chips
- Align focus, border, ring, disabled, and invalid states with standard Input
  styling via `ComboboxChips`
- Preserve existing API for all current callers (`options`, `selected`,
  `onChange`, `allowCreate`, `createLabel`)
- Support inline custom value creation and comma/newline batch input
- Limit visible chips with a compact "+N more" overflow summary via
  `maxVisibleChips` (8 in the channel editor)
- Anchor the dropdown to the full chips container via `useComboboxAnchor` so
  the popup matches input width and long model names are no longer truncated

Models & groups UX:
- Integrate manual custom model entry directly into the model MultiSelect
- Remove the separate manual model input/button block
- Keep selected-model count badge and existing model-mapping guardrail behavior

i18n:
- Add and sync translation keys for section descriptions, validation messages,
  model mapping UI, and MultiSelect labels across en, zh, fr, ja, ru, and vi
- Fix missing translations for "Name, provider type, and availability.",
  "Endpoint, provider-specific settings, and credentials.", and "Published
  models, groups, and model remapping rules."
- Remove obsolete keys tied to the deprecated summary and manual model entry UI
2026-05-26 01:55:27 +08:00
t0ng7u b37b6d80b3 Merge remote-tracking branch 'origin/main' 2026-05-26 01:22:56 +08:00
t0ng7u 3d850d38b6 ♻️ refactor(channels): rebuild channel create/edit drawer with modular sections and improved form UX
Restructure the default-theme channel create/edit experience to align with
classic frontend behavior, modern form UX patterns, and the project's Base UI
design system.

Channel editor architecture:
- Split the monolithic channel mutate drawer into focused section components
  (basic, API access, auth, models, advanced) with shared drawer layout
  primitives
- Extract submission, toast handling, and react-query cache invalidation into
  `useChannelMutateForm`
- Add a dedicated loading skeleton for channel detail fetch during edit mode
- Remove the top-level configuration summary block per UX feedback

Form validation and data handling:
- Strengthen `channel-form` Zod schema with JSON, model mapping, status code
  mapping, Codex credential, and Vertex AI key refinements
- Move type-specific conditional validation into `superRefine`
- Normalize base URL formatting and tighten model mapping value validation

Model mapping editor:
- Add Visual/JSON tabbed editing with inline JSON and duplicate-key feedback
- Improve accessibility for icon-only actions and add model suggestion datalists

MultiSelect component:
- Replace the custom cmdk-based implementation with Base UI Combobox chips
- Align focus, border, ring, disabled, and invalid states with standard Input
  styling via `ComboboxChips`
- Preserve existing API (`options`, `selected`, `onChange`, `allowCreate`,
  `createLabel`) for all current callers
- Support inline custom value creation, comma/newline batch input, searchable
  options, portal-based dropdown positioning, and chip removal

Models & groups UX:
- Integrate manual custom model entry directly into the model MultiSelect
- Remove the separate manual model input/button block
- Keep selected-model count and existing model-mapping guardrail behavior

i18n:
- Add and sync translation keys for new editor sections, validation messages,
  model mapping UI, and MultiSelect empty/create labels across en, zh, fr, ja,
  ru, and vi
- Remove obsolete keys tied to the deprecated summary and manual model entry UI

Affected areas:
- `web/default/src/features/channels/components/drawers/`
- `web/default/src/features/channels/hooks/use-channel-mutate-form.ts`
- `web/default/src/features/channels/lib/channel-form.ts`
- `web/default/src/features/channels/lib/model-mapping-validation.ts`
- `web/default/src/features/channels/components/model-mapping-editor.tsx`
- `web/default/src/components/multi-select.tsx`
- `web/default/src/i18n/locales/*.json`
2026-05-26 01:22:49 +08:00
yyhhyyyyyy 349d5429ca fix: handle paginated API key search response (#5014)
* fix: handle paginated API key search response

* fix: add accessible label to API key filter
2026-05-25 23:15:59 +08:00
花月喵梦 465c5edab9 fix:gemini to claude tool_use err (#5041) 2026-05-25 23:14:01 +08:00
learner-i ff06067a18 fix: 移除 fcIdx -1 偏移,修复并发工具调用撞键问题 (#5095)
当 Claude 直接以多个 tool_use 块起始(无文本前导,index=0)时,
-1 偏移导致 index=0 和 index=1 同时映射到 fcIdx=0:
- index=0 的工具 args 先流完,发出一次合法调用 ✓
- index=1 的 args 追加到同一 map 槽位,污染后为非法 JSON,该工具丢失 ✗
- index=2 以后的工具各自独占唯一 fcIdx,正常发出 ✓

结果:每轮并发调用中第 2 个工具必然丢失,
模型收不到对应的工具结果后重试剩余工具,
产生雪球效应(10个→9个→8个...逐轮收缩)。

修复:直接使用 Claude 的 block index 作为 fcIdx,不做偏移。
fcIdx 仅作为本地 map 的 key,只需保证唯一性,无需从 0 开始。
2026-05-25 23:13:06 +08:00