Commit Graph

58 Commits

Author SHA1 Message Date
Apple\Apple
618ed976f1 🎨 refactor(ui): modernize setup page
- Refactored system initialization page using TailwindCSS 3 and SemiUI components
- Changed layout from step navigation to single page display for all configurations
- Modified top area from vertical to more compact horizontal layout
- Updated gradient color scheme from blue/purple to orange/pink
- Fixed form field name duplication issues and optimized Form implementation
- Changed usage mode selection from three-column grid to vertical layout
- Replaced usage mode card icons from settings to more appropriate Layers icon
- Added specific prompts for different database types (SQLite/MySQL/PostgreSQL)
- Removed configuration summary section while keeping the initialization button
- Fixed useSetupCheck issue by using SetupCheck as a direct component for proper redirection
2025-06-04 08:15:48 +08:00
Apple\Apple
912c11ab2c ♻️ refactor: refactor the logic of fetchTokenKeys and SetupCheck 2025-06-04 01:00:48 +08:00
Apple\Apple
60e6fc67aa ♻️ refactor(components): refactor the components folder structure and related imports 2025-06-04 00:42:06 +08:00
Apple\Apple
0cd5e5cf48 ♻️ refactor(auth): move the auth component to the auth.js file in the helpers folder 2025-06-04 00:21:03 +08:00
Apple\Apple
a1918aa65e ♻️ refactor(StyleContext): modernize context architecture and eliminate route transition flicker
## Breaking Changes
- Remove backward compatibility layer for old action types
- StyleContext is no longer exported, use useStyle hook instead

## Major Improvements
- **Architecture**: Replace useState with useReducer for complex state management
- **Performance**: Add debounced resize handling and batch updates via BATCH_UPDATE action
- **DX**: Export useStyle hook and styleActions for type-safe usage
- **Memory**: Use useMemo to cache context value and prevent unnecessary re-renders

## Bug Fixes
- **UI**: Eliminate padding flicker when navigating to /console/chat* and /console/playground routes
- **Logic**: Remove redundant localStorage operations and state synchronization

## Implementation Details
- Define ACTION_TYPES and ROUTE_PATTERNS constants for better maintainability
- Add comprehensive JSDoc documentation for all functions
- Extract custom hooks: useWindowResize, useRouteChange, useMobileSiderAutoHide
- Calculate shouldInnerPadding directly in PageLayout based on pathname to prevent async updates
- Integrate localStorage saving logic into SET_SIDER_COLLAPSED reducer case
- Remove SET_INNER_PADDING action as it's no longer needed

## Updated Components
- PageLayout.js: Direct padding calculation based on route
- HeaderBar.js: Use new useStyle hook and styleActions
- SiderBar.js: Remove redundant localStorage calls
- LogsTable.js: Remove unused StyleContext import
- Playground/index.js: Migrate to new API

## Performance Impact
- Reduced component re-renders through optimized context structure
- Eliminated unnecessary effect dependencies and state updates
- Improved route transition smoothness with synchronous padding calculation
2025-06-02 04:16:48 +08:00
Apple\Apple
7e019db91b perf(playground): optimize config loading and saving to reduce console spam
- Cache initial config using useRef to prevent repeated loadConfig() calls
- Fix useEffect dependencies to only trigger on actual config changes
- Modify debouncedSaveConfig dependency from function reference to actual config values
- Update handleConfigReset to use DEFAULT_CONFIG directly instead of reloading
- Prevent excessive console logging during chat interactions and frequent re-renders

This resolves the issue where console was flooded with:
"配置已从本地存储加载" and "配置已保存到本地存储" messages,
especially during active chat sessions where logs appeared every second.

Fixes: Frequent config load/save operations causing performance issues
2025-05-30 22:29:02 +08:00
Apple\Apple
48835616b3 feat: Redirect to console if logged in and accessing auth pages
This commit introduces a new component `AuthRedirect` which checks
if a user is already logged in.

If the user is logged in and attempts to access the /login or /register
pages, they will be redirected to the /console page. Otherwise, the
respective authentication form (Login or Register) will be rendered.

The `App.js` file has been updated to utilize this new `AuthRedirect`
component for the /login and /register routes.
2025-05-20 11:53:04 +08:00
Apple\Apple
9934c978b0 feat: Add the /console/* route 2025-05-20 01:11:37 +08:00
Apple\Apple
c20fbec17b Merge pull request #927 from QuentinHsu/refactor-system-setting
# Conflicts:
#	web/src/App.js
#	web/src/components/ModelSetting.js
#	web/src/components/PersonalSetting.js
#	web/src/components/SystemSetting.js
#	web/src/pages/Channel/EditChannel.js
2025-04-16 16:27:11 +08:00
CaIon
d85e25fc46 feat: Integrate SetupCheck component for improved setup validation in routing 2025-04-08 17:31:46 +08:00
QuentinHsu
775b1c458b style(web): format code 2025-04-04 17:37:27 +08:00
CaIon
f33ebc8e2c feat: Implement system setup functionality 2025-04-03 18:57:15 +08:00
Calcium-Ion
f4cf7c8d43 Merge pull request #848 from wzxjohn/feature/oidc
feat: add oidc support
2025-03-11 23:20:55 +08:00
wzxjohn
bdb1a2fcb9 feat: add oidc support 2025-03-11 15:52:03 +08:00
1808837298@qq.com
f8bd6da813 feat: Improve route handling and dynamic chat navigation in SiderBar 2025-03-11 14:55:48 +08:00
1808837298@qq.com
5aa67994b1 refactor: Reorganize sidebar navigation and add personal settings route 2025-03-07 17:22:37 +08:00
CalciumIon
22487a8aaf feat: Refactor App and ChannelsTable components for improved i18n support
- Removed redundant user and status loading logic from the App component, centralizing it in the PageLayout component for better maintainability.
- Enhanced the ChannelsTable component by integrating translation functions for various UI elements, ensuring consistent localization of titles and modal messages.
- Updated the English locale file with new translation keys for sub-channel modifications, improving the overall localization coverage.
- Streamlined the code structure in multiple components to enhance readability and performance.
2024-12-14 14:09:30 +08:00
CalciumIon
1a15c216f0 feat: Implement status loading in App component and refactor SiderBar
- Added a new function to load status data from the API in the App component, enhancing the application's ability to display real-time status updates.
- Integrated error handling for API calls to improve user feedback in case of connection issues.
- Removed the redundant status loading logic from the SiderBar component, streamlining the code and ensuring a single source of truth for status management.
- Updated the useEffect hook in SiderBar to maintain sidebar collapse state based on local storage, improving user experience.
2024-12-14 12:57:56 +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
62875a7000 feat: Update dependencies and restructure Playground component
- Upgraded @douyinfe/semi-ui from version 2.63.1 to 2.69.1 in package.json.
- Updated pnpm-lock.yaml to reflect new dependency versions and lockfile format.
- Moved Playground component to a new directory structure under pages.
- Enhanced Playground component with new features and improved user experience.
2024-12-11 18:27:30 +08:00
licoy
11cc44b4ba 封装OAuth2授权回调页面 2024-11-12 16:11:38 +08:00
CalciumIon
4a46fef3d9 fix: LinuxDo OAuth 2024-11-11 17:24:57 +08:00
1808837298@qq.com
824714e577 feat: 完善自定义聊天配置 2024-10-12 21:09:59 +08:00
1808837298@qq.com
07fa9205cb feat: playground 2024-09-26 00:59:09 +08:00
CalciumIon
c8028aa8d1 Merge branch 'main' into g-main
# Conflicts:
#	web/src/App.js
2024-09-17 22:50:59 +08:00
CalciumIon
4007b688f9 feat: 优化界面显示 2024-09-17 19:55:18 +08:00
GuoRuqiang
36662d4c18 update App.js 2024-08-17 16:20:41 +00:00
GuoRuqiang
c358d8db12 重新修改了chat 2024-08-17 16:17:24 +00:00
Xiangyuan Liu
05a4646b44 feat: suno api 支持
feat: 调试 suno

feat: 补充suno 文档
2024-06-13 10:35:48 +08:00
CaIon
97acc9e5c4 feat: add pricing page 2024-05-13 23:02:35 +08:00
CaIon
eb955ae4b1 chore: lint fix 2024-03-23 21:24:39 +08:00
CaIon
9707192984 feat: 首页加载速度优化 2024-03-23 20:22:00 +08:00
CaIon
add3b05da4 chore: reformat code 2024-03-15 16:05:33 +08:00
1808837298@qq.com
556b16b9b8 feat: 可设置默认折叠侧边栏 2024-03-02 02:12:02 +08:00
GuoRuqiang
dbe8223e3b 增加了一个超链聊天跳转
在“运营设置里面”增加了“聊天页面2链接”,方便将项目(https://github.com/Dooy/chatgpt-web-midjourney-proxy) 替换掉原来的AMA问天。

Changes to be committed:
    modified:   common/constants.go
    modified:   controller/misc.go
    modified:   model/option.go
    modified:   web/src/App.js
    modified:   web/src/components/OperationSetting.js
    modified:   web/src/components/TokensTable.js
2024-01-16 18:15:55 +00:00
CaIon
fe148d175e perf: 数据看板支持选择时间粒度 2024-01-13 00:33:52 +08:00
CaIon
dd0abc9447 feat: 新增数据看板 2024-01-07 18:31:14 +08:00
CaIon
b7ac0b18d0 更新用户管理界面UI 2023-11-27 22:43:46 +08:00
CaIon
564eb5d9c5 移除更新提醒 2023-11-25 17:48:52 +08:00
CaIon
ed432c5a20 修复令牌bug 2023-11-03 22:38:17 +08:00
CaIon
8c0fa6295e 修改logo 2023-10-31 00:41:01 +08:00
CaIon
eec9046c3a 更换前端组件库 2023-10-31 00:03:22 +08:00
Mikey
035df55068 fix: 404 Component is missing (#592)
* fix: 404 Component is missing

* chore: update 404 page style

---------

Co-authored-by: JustSong <songquanpeng@foxmail.com>
2023-10-14 12:42:07 +08:00
JustSong
a6cc0226a7 feat: able to display quota in dollar 2023-06-20 20:09:17 +08:00
JustSong
b4142308c5 feat: able to add chat page link now (close #70) 2023-06-17 23:51:56 +08:00
JustSong
532b60f753 feat: now user can check its topup & consume history (close #78, close #95) 2023-06-10 16:04:04 +08:00
JustSong
bcb4862a19 refactor: bind quota to account instead of token (close #64, #31) 2023-05-16 11:26:09 +08:00
JustSong
ca3ab4055c fix: fix tab icon & title not changed (close #69) 2023-05-15 21:15:21 +08:00
JustSong
6eb288260d feat: able to customize system name & logo now 2023-05-14 19:29:02 +08:00
JustSong
d97d50b14c feat: Azure API supported without verification (#48, #57) 2023-05-13 11:36:36 +08:00