Skip to content
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

style: Fixed an issue where the sample of the reply content was displayed out of order #5174

Merged
merged 5 commits into from
Aug 6, 2024

Conversation

ahzmr
Copy link
Contributor

@ahzmr ahzmr commented Aug 2, 2024

💻 变更类型 | Change Type

  • feat
  • fix
  • refactor
  • perf
  • style
  • test
  • docs
  • ci
  • chore
  • build

🔀 变更说明 | Description of Change

Fixed an issue where the sample of the reply content was displayed out of order

📝 补充信息 | Additional Information

Summary by CodeRabbit

  • Performance Improvements
    • Enhanced rendering logic for the Markdown component to optimize performance during message streaming and updates.
  • New Features
    • Improved HTTP request handling in the WebDAV client, allowing for flexibility in method proxying.
    • Enhanced error handling for 404 responses in the WebDAV client, providing clearer feedback on missing resources.

Copy link

vercel bot commented Aug 2, 2024

@ahzmr is attempting to deploy a commit to the NextChat Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

coderabbitai bot commented Aug 2, 2024

Walkthrough

The recent modifications enhance HTTP request handling and the rendering of chat messages within the application. A conditional key prop was added to the Markdown component in the _Chat function, improving rendering efficiency. Simultaneously, the route.ts and webdav.ts files introduced a proxy_method to allow flexible handling of HTTP methods, along with improved error management and configurability in the WebDAV client.

Changes

File Change Summary
app/components/chat.tsx Added a conditional key prop to the Markdown component based on message.streaming, optimizing rendering.
app/api/webdav/[...path]/route.ts Introduced a proxy_method variable to manage HTTP methods more flexibly and enhance security checks.
app/utils/cloud/webdav.ts Updated createWebDavClient to change the fetch method from "MKCOL" to "GET" and added proxyMethod parameter for URL flexibility.

Poem

In the chat where messages flow,
A little tweak to help them grow.
With keys that change with streaming light,
Our rendering now feels just right!
Hopping through updates, quick and spry,
Chatting with joy, we’ll reach the sky! 🐇✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between a8c65e3 and 3c1e5e7.

Files selected for processing (1)
  • app/components/chat.tsx (1 hunks)
Additional comments not posted (2)
app/components/chat.tsx (2)

1473-1473: Ensure Correctness of Conditional key Prop.

The conditional key prop for the Markdown component is correctly implemented to optimize rendering based on the message.streaming state.


1473-1473: Assess Impact on Performance and Rendering Logic.

The addition of the key prop helps React manage the component's identity during updates, improving performance and preventing unnecessary re-renders. This is a good practice for optimizing rendering logic.

Copy link
Contributor

github-actions bot commented Aug 2, 2024

Your build has completed!

Preview deployment

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 3c1e5e7 and 716899c.

Files selected for processing (2)
  • app/api/webdav/[...path]/route.ts (7 hunks)
  • app/utils/cloud/webdav.ts (4 hunks)
Additional comments not posted (7)
app/utils/cloud/webdav.ts (3)

17-18: Verify the change in HTTP method from "MKCOL" to "GET".

The change in HTTP method from "MKCOL" to "GET" suggests a shift in the intended operation of the request. Ensure that this change aligns with the intended functionality.


45-47: Improved error handling for 404 status code.

The addition of a specific condition for a 404 status code improves error handling by providing a clearer response when a resource is not found.


Line range hint 69-91:
Enhanced configurability with proxyMethod parameter.

The addition of the proxyMethod parameter allows for more flexible URL construction by enabling the inclusion of a proxy method in the query parameters. This increases the configurability of the createWebDavClient function.

However, ensure that all calls to the path method are updated to include the new proxyMethod parameter where necessary.

app/api/webdav/[...path]/route.ts (4)

32-32: Enhanced flexibility with proxy_method variable.

The introduction of the proxy_method variable enhances the flexibility of the request handling by allowing for proxying of methods while maintaining security checks against SSRF vulnerabilities.


69-73: Consistent method validation with proxy_method.

The validation checks for the HTTP methods MKCOL, GET, and PUT are updated to use proxy_method, ensuring that the method validation is consistent with the potentially overridden method specified in the query parameters.


86-86: Consistent condition for MKCOL requests with proxy_method.

The condition for MKCOL requests is updated to use proxy_method, ensuring that the condition is consistent with the potentially overridden method specified in the query parameters.


99-99: Consistent condition for GET requests with proxy_method.

The condition for GET requests is updated to use proxy_method, ensuring that the condition is consistent with the potentially overridden method specified in the query parameters.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 716899c and 724c814.

Files selected for processing (1)
  • app/components/chat.tsx (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • app/components/chat.tsx

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 724c814 and bfe4e88.

Files selected for processing (1)
  • app/components/chat.tsx (1 hunks)
Files skipped from review due to trivial changes (1)
  • app/components/chat.tsx

@lloydzhou lloydzhou merged commit 5629f84 into ChatGPTNextWeb:main Aug 6, 2024
1 check failed
@ft4710403
Copy link

下载了,打包了镜像,启动起来以后,抛起来,代理那里如何设置呢,检查可用性还是。。。对了,webdav需要如何创建文件么~

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


After downloading and packaging the image, after starting it, throw it up and ask how to set up the proxy and check the availability. . . By the way, does webdav need to create files?

@ahzmr
Copy link
Contributor Author

ahzmr commented Aug 18, 2024

下载了,打包了镜像,启动起来以后,抛起来,代理那里如何设置呢,检查可用性还是。。。对了,webdav需要如何创建文件么~

这个版本不需要创建文件。但如果不是白名单里的webdav服务,需要配置一下白名单环境变量就可以了。其他的就是配置好云同步配置,之后检查,再同步一次。如果打开了了自动同步,后面系统回复完消息,以及自己删除了会话时,会自动同步的。

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


After downloading and packaging the image, after starting it, throw it up and ask how to set up the proxy and check the availability. . . By the way, does webdav need to create files?

This version requires no file creation. But if it is not a webdav service in the whitelist, you need to configure the whitelist environment variables. The other thing is to configure the cloud synchronization configuration, check it later, and synchronize it again. If automatic synchronization is turned on, the system will automatically synchronize after replying to the message or deleting the conversation.

@ft4710403
Copy link

下载了,备份了镜像,启动起来以后,抛起来,代理那里怎么设置呢,检查可用性还是。。。对了,webdav 需要如何创建文件么~

这个版本不需要文件。但是如果不是白名单里的webdav服务,需要配置一下白名单环境变量就可以了。其他的就是配置好云同步配置,之后检查,再同步一次。如果打开了自动同步,后面系统回复完成消息,以及自己删除了会话时,会自动同步的。

果然可以了,那webdav的服务器和用户名信息可以用变量保存下来吗,免得每次换电脑又不行

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Downloaded and backed up the image. After starting it, throw it up. How to set up the proxy and check the availability. . . By the way, does webdav need to create files?

No files are required for this version. But if it is not a webdav service in the whitelist, you need to configure the whitelist environment variables. The other thing is to configure the cloud synchronization configuration, check it later, and synchronize it again. If automatic synchronization is turned on, it will be automatically synchronized later when the system replies with a completion message or when you delete the session.

Sure enough, it works. Can the server and username information of webdav be saved using variables, so as not to have to worry about changing computers every time?

@ft4710403
Copy link

微信截图_20240818162550
每次发消息,和新建、删除会话,好像还是没有自动同步呢,目前测试还是要手动点

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


WeChat screenshot_20240818162550
It seems that every time you send a message, create or delete a conversation, it still does not synchronize automatically. Currently, you still need to click manually for testing.

@ahzmr
Copy link
Contributor Author

ahzmr commented Aug 18, 2024

微信截图_20240818162550 每次发消息,和新建、删除会话,好像还是没有自动同步呢,目前测试还是要手动点

要确保打开自动同步,并且正常同步一次。这样就能自动同步了。

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


![WeChat screenshot_20240818162550](https://private-user-images.githubusercontent.com/46487353/358893367-53648692-03ba-4f83-af6a-499c275ba803.png?jwt=eyJhbGciOiJIUzI1NiIsInR5 cCI6IkpXVCJ9..PmQ8kwgPkFg1nc96JtZDr26pxjfi8ao3QvX031glZOM) every time you send a message , and create and delete sessions, it seems that there is still no automatic synchronization. Currently, the test still needs to be done manually.

Make sure to turn on auto-sync and sync normally. This will automatically synchronize.

@ft4710403
Copy link

那应该是没开自动同步,找了半天没找到自动同步的开关,首次同步成功了,自动同步开关在哪呢~

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


It should be that automatic synchronization is not turned on. I searched for a long time and couldn't find the automatic synchronization switch. The first synchronization was successful. Where is the automatic synchronization switch?

@ahzmr
Copy link
Contributor Author

ahzmr commented Aug 18, 2024

那应该是没开自动同步,找了半天没找到自动同步的开关,首次同步成功了,自动同步开关在哪呢~

我这个PR还没合并,要编译我的版本才行

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


It should be that automatic synchronization is not turned on. I searched for a long time and couldn't find the automatic synchronization switch. The first synchronization was successful. Where is the automatic synchronization switch~

My PR has not been merged yet, so I need to compile my version.

@ft4710403
Copy link

那应该是没开自动同步,找了半天没找到自动同步的开关,第一次同步成功了,自动同步开关在哪呢~

我这个PR还没有合并,要编译我的版本才行

是的,我就是在 https://github.com/ahzmr/ChatGPT-Next-Web/releases/tag/v2.14.0.1

这里下载你的版本,然后编译镜像,再运行的。

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


It should be that automatic synchronization is not turned on. I searched for a long time and couldn't find the automatic synchronization switch. The first synchronization was successful. Where is the automatic synchronization switch~

My PR has not been merged yet, so I need to compile my version.

Yes, I am at https://github.com/ahzmr/ChatGPT-Next-Web/releases/tag/v2.14.0.1

Download your version here, then compile the image, and then run it.

@ft4710403
Copy link

机器人检测到问题主体的语言不是英语,自动翻译。

应该是没有打开自动同步,找了好久都没找到自动同步开关,第一次同步成功了,自动同步开关在哪呢~

我的 PR 还没有合并,所以我需要编译我的版本。

大佬,我是编译你的版本,就是没找到开关~~

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


The robot detects that the language of the subject of the question is not English and automatically translates it.

It should be that the automatic synchronization is not turned on. I have been looking for a long time but cannot find the automatic synchronization switch. The first synchronization is successful. Where is the automatic synchronization switch?

My PR hasn't been merged yet, so I need to compile my version.

Boss, I compiled your version, but I couldn’t find the switch~~

@ahzmr
Copy link
Contributor Author

ahzmr commented Aug 18, 2024

机器人检测到问题主体的语言不是英语,自动翻译。

应该是没有打开自动同步,找了好久都没找到自动同步开关,第一次同步成功了,自动同步开关在哪呢~

我的 PR 还没有合并,所以我需要编译我的版本。

大佬,我是编译你的版本,就是没找到开关~~

这个标签也没带,你用website分支,里面有我说的功能。

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


The robot detects that the language of the subject of the question is not English and automatically translates it.

It should be that automatic synchronization is not turned on. I have been looking for a long time but cannot find the automatic synchronization switch. The first synchronization is successful. Where is the automatic synchronization switch?

My PR hasn't been merged yet, so I need to compile my version.

Boss, I compiled your version, but I couldn’t find the switch~~

This tag is not included. You use the website branch, which has the functions I mentioned.

@ft4710403
Copy link

机器人检测到问题主体的语言不是英语,自动翻译。

应该是没有打开自动同步,找了好久都没找到自动同步开关,第一次同步成功了,自动同步开关在哪呢~

我的 PR 还没有合并,所以我需要编译我的版本。

大佬,我是编译你的版本,就是没找到开关~~

这个标签也没带,你用website分支,里面有我说的功能。

我换成了:
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web/tree/website
这里面的
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web/archive/refs/heads/website.zip
重新编译,还是没有自动同步,还是只能手动同步。。。

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


The robot detects that the language of the subject of the question is not English and automatically translates it.

It should be that automatic synchronization is not turned on. I have been looking for a long time but cannot find the automatic synchronization switch. The first synchronization was successful. Where is the automatic synchronization switch?

My PR hasn't been merged yet, so I need to compile my version.

Boss, I compiled your version, but I couldn’t find the switch~~

This tag is not included. You use the website branch, which has the functions I mentioned.

I changed it to:
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web/tree/website
inside here
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web/archive/refs/heads/website.zip
After recompiling, there is still no automatic synchronization, or manual synchronization is still possible. . .

@ahzmr
Copy link
Contributor Author

ahzmr commented Aug 18, 2024

机器人检测到问题主体的语言不是英语,自动翻译。

应该是没有打开自动同步,找了好久都没找到自动同步开关,第一次同步成功了,自动同步开关在哪呢~

我的 PR 还没有合并,所以我需要编译我的版本。

大佬,我是编译你的版本,就是没找到开关~~

这个标签也没带,你用website分支,里面有我说的功能。

我换成了: https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web/tree/website 这里面的 https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web/archive/refs/heads/website.zip 重新编译,还是没有自动同步,还是只能手动同步。。。

好吧。我抽空直接编译镜像到dockerhub上,这样更省事~

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


The robot detects that the language of the subject of the question is not English and automatically translates it.

It should be that the automatic synchronization is not turned on. I have been looking for a long time but cannot find the automatic synchronization switch. The first synchronization was successful. Where is the automatic synchronization switch?

My PR hasn't been merged yet, so I need to compile my version.

Boss, I compiled your version, but I couldn’t find the switch~~

This tag is not included. You use the website branch, which has the functions I mentioned.

I changed to: https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web/tree/website https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web/archive/refs/heads/ Website.zip is recompiled, but there is still no automatic synchronization, and it still can only be synchronized manually. . .

All right. I took the time to compile the image directly to dockerhub, which is easier~

@ft4710403
Copy link

机器人检测到问题主体的语言不是英语,自动翻译。

应该是没有打开自动同步,找了好久都没找到自动同步开关,第一次同步成功了,自动同步开关在哪呢~

我的 PR 还没有合并,所以我需要编译我的版本。

大佬,我是编译你的版本,就是没找到开关~~

这个标签也没带,你用website分支,里面有我说的功能。

我换成了: https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web/tree/website 这里面的 https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web/archive/refs/heads/website.zip 重新编译,还是没有自动同步,还是只能手动同步。。。

好吧。我抽空直接编译镜像到dockerhub上,这样更省事~

辛苦大佬,编译上传了了回复一下镜像名称,期待ing
(╭☞•́⍛•̀)╭☞

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


The robot detects that the language of the subject of the question is not English and automatically translates it.

It should be that the automatic synchronization is not turned on. I have been looking for a long time but cannot find the automatic synchronization switch. The first synchronization is successful. Where is the automatic synchronization switch?

My PR hasn't been merged yet, so I need to compile my version.

Boss, I compiled your version, but I couldn’t find the switch~~

This tag is not included. You use the website branch, which has the functions I mentioned.

I changed to: https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web/tree/website https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web/archive/refs/heads /website.zip Recompile, still no automatic synchronization, still can only be synchronized manually. . .

Okay. I took the time to compile the image directly to dockerhub, which is easier~

Thank you for your hard work, I compiled and uploaded it and replied with the image name. Looking forward to it.
(╭☞•́⍛•̀)╭☞

@ft4710403
Copy link

机器人检测到问题主体的语言不是英语,自动翻译。

应该是没有打开自动同步,找了好久都没找到自动同步开关,第一次同步成功了,自动同步开关在哪呢~

我的 PR 还没有合并,所以我需要编译我的版本。

大佬,我是编译你的版本,就是没找到开关~~

这个标签也没带,你用website分支,里面有我说的功能。

我换成了: https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web/tree/website 这里面的 https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web/archive/refs/heads/website.zip 重新编译,还是没有自动同步,还是只能手动同步。。。

好吧。我抽空直接编译镜像到dockerhub上,这样更省事~

另外问一下,同步服务器信息可以做在docker创建参数吗,编译的时候可以改文件实现,编译以后就不知道改哪了...

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


The robot detects that the language of the subject of the question is not English and automatically translates it.

It should be that the automatic synchronization is not turned on. I have been looking for a long time but cannot find the automatic synchronization switch. The first synchronization is successful. Where is the automatic synchronization switch?

My PR hasn't been merged yet, so I need to compile my version.

Boss, I compiled your version, but I couldn’t find the switch~~

This tag is not included. You use the website branch, which has the functions I mentioned.

I changed to: https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web/tree/website https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web/archive/refs/heads /website.zip Recompile, still no automatic synchronization, still only manual synchronization. . .

Okay. I took the time to compile the image directly to dockerhub, which is easier~

Also, I would like to ask, can synchronizing server information be done in docker creation parameters? The file can be changed during compilation, but I don’t know where to change it after compilation...

@ahzmr
Copy link
Contributor Author

ahzmr commented Aug 18, 2024

机器人检测到问题主体的语言不是英语,自动翻译。

应该是没有打开自动同步,找了好久都没找到自动同步开关,第一次同步成功了,自动同步开关在哪呢~

我的 PR 还没有合并,所以我需要编译我的版本。

大佬,我是编译你的版本,就是没找到开关~~

这个标签也没带,你用website分支,里面有我说的功能。

我换成了: https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web/tree/website 这里面的 https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web/archive/refs/heads/website.zip 重新编译,还是没有自动同步,还是只能手动同步。。。

好吧。我抽空直接编译镜像到dockerhub上,这样更省事~

辛苦大佬,编译上传了了回复一下镜像名称,期待ing (╭☞•́⍛•̀)╭☞

用这个镜像:ahzmr/chatgpt-next-web
这个镜像解决webdav配置的一些bug,以及支持自动同步消息,并且支持同步删除消息与会话。
CleanShot 2024-08-18 at 19 26 08@2x

@ahzmr
Copy link
Contributor Author

ahzmr commented Aug 18, 2024

机器人检测到问题主体的语言不是英语,自动翻译。

应该是没有打开自动同步,找了好久都没找到自动同步开关,第一次同步成功了,自动同步开关在哪呢~

我的 PR 还没有合并,所以我需要编译我的版本。

大佬,我是编译你的版本,就是没找到开关~~

这个标签也没带,你用website分支,里面有我说的功能。

我换成了: https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web/tree/website 这里面的 https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web/archive/refs/heads/website.zip 重新编译,还是没有自动同步,还是只能手动同步。。。

好吧。我抽空直接编译镜像到dockerhub上,这样更省事~

另外问一下,同步服务器信息可以做在docker创建参数吗,编译的时候可以改文件实现,编译以后就不知道改哪了...

这个可以做到,但不建议这么做。这个服务要讲,不是为一个人服务的;而webdav的地址也不是统一的。你添加一个默认值,这个不通用。我不会这么做,原作者估计也不会这么做的。

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


The robot detects that the language of the subject of the question is not English and automatically translates it.

It should be that the automatic synchronization is not turned on. I have been looking for a long time but cannot find the automatic synchronization switch. The first synchronization was successful. Where is the automatic synchronization switch?

My PR hasn't been merged yet, so I need to compile my version.

Boss, I compiled your version, but I couldn’t find the switch~~

This tag is not included. You use the website branch, which has the functions I mentioned.

I changed to: https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web/tree/website Here is https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web/archive/refs/ After recompiling heads/website.zip, there is still no automatic synchronization, or manual synchronization is still possible. . .

Okay. I took the time to compile the image directly to dockerhub, which is easier~

Also ask, can synchronizing server information be done in docker creation parameters? The file can be changed during compilation. I don’t know where to change it after compilation...

This can be done, but it is not recommended. It should be noted that this service is not for one person; and the address of webdav is not unified. You add a default value, which is not universal. I wouldn't do it, and the original author probably wouldn't do it either.

@ft4710403
Copy link

我不太懂开发,可以告诉我进容器可以该哪个文件实现吗,我自己改,只知道编译前,修改:sync.ts可以实现,,,

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


I don’t know much about development. Can you tell me which file can be used to implement it in the container? I will change it myself. I only know that before compilation, it can be implemented by modifying: sync.ts.

@ft4710403
Copy link

大佬,现在同步是没问题了,但是只有提交,没有读取,能否让网页每次加载的时候,也进行一下同步呢,主要同步一下别的终端发生的记录或者新增的面具。

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Sir, there is no problem with synchronization now, but there is only submission and no reading. Can you synchronize the web page every time it is loaded? Mainly synchronize the records generated by other terminals or the newly added masks.

@ahzmr
Copy link
Contributor Author

ahzmr commented Aug 18, 2024

大佬,现在同步是没问题了,但是只有提交,没有读取,能否让网页每次加载的时候,也进行一下同步呢,主要同步一下别的终端发生的记录或者新增的面具。

可以这样做,只是这样会有很多无效同步。对于我来讲,当我知道其他端有新内容时,而我又需要时,我会主动同步一下。对于其他端不重要更新时,我直播问答,那些记录也会过来。所以,我自己不是很想加这样的功能。现在同步基本是数据全量同步,数据量会越来越大,能减少些无效同步就减少一些。

现在的实现,的确会有一个bug,就是当前会话其他端有更新,我问过之后,会导致页面滚动位置不对,需要手调。由于我对这个项目不熟,这个bug现在还没解决。这个回头我有空时,也解决这个问题,并支持一下会话按最新更新时间倒序排序,这样多端更统一一些。

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Boss, there is no problem with synchronization now, but it is only submitted and not read. Can you synchronize it every time the web page is loaded? Mainly synchronize the records generated by other terminals or the newly added masks.

You can do this, but there will be a lot of invalid synchronization. For me, when I know there is new content on the other end and I need it, I will take the initiative to synchronize it. When there are no important updates to other terminals, I will live stream Q&A, and those records will also come over. Therefore, I don't really want to add such a function. Now the synchronization is basically the synchronization of the entire data. The amount of data will become larger and larger, and the amount of invalid synchronization can be reduced as much as possible.

There is indeed a bug in the current implementation, that is, there is an update on the other end of the current session. After I asked, the scroll position of the page will be wrong and it needs to be manually adjusted. Since I am not familiar with this project, this bug has not been resolved yet. When I have time, I will also solve this problem and support sorting sessions in reverse order of latest update time, so that the multiple terminals are more unified.

@coderabbitai coderabbitai bot mentioned this pull request Oct 8, 2024
10 tasks
@DanielDu87
Copy link

请问下你这个版本在哪下载,怎么部署

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


May I ask where you downloaded this version and how to deploy it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants