6247 Commits
Author SHA1 Message Date
CaIon df44a75d53 fix: adapt ClickHouse log LIKE filters 2026-06-27 17:03:25 +08:00
Calcium-Ion 4aee5f7d5a feat: better admin permissions (#5755)
* feat: add casbin admin permissions

* feat: improve audit logging to associate logs with actual operators and target users

* feat: enhance admin permissions and UI interactions for sensitive actions

* Refactor authz RBAC and tighten channel permissions

* Split channel authz field policy

* Address channel authz review findings
2026-06-27 17:01:59 +08:00
CaIon 6c35e1ef26 chore: update i18n skill 2026-06-27 12:42:54 +08:00
feitianbubu d10fc762fa fix(task): attribute async task usage log to the initiating node (#5684)
Async task usage logs (LogQuotaData node dimension) were recorded
under whichever node happened to poll the task to completion, not the
node that submitted it. For token/adaptor-billed video tasks the
pre-deduction is often 0, so the entire quota landed on the last
polling node.

Snapshot common.NodeName into TaskPrivateData at submit time and use
it when writing the settlement consume log; fall back to the current
node when empty so existing tasks stay compatible.
2026-06-26 21:48:23 +08:00
peakchao c0e42bfbdc fix(theme): 切换前端主题后重置到首页,避免路由 404 (#5612)
* fix(theme): 切换前端主题后重置到首页,避免路由 404
经典前端与新版前端的路由路径不同,切换主题后停留在原路径会导致 404:
- 经典前端切换到新版前端时跳转首页,不再原地刷新当前路径
- 新版前端保存时若前端主题发生变化,保存成功后跳转首页

Fixes #4947

* fix: 更新前端切换提示信息,修正页面跳转逻辑
2026-06-26 21:44:23 +08:00
feitianbubu 35074345e8 chore(deps): sync bun.lock for dompurify 3.4.11 (#5738) 2026-06-26 19:01:05 +08:00
feitianbubu 3245b2b746 fix(model-pricing): refresh tiered expression editor when switching models (#5752)
Switching models in the pricing editor kept the previous model's tiers and prices in the expression panel: TieredPricingEditor seeds its internal visual/raw state only on mount, and the initRef guard never re-ran on prop changes, so only the model name updated.

Bump a reload token in the same effect that seeds billingExpr and use it as the editor's key, so a freshly loaded model remounts the editor and re-parses its expression. The token changes in lockstep with billingExpr, and user edits (which only touch state) do not trigger it.

Closes #5750
2026-06-26 18:57:08 +08:00
zhongyuanzhao-alt 79396745d1 fix: add Waffo goods info and webhook SDK update (#5704)
* fix: add Waffo goods info and webhook SDK update

* chore: remove Waffo test code from PR
2026-06-25 17:34:02 +08:00
QuentinHsu 9ba251ce5f perf(web): streamline table actions and destructive dialogs (#5645)
* perf(data-table): autosize action columns

- exclude actions columns from shared table width calculations so action cells size to their content.
- remove fixed size and w-* width overrides from feature action columns to preserve content-based layout.

* perf(data-table): streamline row action controls

- expose common edit and status actions directly while moving secondary actions into overflow menus.
- add shared row action menu helpers so static and table rows use consistent action controls.
- let action columns size to their content instead of relying on fixed widths.

* fix(web): localize destructive dialog copy

- route delete, reset, and batch update confirmation text through i18n.
- add locale entries for affected channel, model, system settings, and user dialogs.

* perf(web): unify destructive dialog actions

- align delete and cleanup confirmation buttons with the shared destructive variant.
- replace custom destructive color overrides with semantic button variants.
- clean up lint errors in touched dialog files before committing.

* fix(web): add user action success translations

- add localized success messages for user delete, status, and role changes.
- keep user management toast copy available across all frontend locales.

* fix(data-table): prevent mobile badge clipping

- expose badge cell slots so mobile card styles can target nested badge wrappers.
- reset badge margins in card rows to keep provider icons fully visible on small screens.
2026-06-25 13:13:41 +08:00
CaIon b191f47375 fix: use neutral drawing task labels 2026-06-24 22:15:29 +08:00
Seefs c12e5db4f9 fix(ci): install classic workspace dependencies for releases (#5719) 2026-06-24 21:06:58 +08:00
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 0bf42781d4 chore(deps): bump dompurify from 3.4.5 to 3.4.11 in /web/default (#5718)
Bumps [dompurify](https://github.com/cure53/DOMPurify) from 3.4.5 to 3.4.11.
- [Release notes](https://github.com/cure53/DOMPurify/releases)
- [Commits](https://github.com/cure53/DOMPurify/compare/3.4.5...3.4.11)

---
updated-dependencies:
- dependency-name: dompurify
  dependency-version: 3.4.11
  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-06-24 21:06:00 +08:00
CaIon 69b0f0b56f feat: add date-fns and date-fns-tz paths to build configuration 2026-06-24 20:56:01 +08:00
CaIon 48da37a3df feat: add date-fns and date-fns-tz dependencies 2026-06-24 20:51:58 +08:00
CaIon ad35ab1d9a feat: enhance i18n-translate skill 2026-06-24 20:46:30 +08:00
CaIon 5814ca90c3 fix: add token limit save label translations 2026-06-24 20:45:48 +08:00
CaIon d2dcbc3137 feat: add channel async polling delay toggle
Fixes #5717
Fixes #4244
2026-06-24 20:40:10 +08:00
RedwindA 5d943281b5 feat(system-settings): add user token limit configuration section (#5678) 2026-06-24 20:39:21 +08:00
feitianbubu 0b2cf43e7b fix(web): hide wallet entry in profile dropdown when wallet module disabled (#5708)
The profile dropdown rendered the wallet item unconditionally, so it
still showed after an admin disabled the personal/topup (wallet) sidebar
module. Reuse the sidebar module visibility check so the dropdown honours
the same toggle as the sidebar.

Fixes #5696
2026-06-24 19:45:10 +08:00
yyhhyyyyyy de0d6ac994 fix(web): sync channel card selection state (#5700) 2026-06-24 19:44:53 +08:00
QuentinHsu f4473d963c fix(web): replace default markdown renderer and expand syntax support (#5689)
* fix(markdown): render default markdown with marked

- switch default frontend markdown rendering from react-markdown/remark-gfm to marked to avoid old WebKit parse failures from lookbehind regex literals
- sanitize marked HTML output with DOMPurify and preserve external link target and rel behavior
- remove default direct dependencies on react-markdown, remark-gfm, and rehype-raw while leaving classic unchanged

* fix(markdown): expand default markdown rendering support

- render default markdown with marked extensions for KaTeX formulas, page breaks, and common emoji shortcodes.
- sanitize KaTeX output with an explicit DOMPurify allowlist while preserving external link behavior.
- avoid overriding marked text rendering so lists and inline parsing keep their internal parser context.

* fix(markdown): render diagram code blocks in default UI

- add sanitized SVG rendering for flow and sequence diagram code blocks.
- size flow nodes from their labels and route edges from node anchors to prevent clipping.
- style diagram nodes, arrows, labels, and notes with theme-aware classes.
2026-06-24 19:44:34 +08:00
Calcium-Ion 2cbdfa0398 feat: add system instance info panel (#5716)
* feat: add system instance reporting

* feat: show system instance resources

* fix: update translations for heartbeat messages in Russian and Vietnamese
2026-06-24 19:16:56 +08:00
Calcium-Ion 5377192293 feat: add system task runner (#5680) 2026-06-24 17:16:21 +08:00
CaIon acb52d0f78 chore(deps): update clickhouse-go and orb dependencies 2026-06-24 16:20:02 +08:00
Seefs 64eafc9414 fix: date-fns-tz classic theme build error (#5676) 2026-06-24 15:54:51 +08:00
CaIon 72b3f34576 chore: update agent skills and project config
- add vercel-react-best-practices skill (SKILL.md + full-guide.md)
- slim CLAUDE.md to import shared AGENTS.md conventions
- promote go-ntlmssp to a direct dependency in go.mod
2026-06-24 13:52:51 +08:00
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 993d67ebd5 chore(deps): bump github.com/ClickHouse/ch-go from 0.58.2 to 0.65.0 (#5664)
Bumps [github.com/ClickHouse/ch-go](https://github.com/ClickHouse/ch-go) from 0.58.2 to 0.65.0.
- [Release notes](https://github.com/ClickHouse/ch-go/releases)
- [Commits](https://github.com/ClickHouse/ch-go/compare/v0.58.2...v0.65.0)

---
updated-dependencies:
- dependency-name: github.com/ClickHouse/ch-go
  dependency-version: 0.65.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-24 13:24:15 +08:00
CaIon cf6ae6fdeb fix: preserve SMTP PLAIN auth TLS guard 2026-06-24 12:50:54 +08:00
Benson Yan 2f23a66733 fix: support SMTP STARTTLS mode and NTLM auth (#5426)
* fix: support SMTP STARTTLS mode and NTLM auth

Add explicit SMTP STARTTLS configuration for 587-style connections and keep SSL/TLS as the implicit TLS mode.

Prefer PLAIN when advertised, keep LOGIN compatibility, and add NTLM as a fallback for Exchange SMTP servers that require it after STARTTLS.

* fix: respect explicit SMTP encryption mode

* fix: preserve SMTP TLS compatibility
2026-06-24 12:45:39 +08:00
CaIon 9fc9c8f1e3 chore: avoid duplicate shadcn skill exposure 2026-06-23 13:53:52 +08:00
CaIon f8cfbfa4df refactor(log): remove legacy log deletion endpoint and associated types 2026-06-22 19:40:04 +08:00
CaIon f84b7d591f refactor(log): simplify ClickHouse log deletion and add unit tests
Replace the per-batch ClickHouse mutation loop with a single
ALTER TABLE ... DELETE, since ClickHouse DELETE is a heavy mutation
that rewrites data parts and per-batch mutations are pathologically
slow. Add deterministic unit tests covering ClickHouse DSN handling,
main-database rejection, TTL DDL generation, log ordering, request_id
backfill, and display id assignment.
2026-06-22 19:32:32 +08:00
CaIon a162163b48 feat: add persistent system task log cleanup progress 2026-06-22 19:16:53 +08:00
Calcium-Ion 6dc4030fdf feat: support ClickHouse log database (#5663)
* feat: support ClickHouse log database

* feat(log): optimize log deletion process for ClickHouse
2026-06-22 18:41:26 +08:00
feitianbubu 354d0fedba feat: default node name to hostname when NODE_NAME unset (#5659)
Fall back to the OS hostname when NODE_NAME is not configured, so node
identity in audit/usage logs is populated automatically. In container and
Kubernetes deployments the hostname equals the container ID or Pod name,
which stays unique under autoscaling without any manual per-instance config.
2026-06-22 18:08:00 +08:00
Herb Brewer efd6c445ac feat: add passive channel monitoring mode (#5592)
* feat: add passive channel monitoring mode

* fix: clarify passive monitor mode copy
2026-06-22 18:07:44 +08:00
CaIon e5694748c7 chore(web): use tsgo for type checking 2026-06-22 13:38:43 +08:00
CaIon 44e0e68689 feat: add channel test env toggle 2026-06-22 12:45:45 +08:00
Seefs 0b7ae4ea79 fix: StepFun -> Stepfun (#5636) 2026-06-21 12:20:14 +08:00
Delicious233 1f1da5536b fix(usage-logs): show provider icons for CN models (align with classic frontend) (#5631)
resolveModelProvider in model-badge.tsx only covered mainstream providers
(OpenAI/Claude/Gemini/Grok/DeepSeek/Qwen/Doubao/Moonshot/Mistral/Meta/Cohere).
Models from Zhipu (glm-), MiniMax, Xiaomi MiMo, Baidu (ernie), iFlyTek
(spark), Tencent (hunyuan), Baichuan, InternLM, StepFun, and Yi rendered
as grey dots instead of their brand icons in the usage logs table.

Add keyword mappings for these providers, aligning coverage with the
classic frontend's getModelCategories. Icons resolved via @lobehub/icons.
2026-06-21 12:07:31 +08:00
CaIon 5e86644649 feat(dashboard): add sensitive data toggle to flow chart
Add an eye toggle in the flow section header that masks sensitive node
labels (users, tokens, nodes, groups, channels) in the Sankey while keeping
model names visible. Masking only rewrites display text; nodes stay distinct
via their key so graph structure, links, and highlighting are unaffected.
2026-06-20 22:09:04 +08:00
CaIon 8ad83bf62f feat(dashboard): interactive sankey highlighting and persistent filters
- Highlight full paths through a clicked node or link in the flow Sankey,
  dimming unrelated nodes/links instead of removing them
- Disable VChart built-in emphasis to avoid crash, use custom highlight sets
- Initialize models filter dialog from currently applied filters so manual
  time ranges are not overridden by preferences; auto-pick granularity by range
- Lift user charts time range/granularity/limit to dashboard as controlled state
2026-06-20 22:09:03 +08:00
CaIon 061948011c feat: limit dashboard flow nodes 2026-06-20 22:09:03 +08:00
skynono d58029c637 fix(model-pricing): 修复可视化模型定价列表项无法删除 (#5628)
删除时已从草稿中移除模型,但列表为 saved∪draft 并集且优先取 saved,
导致行不消失(isDraftDeleted 计算后未被使用),表现为无法删除。改为过滤
掉已暂存删除的行;并在删除当前正在编辑的行时关闭编辑器,避免从残留面板
保存又把模型写回。
2026-06-20 22:08:29 +08:00
skynono 0c6c1b373a fix(wallet): 修复计费历史弹窗分页与列表重叠 (#5627)
base-ui 的 ScrollArea 仅靠 max-height 无法约束高度:其 Viewport 用
height:100%,当 Root 只有 max-height 而无确定高度时会回退为 auto,
内容撑满并溢出到 Root 之外,盖住下方分页。改用原生 max-h + overflow-y-auto
的 div,列表正确内部滚动,分页作为同级元素干净地排在下方。
2026-06-20 21:35:47 +08:00
skynono 7409174456 fix(log): 修复新前端日志按登录类型(type=7)筛选失效 (#5620)
路由 search 校验枚举 logTypeValues 漏了 '7'(登录),
选「登录」时 type=['7'] 校验失败被 .catch([]) 兜底成空数组,
最终请求丢掉 type 参数。补上 '7' 与 LOG_TYPE_ENUM.LOGIN 对齐。
2026-06-20 20:46:19 +08:00
QuaternijkonandCaIon a68041f7d6 feat(dashboard): add traffic flow sankey chart (#5465)
* feat(dashboard): add traffic flow sankey chart

Add dashboard flow APIs and a Sankey-based flow view with user, optional API key, model, and channel layers.\n\nReuse the dashboard VChart palette, add precise link/node tooltips and interactions, and cover filtering, layer ordering, color stability, and error states with tests.

* feat: build flow chart from quota data

---------

Co-authored-by: CaIon <i@caion.me>
2026-06-20 18:57:47 +08:00
CaIon f9e508bdae perf(channels): optimize card view layout and reduce re-renders
- Show 3-column card grid from xl breakpoint instead of 2xl
- Cap inline priority/weight width to avoid huge values stretching cards
- Collapse right-column grid to content-sized columns, removing wasted space
- Memoize channel columns, context value, upstream-update result, and ChannelCard
  to avoid rebuilding/re-rendering all cards on unrelated state changes
2026-06-20 16:06:06 +08:00
CaIon cb841850b7 fix: update channel icon 2026-06-20 14:06:53 +08:00
CaIon 91ab664c53 feat: add routing reliability management 2026-06-20 13:55:50 +08:00