New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨ feat: import settings from url #2226
Conversation
@cy948 is attempting to deploy a commit to the LobeHub Team on Vercel. A member of the Team first needs to authorize it. |
👍 @cy948 Thank you for raising your pull request and contributing to our Community |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2226 +/- ##
========================================
Coverage 92.83% 92.84%
========================================
Files 290 290
Lines 16613 16641 +28
Branches 1196 1928 +732
========================================
+ Hits 15423 15450 +27
- Misses 1190 1191 +1 ☔ View full report in Codecov by Sentry. |
@arvinxx 我试了下还是改成用 hash 吧,不要用 search 。search 会被服务端感知到,然后可能会有水合问题。 但是 hash 的话只会在client 被感知,这样可以减少相关的调用问题。 |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
❤️ Great PR @cy948 ❤️ The growth of project is inseparable from user feedback and contribution, thanks for your contribution! If you are interesting with the lobehub developer community, please join our discord and then dm @arvinxx or @canisminor1990. They will invite you to our private developer channel. We are talking about the lobe-chat development or sharing ai newsletter around the world. |
## [Version 0.152.0](v0.151.11...v0.152.0) <sup>Released on **2024-04-30**</sup> #### ✨ Features - **misc**: Import settings from url. <br/> <details> <summary><kbd>Improvements and Fixes</kbd></summary> #### What's improved * **misc**: Import settings from url, closes [#2226](#2226) ([b1f6c20](b1f6c20)) </details> <div align="right"> [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) </div>
🎉 This PR is included in version 0.152.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
## [Version 1.32.0](v1.31.3...v1.32.0) <sup>Released on **2024-04-30**</sup> #### ✨ Features - **misc**: Import settings from url. <br/> <details> <summary><kbd>Improvements and Fixes</kbd></summary> #### What's improved * **misc**: Import settings from url, closes [lobehub#2226](https://github.com/bentwnghk/lobe-chat/issues/2226) ([b1f6c20](b1f6c20)) </details> <div align="right"> [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) </div>
💻 变更类型 | Change Type
🔀 变更说明 | Description of Change
支持从 URL search params 中导入全局设置,目前支持的设置有:
languageModel
: 设置语言模型的设置;代码变更:
src/const/url.ts
: 添加了标识 search param 参数名的constant;src/services/share.ts
:增加了将 “设置从URL导入” 或 “导出设置到URL” 功能的方法;src/services/__tests__/share.test.ts
:为上述方法补充测试;src/hooks/useImportConfig.ts
: 添加调用shareService
中的方法进行解析的 hook;src/layout/GlobalProvider/StoreInitialization.tsx
:获取 search params ,调用 hook 进行解析并导入。📝 补充信息 | Additional Information
settings
使用encodeURI(JSON.stringify(settings))
, 转化为 URL: