Commit Graph

5736 Commits

Author SHA1 Message Date
CaIon 428e3d91f2 chore: refresh related resources 2026-05-12 21:53:54 +08:00
dependabot[bot] 3856b9d2c0 chore(deps): bump axios from 1.15.0 to 1.15.2 in /web/classic (#4634)
Bumps [axios](https://github.com/axios/axios) from 1.15.0 to 1.15.2.
- [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.0...v1.15.2)

---
updated-dependencies:
- dependency-name: axios
  dependency-version: 1.15.2
  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-12 16:54:30 +08:00
Calcium-Ion 469d3747af fix: defaut ui triage (#4802)
* fix: theme-aware payment paths, auto-group validation, route guards, perf group filtering

- Add common.ThemeAwarePath to generate correct redirect URLs based on
  active theme (default vs classic), replacing hardcoded /console/* paths
  in 7 controllers and service/quota.go (#4765)
- Validate auto-group availability against getUserGroups before defaulting
  form values; playground falls back to 'default' group when 'auto' is
  unavailable (#4796, #4799)
- Enforce HeaderNavModules settings in rankings route (frontend + backend
  API) and SidebarModulesAdmin in playground route to block direct URL
  access when features are disabled (#4704, #4512)
- Filter perf_metrics API response to only include currently configured
  groups, hiding stale data from deleted groups (#4790)
- Preserve query params (pay=success/fail) in /console/topup → /wallet
  frontend redirect

* fix: update hero section text and localization strings for clarity
v1.0.0-rc.5
2026-05-12 16:47:02 +08:00
CaIon a720064d91 Merge branch 'main' of github.com:QuantumNous/new-api 2026-05-12 16:24:00 +08:00
skynono fde2cac9d3 fix(web/default): guard playground messages against legacy classic shape (#4650)
fix(playground): handle legacy localStorage message shape

Sanitizes old-format saved messages to prevent 500 on playground load.
2026-05-12 16:23:33 +08:00
Li Duoyang 2b89989f62 fix(default): support DropdownMenuItem onSelect (#4787)
fix(ui): add onSelect compat wrapper for DropdownMenuItem

Bridges Base UI DropdownMenu with Radix-style onSelect so existing consumers work without migration.
2026-05-12 16:23:24 +08:00
Micah-Zheng 7fe896d2f8 fix: use getUserGroups for ratio display to respect GroupGroupRatio (#4772)
fix(web/default): use getUserGroups for ratio display to respect GroupGroupRatio

Unifies admin/user ratio display so API key list matches the actual billing ratio.
2026-05-12 16:23:14 +08:00
ying2 3057f04a17 fix(wallet): read topup gateway flags from topupInfo instead of status (#4599)
fix(wallet): read topup gateway flags from topupInfo instead of status

Fixes #4632 — subscription purchase modal wrongly said online payment not enabled.
2026-05-12 16:23:04 +08:00
CaIon 03d537328a fix(default): improve performance health panel layout 2026-05-12 16:13:14 +08:00
CaIon 19fc384e67 feat(performance): update performance metrics handling and UI components 2026-05-12 16:04:15 +08:00
CaIon ba474393fb fix(default): resolve v1 frontend issue regressions
Fix v1 frontend regressions across channel forms, dashboard charts, wallet history, payment callbacks, invite links, API key groups, rate-limit errors, and usage-log scrolling.

Fixes #4715
Fixes #4618
Fixes #4699
Fixes #4651
Fixes #4637
Fixes #4682
Fixes #4691
Fixes #4565
Fixes #4334
2026-05-11 11:25:25 +08:00
夜影星辰 5fa103fa5b fix: exclude THIRD-PARTY-LICENSES.md from .dockerignore for Docker build (#4739) 2026-05-11 10:47:58 +08:00
CaIon 543cc64ea3 feat(licenses): add LICENSE, NOTICE, and THIRD-PARTY-LICENSES files to Docker images 2026-05-09 21:39:30 +08:00
t0ng7u d146e45e2f ⚖️ chore(web/default): add reusable copyright header tooling
Add a Bun script to apply and normalize AGPL copyright headers across the default frontend source files.

The script keeps headers idempotent, upgrades existing headers to the 2023-2026 QuantumNous range, and is exposed through `bun run copyright` for future maintenance.
2026-05-09 11:35:07 +08:00
yyhhyyyyyy 560ba57c88 feat: add DeepChat deeplink support (#4668) 2026-05-08 18:13:20 +08:00
t0ng7u 948780e3fa 🎨 fix(theme): align UI controls with global radius tokens
Remove hard-coded and capped border radius overrides so shared controls and feature actions consistently follow the active theme radius.

- Replace fixed radius utilities with semantic theme-aware radius tokens
- Remove redundant `rounded-full` and pixel-based overrides from header, toolbar, Playground, and utility actions
- Drop unused `StatusBadge` rounded prop usage
- Keep existing component behavior intact while improving global theme consistency
2026-05-08 01:50:03 +08:00
t0ng7u c19d5aa663 feat: Add model performance metrics to dashboard
Add a shared `performance-metrics` feature module for perf metric APIs, DTOs, and formatting, then surface global 24h model performance on the dashboard with cards and a top-model table.

Reuse the shared metrics module from pricing model details, remove duplicated perf API/formatting code from pricing, and add localized labels for the new dashboard performance UI.
2026-05-08 01:06:44 +08:00
t0ng7u a7475a1e67 🎨 fix(web): align UI and charts with theme tokens and presets
Improve theme switching fidelity (including system preference), extend design tokens so color presets tint real surfaces—not only primary/chrome—and refactor shared badges, tables, and dashboard visuals to semantic colors. Wire VChart series colors to `--chart-*` with safe fallbacks.

**Changes**

- **Theme runtime** (`theme-provider.tsx`): Validate stored theme cookie; keep `resolvedTheme` in sync with DOM + `(prefers-color-scheme)`; `resetTheme` respects `defaultTheme`; memoized context value.
- **Tokens** (`theme.css`): Add `--success|warning|info|neutral` (+ foregrounds) and map them under `@theme inline` for Tailwind utilities.
- **Presets** (`theme-presets.css`): For non-`default` presets, derive `card`, `popover`, `muted`, `accent`, `border`, `input`, and sidebar tokens from `--primary`/`--background`; map semantic status colors to preset chart variables.
- **Components**: `status-badge`, `colors` (avatars, announcements), `copy-button`, `group-badge`, `data-table` row styles, `sidebar` outline shadow (fix `var(--sidebar-border)` usage), ai-elements tool/web-preview status colors.
- **Dashboard**: Latency/API helpers and overview fragments use semantic tokens; `charts.ts` reads `--chart-1`…`--chart-5` from computed styles with fallbacks; `processChartData` / `processUserChartData` accept optional `themeKey` for preset churn; chart components pass `customization.preset` and bump `VChart` keys.

**Verification**

- `bun run typecheck`
2026-05-07 11:20:43 +08:00
t0ng7u 415d21d071 ♻️ refactor(layout): rename workspace switcher to system brand
Rename the layout branding component to reflect that it displays the system identity rather than switching workspaces. Update header usage and layout exports, and remove the now-unused workspace data dependency.
2026-05-07 03:54:32 +08:00
t0ng7u abc255dd6d ☀ fix(default): keep SectionPageLayout description slot hidden
Keep SectionPageLayout.Description as a non-rendering composition slot so callers stay compatible while page subtitles remain hidden across the app.
2026-05-07 03:26:22 +08:00
t0ng7u a7d019e3a9 feat(default): redesign dashboard overview
Refresh the overview page with an actionable Get Started guide, live API request details, real usage sparklines, and OpenAI-inspired dashboard panels. Add collapsible setup state, role-aware quick actions, and localized copy so returning users can focus on platform health.
2026-05-07 03:20:35 +08:00
CaIon e8cfb546fa feat(default): add model performance badges
Add a batched performance summary API for model square cards and show compact latency, throughput, and status metrics without increasing card size. Also fix OTP verification form submission.
v1.0.0-rc.4
2026-05-06 22:21:00 +08:00
yyhhyyyyyy d98f0e8ac3 fix: migrate select to Base UI items API (#4655) 2026-05-06 21:38:58 +08:00
Seefs 38a3314b9b fix: preserve OpenAI image edit reference fields (#4646)
* fix: preserve OpenAI image edit reference fields

* feat: support json image edit requests
2026-05-06 21:27:47 +08:00
CaIon 5c793d7992 refactor: move top_up_link from status API to topup info API
Move top_up_link out of the public GetStatus endpoint into the
authenticated GetTopUpInfo endpoint. Update classic frontend to
read topup_link from the topup info response instead of status.
Also add mailto links in SECURITY.md.

close #4582
2026-05-06 20:27:19 +08:00
CaIon ee190b6049 docs(security): add bulk reporting policy with block warning
Uncoordinated bulk vulnerability submissions have caused significant
disruption. Added a prominent notice requiring prior coordination for
bulk reports, with clear consequences: closure without review and
potential blocking of repeated offenders.
2026-05-06 20:17:05 +08:00
CaIon dede1e2968 fix(default): improve billing settings forms 2026-05-06 20:14:35 +08:00
CaIon 446a8420f5 fix(default): correct subscription payment display v1.0.0-rc.3 2026-05-06 18:38:53 +08:00
yyhhyyyyyy dc8deb0c24 fix: enable channel table server-side sorting (#4600) 2026-05-06 18:27:36 +08:00
CaIon f8cf9c57c4 feat(default): add real rankings data 2026-05-06 18:20:02 +08:00
CaIon 0f9f094a48 feat(default): reorganize system settings pricing UI
Refine the default system settings structure and model pricing editor so pricing configuration is easier to scan and edit.
2026-05-06 16:29:45 +08:00
Calcium-Ion 9acf5fecae feat: collect model performance metrics (#4635) 2026-05-06 13:55:23 +08:00
Calcium-Ion 8b2b03d276 feat(web/default): unified UI overhaul — Base UI migration, theme presets, rankings dashboard, and table toolbar refactor (#4633)
* 🎨 feat(web/default): add shadcn-style theme presets, radius prefs, and fix selection badges

Integrate the qn-platform–style OKLCH color system into the default frontend while keeping the existing blue-tinted dark tokens for the default theme. Add [data-theme-preset] palettes for seven named presets plus the default zinc-like scale, define [data-theme-radius] overrides so user radius beats preset --radius, and align the Tailwind @custom-variant dark helper with .dark usage.

Introduce ThemeCustomizationProvider to own preset and radius state, persist choices in cookies (theme-preset, theme-radius), and sync data-theme-preset / data-theme-radius on <html>. Wrap the tree in main.tsx.

Extend ConfigDrawer with theme preset swatches (scoped data-theme-preset) and radius previews wired to context; refactor swatch/card markup so selected CircleCheck badges sit outside clipped rows (remove outer overflow-hidden that hid the centered checkmark).

Add i18n keys for preset names, radius, and accessibility labels across en, zh, fr, ja, ru, vi.

* 🎨 fix(web): align segmented controls with theme radius tokens

- Replace hard-coded inner pill radii (rounded-[5px]) on dashboard chart
  toolbars with radius-md so the active state follows --radius when users
  change Radius in Theme Settings.
- Use nested radii consistent with TabsList/TabsTrigger: outer
  rounded-lg (var(--radius)) and inner rounded-md (calc(var(--radius) - 2px))
  so the track and active thumb stay concentric at small scales (e.g.
  0.3rem) instead of a squared “focus” block inside a rounded shell.
- Apply the same pattern to pricing SegmentedControl and the segmented
  groups in consumption-distribution-chart, model-charts, and user-charts.

Verified: bun run typecheck (web/default)

*  feat(pricing): enrich model details with uptime sparkline and API documentation

Add a compact 30-day uptime sparkline (OpenRouter-style bars + aggregate %) with
per-day tooltips, surface it in a status row under quick stats and in the
per-group performance table, and extend mock data so uptime series are stable
and optionally scoped by group.

Introduce an API tab with Shiki-highlighted code samples (cURL, Python,
TypeScript, JavaScript), endpoint-type switching, authentication guidance, a
supported-parameters table, and mock per-group RPM/TPM/RPD limits. Infer
vendor, tokenizer, license, and data-retention hints for a provider & data
privacy card on the Overview tab (capabilities/modalities stay with model
identity; rate limits stay with the API tab).

Update i18n for all new user-facing strings across en, zh, fr, ja, ru, and vi.

* 🏆 feat(rankings): add comprehensive rankings dashboard

Add a mock-data powered rankings experience with period tabs, model, app, and vendor leaderboards, market share and history charts, movers, new releases, and per-category sections while backend analytics are pending.

Link ranked models to pricing details and ranked vendors to filtered pricing results, and include localized copy for all supported frontend locales.

* fix(theme): correct theme preset selection state

- update Base UI Radio selectors to use data-checked/data-unchecked states.
- fix unchecked theme options still showing selected indicators.
- isolate the default theme preview tokens to prevent preset changes from leaking into it.

* fix(setup): correct usage mode radio state

- use Base UI data-checked/data-unchecked states for RadioGroup styling.
- hide radio indicators when options are unchecked to avoid setup page display issues.
- drive usage mode card and icon selection styles from Base UI state.

* fix(auth): submit sign-in and sign-up forms

* 🎨 refactor: Align default theme with shadcn Base Nova and prune legacy customization

Migrate shadcn UI to Base UI primitives via CLI (`base-nova` / `components.json`)
and reinstall full component registry with `--overwrite`, including Hugeicons-backed
widgets and newly added registry components.

- Remove custom multi-preset/theme-radius system (`ThemeCustomizationProvider`, cookies,
  preset UI from config drawer); rely on official semantic CSS tokens + light/dark only.
- Replace `theme.css` with shadcn’s documented neutral `:root`/`.dark` palette and
  `@theme inline` mappings (plus skeleton token vars for existing shimmer usage).
- Update global styles for Base UI: collapsible animation uses `--collapsible-panel-height`;
  clarify scroll-lock override comment.

Application compatibility:
- Keep minimal shims where app code diverged from official APIs (popover collision props,
  combobox legacy `options` callers, Spinner prop typing).
- Switch interactive styling from Radix-era `data-state` / `--radix-*` selectors to Base UI
  semantics (`data-open`, `data-popup-open`, `data-panel-open`, `--anchor-width`, etc.)

Tooling / docs / build:
- Rename Rsbuild vendor chunk grouping to `@base-ui` + transitive `@radix-ui`.
- Refresh AGENTS.md / CLAUDE.md / classic→default sync skill for Base UI stack.
- Bump `package.json` / lockfile for shadcn-postinstall deps (Hugeicons, chart stack, themes, etc.)

Verified: `bun run typecheck` passes.

Note: `bun run lint` still reports pre-existing hooks rule violations elsewhere;
not addressed in this change.

* 🎨 chore(web/default): unify table toolbar, relocate usage stats, refine filters

- Refactor DataTableToolbar to a single wrapping flex row with a
  right-aligned action cluster (Reset / Search / View / Expand) for a
  cleaner Ant Design Pro–style filter bar; remove the dedicated stats row
  and the toolbar `stats` prop.
- Move Common Logs summary badges (Usage / RPM / TPM) and the sensitive-
  data visibility toggle into the page header via CommonLogsHeaderActions
  and SectionPageLayout.Actions so the toolbar stays focused on filters.
- Slim CommonLogsFilterBar props (no stats / preActions eye control).
- Improve CompactDateTimeRangePicker: show minute-precision labels on the
  trigger (seconds omitted; aligns with datetime-local inputs); widen the
  trigger on sm+ breakpoints so the full range is visible without truncation;
  apply the same width in task logs filters.
- Simplify DataTableViewOptions: text-only “View” trigger, no sliders icon.
- Earlier layout tweak: extra top padding on SectionPageLayout scroll
  content so control focus rings are not clipped by overflow.

* feat(web/default): Base UI migration and component foundation

Migrate from Radix UI to Base UI, rewrite core UI primitives,
update dependencies (recharts, date-fns, next-themes), add
shadcn agent skill documentation, and refresh AI element components.

This is the foundational work from the v2/localmain lineage that
was not covered by the individual feature commits above.

---------

Co-authored-by: t0ng7u <dev@aiass.cc>
Co-authored-by: QuentinHsu <xuquentinyang@gmail.com>
2026-05-06 12:39:36 +08:00
CaIon dac55f0fde feat(ui): add classic frontend switch v1.0.0-rc.2 2026-04-30 20:38:05 +08:00
wans10 938dc9522b fix(web): 修复阶梯计费 Base64 解码失败与标签不匹配导致的显示错误 (#4530)
* fix(web): 修复阶梯计费表达式解析与匹配逻辑

- 优化 Base64 解码逻辑:引入 UTF-8 感知的解码方法(使用 TextDecoder/Uint8Array),替换原有的简单 `atob`,修复包含非拉丁字符时解码失败的问题。
- 增强阶梯标签匹配机制:新增标签规范化处理(移除空格、统一大小写、转换 `<`/`≤`/`<=` 等符号),确保日志记录中的标签能够与配置中的标签准确匹配。
- 将上述修复同步应用于 default 和 classic 两套前端主题。

* refactor(web): 完善 Base64 解码函数的类型声明

- 根据 CodeRabbitAI 的代码审查建议,将 `decodeBillingExprB64` 方法中 `Array.prototype.map` 回调函数的参数类型由 `any` 替换为更精确的 `number`。
- 提高了代码的类型安全性与可读性。

* fix(web): 修复动态价格明细表中阶梯高亮未能正确匹配的问题

- 在 default 主题的 `DynamicPricingBreakdown` 组件中,引入 `normalizeTierLabel` 函数。
- 替换原有对 `matchedTierLabel` 的严格相等判定,确保在包含全半角符号(如 `≤`/`<=`)或存在空格等格式不一致的场景下,日志详情中的表格依然能准确高亮(Matched)当前命中的对应计费阶梯。

* refactor(web): 移除阶梯计费标签不匹配时的强制兜底逻辑

- 在 default 和 classic 主题中,修改 `resolveMatchedTier` 和相关的阶梯匹配方法,当日志中 `matched_tier` 无法与表达式中的阶梯标签严格对应时,直接返回 `null` 而不再默认退化展示第一阶梯(`tiers[0]`)的价格。
- 遵循“数据准确性优先”的计费展示准则,防止因匹配失败而向用户展示猜测出的单价,避免产生账单误导及客诉风险。
- 在 Classic 主题账单卡片中,对于无法匹配的异常账单明确展示“未匹配到对应阶梯”的提示。

* fix(web): 修复阶梯计费标签正则匹配的短路问题

- 根据 CodeRabbitAI 的代码审查反馈,修正了 `normalizeLabel`(以及 `normalizeTierLabel`)函数中的正则表达式分支顺序。
- 将原本的 `/<|≤|<=/` 调整为 `/<=|≤|</`,以修复 JavaScript 正则引擎从左到右匹配时,会将 `<=` 中的 `<` 优先短路匹配,导致残留 `=` 号的问题。
- 确保了双字符操作符(如 `<=`、`>=`)现在能够被正确完整地替换为单字符(`<`、`>`),保证了计费阶梯日志匹配的准确性。

* fix(web): 完善阶梯计费未匹配展示

---------

Co-authored-by: CaIon <i@caion.me>
2026-04-30 20:26:58 +08:00
Calcium-Ion 5114ad0677 Merge pull request #4200 from yyhhyyyyyy/fix/vertex-gateway-base-url
fix(vertex): honor custom base_url as gateway prefix
2026-04-30 20:11:17 +08:00
CaIon d46df94f05 feat(ui): improve mobile responsive layouts 2026-04-30 19:53:02 +08:00
CaIon aa730395f1 fix(ui): polish landing page and navigation 2026-04-30 17:00:29 +08:00
CaIon d2b30dfc95 feat(ui): redesign model square pricing page 2026-04-30 16:29:32 +08:00
yyhhyyyyyy 987b7ecd22 fix(vertex): honor custom base_url as gateway prefix 2026-04-30 15:08:10 +08:00
yyhhyyyyyy 5f86839c7e fix: improve tiered pricing number input editing (#4536)
* fix: follow required marker styling convention

* fix: improve tiered pricing number input editing
2026-04-30 14:41:15 +08:00
CaIon 8f3c41ae77 feat(ui): improve table controls and analytics filters 2026-04-30 13:57:10 +08:00
CaIon 8bff691089 feat(ui): add reusable dashboard and log controls 2026-04-30 13:55:25 +08:00
Calcium-Ion 22fd1741ab Merge pull request #4551 from SHLE1/fix/email-bind-post-method
bug fix: 新版前端email绑定错误
2026-04-30 12:26:48 +08:00
SHLE1 9b0ec8ed48 fix: use post for email binding 2026-04-30 12:21:24 +08:00
Calcium-Ion 95648353e4 Merge pull request #4548 from Micah-Zheng/fix/default-api-key-group
fix: 修复默认主题 API 密钥分组行为
2026-04-30 12:08:03 +08:00
Micah-Zheng 2f8637048e fix: 修复默认主题 API 密钥分组行为
Signed-off-by: Micah-Zheng <102610064+Micah-Zheng@users.noreply.github.com>
2026-04-30 03:09:32 +08:00
CaIon b2232f4355 feat(ui): add system settings to sidebar and unhide frontend theme switcher
- Add System Settings entry to Admin sidebar group with Settings icon
- Register /system-settings URL mapping in sidebar config
- Remove 3-click hidden unlock from Frontend Theme setting, making it
  directly visible in System Information section
v1.0.0-rc.1
2026-04-29 20:09:07 +08:00
CaIon b44faec66b feat(ui): overhaul default channel editor with full param override visual editor
- Port classic ParamOverrideEditorModal to default as standalone dialog (~3200 lines)
  with two-panel layout, drag-to-reorder, 23 operation modes, template library,
  visual/JSON dual mode, conditions management, and legacy format support
- Redesign channel drawer layout with clear visual hierarchy (CardHeading vs SubHeading)
  and bordered sub-modules for Field Passthrough and Upstream Model Detection
- Replace header override JsonEditor with plain textarea matching classic behavior
- Add searchable channel type combobox with scroll fix
- Add 100+ i18n keys across all 6 locales (en, zh, fr, ja, ru, vi)
2026-04-29 18:09:11 +08:00
yyhhyyyyyy 3b592895c6 fix: follow required marker styling convention 2026-04-29 15:01:50 +08:00