@lobehub/chat 1.3.1 → 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +50 -0
- package/docs/self-hosting/advanced/webrtc.mdx +80 -0
- package/docs/self-hosting/advanced/webrtc.zh-CN.mdx +87 -0
- package/docs/usage/tools-calling/groq.zh-CN.mdx +12 -6
- package/locales/ar/setting.json +7 -2
- package/locales/bg-BG/setting.json +7 -2
- package/locales/de-DE/setting.json +7 -2
- package/locales/en-US/setting.json +7 -2
- package/locales/es-ES/setting.json +7 -2
- package/locales/fr-FR/setting.json +7 -2
- package/locales/it-IT/setting.json +7 -2
- package/locales/ja-JP/setting.json +7 -2
- package/locales/ko-KR/setting.json +7 -2
- package/locales/nl-NL/setting.json +7 -2
- package/locales/pl-PL/setting.json +7 -2
- package/locales/pt-BR/setting.json +7 -2
- package/locales/ru-RU/setting.json +7 -2
- package/locales/tr-TR/setting.json +7 -2
- package/locales/vi-VN/setting.json +11 -2
- package/locales/zh-CN/setting.json +7 -2
- package/locales/zh-TW/setting.json +7 -2
- package/package.json +3 -3
- package/src/app/(main)/settings/common/features/Theme/index.tsx +9 -2
- package/src/app/(main)/settings/sync/features/Alert.tsx +17 -3
- package/src/app/(main)/settings/sync/features/WebRTC/index.tsx +15 -8
- package/src/const/url.ts +1 -0
- package/src/database/client/core/sync.ts +1 -8
- package/src/locales/default/setting.ts +7 -3
- package/src/store/user/slices/sync/action.ts +1 -1
- package/src/types/sync.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,56 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog
|
|
4
4
|
|
|
5
|
+
### [Version 1.3.3](https://github.com/lobehub/lobe-chat/compare/v1.3.2...v1.3.3)
|
|
6
|
+
|
|
7
|
+
<sup>Released on **2024-07-09**</sup>
|
|
8
|
+
|
|
9
|
+
#### 🐛 Bug Fixes
|
|
10
|
+
|
|
11
|
+
- **misc**: Allow user to use their own WebRTC signaling.
|
|
12
|
+
|
|
13
|
+
<br/>
|
|
14
|
+
|
|
15
|
+
<details>
|
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
17
|
+
|
|
18
|
+
#### What's fixed
|
|
19
|
+
|
|
20
|
+
- **misc**: Allow user to use their own WebRTC signaling, closes [#3182](https://github.com/lobehub/lobe-chat/issues/3182) ([c7f8f38](https://github.com/lobehub/lobe-chat/commit/c7f8f38))
|
|
21
|
+
|
|
22
|
+
</details>
|
|
23
|
+
|
|
24
|
+
<div align="right">
|
|
25
|
+
|
|
26
|
+
[](#readme-top)
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
### [Version 1.3.2](https://github.com/lobehub/lobe-chat/compare/v1.3.1...v1.3.2)
|
|
31
|
+
|
|
32
|
+
<sup>Released on **2024-07-09**</sup>
|
|
33
|
+
|
|
34
|
+
#### 🐛 Bug Fixes
|
|
35
|
+
|
|
36
|
+
- **misc**: Automatic refresh when change language.
|
|
37
|
+
|
|
38
|
+
<br/>
|
|
39
|
+
|
|
40
|
+
<details>
|
|
41
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
42
|
+
|
|
43
|
+
#### What's fixed
|
|
44
|
+
|
|
45
|
+
- **misc**: Automatic refresh when change language, closes [#3181](https://github.com/lobehub/lobe-chat/issues/3181) ([b597c5a](https://github.com/lobehub/lobe-chat/commit/b597c5a))
|
|
46
|
+
|
|
47
|
+
</details>
|
|
48
|
+
|
|
49
|
+
<div align="right">
|
|
50
|
+
|
|
51
|
+
[](#readme-top)
|
|
52
|
+
|
|
53
|
+
</div>
|
|
54
|
+
|
|
5
55
|
### [Version 1.3.1](https://github.com/lobehub/lobe-chat/compare/v1.3.0...v1.3.1)
|
|
6
56
|
|
|
7
57
|
<sup>Released on **2024-07-09**</sup>
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# LobeChat WebRTC Sync
|
|
2
|
+
|
|
3
|
+
## Introduction to WebRTC
|
|
4
|
+
|
|
5
|
+
WebRTC (Web Real-Time Communication) is a technology that enables peer-to-peer communication between browsers. In LobeChat, we experimentally implemented real-time data synchronization between devices based on WebRTC and YJS, without relying on traditional server databases. This solution offers high privacy, zero conflicts, and provides a real-time session synchronization experience.
|
|
6
|
+
|
|
7
|
+
## Configuring WebRTC for Synchronization
|
|
8
|
+
|
|
9
|
+
To use the WebRTC synchronization feature in LobeChat, you need to complete the following steps:
|
|
10
|
+
|
|
11
|
+
<Steps>
|
|
12
|
+
|
|
13
|
+
### Deploy Signaling Server
|
|
14
|
+
|
|
15
|
+
Deploy a WebRTC signaling server with one click using the Zeabur platform:
|
|
16
|
+
|
|
17
|
+
[](https://zeabur.com/templates/MY0JZG?referralCode=arvinxx)
|
|
18
|
+
|
|
19
|
+
Alternatively, you can view the [source code](https://github.com/lobehub/y-webrtc-signaling) and deploy it on your own.
|
|
20
|
+
|
|
21
|
+
After deployment, you will receive a URL, for example: `https://my-signaling-server.zeabur.app`.
|
|
22
|
+
|
|
23
|
+
### Enable WebRTC Sync in the Deployment Instance
|
|
24
|
+
|
|
25
|
+
The WebRTC sync feature in LobeChat is hidden by default and needs to be enabled by adding the environment variable `FEATURE_FLAGS=+webrtc_sync`.
|
|
26
|
+
|
|
27
|
+
### Configure WebRTC Sync Settings in LobeChat
|
|
28
|
+
|
|
29
|
+
1. Open LobeChat settings -> Data Sync
|
|
30
|
+
2. Enter the signaling server address in the WebRTC sync section;
|
|
31
|
+
3. Set the sync channel name and password
|
|
32
|
+
|
|
33
|
+
<Image
|
|
34
|
+
alt={'LobeChat Data Sync Settings Page'}
|
|
35
|
+
height={356}
|
|
36
|
+
inStep
|
|
37
|
+
src={'https://github.com/lobehub/lobe-chat/assets/28616219/bf86bf1e-87fb-4015-8587-15ff28bb9c24'}
|
|
38
|
+
/>
|
|
39
|
+
|
|
40
|
+
### Repeat the Above Configuration on Devices that Need to Sync
|
|
41
|
+
|
|
42
|
+
Ensure all devices use the same signaling server, channel name, and password. Once configured, the devices should automatically start syncing data.
|
|
43
|
+
|
|
44
|
+
</Steps>
|
|
45
|
+
|
|
46
|
+
## Limitations and Known Issues
|
|
47
|
+
|
|
48
|
+
Although WebRTC has the advantages of no database and flexibility, after extensive community testing, the following limitations and known issues have been identified:
|
|
49
|
+
|
|
50
|
+
### Requirement for Devices to be Online Simultaneously
|
|
51
|
+
|
|
52
|
+
WebRTC requires devices to be online simultaneously to synchronize, meaning changes cannot be made on one device while offline and then synced later on another device.
|
|
53
|
+
|
|
54
|
+
This limitation is due to the communication nature of WebRTC. In a pure frontend, serverless scenario, data synchronization between two devices can only be achieved through peer-to-peer communication. When one device is online and the other is offline, it is impossible to determine where the data should come from. Only when both devices are online can data communication occur. This mode is more like an online chat room where everyone needs to be online to see each other's data and achieve synchronization.
|
|
55
|
+
|
|
56
|
+
Therefore, in certain situations, WebRTC's pure peer-to-peer approach may not fully meet users' needs (e.g., one device is a work computer, and the other is a home computer), and there are also some issues with data synchronization.
|
|
57
|
+
|
|
58
|
+
### Network Issues Leading to Sync Failures
|
|
59
|
+
|
|
60
|
+
Due to the implementation mechanism of WebRTC, its peer-to-peer communication has strict network requirements. Many of our users have reported:
|
|
61
|
+
|
|
62
|
+
- Syncing between PCs is possible, but syncing between a mobile device with a SIM card and a PC is not, although syncing is possible when using the same WIFI as the PC;
|
|
63
|
+
- Syncing fails when switching networks.
|
|
64
|
+
|
|
65
|
+
### Stability and Performance Issues
|
|
66
|
+
|
|
67
|
+
- Some users have reported ICE connection failures on the Firefox browser: [WebRTC Data Sync Feedback](https://github.com/lobehub/lobe-chat/issues/1683#issuecomment-2094745907)
|
|
68
|
+
- For extremely long text or large amounts of conversation records, the synchronization process may slow down or become unstable: [When the model outputs a very long conversation, the end of the conversation will contain synchronization-related content tags, leading to sync failures](https://github.com/lobehub/lobe-chat/issues/1962)
|
|
69
|
+
|
|
70
|
+
## Our Recommendations
|
|
71
|
+
|
|
72
|
+
Considering the above reasons, we recommend users treat the WebRTC sync feature as experimental and regularly back up important data.
|
|
73
|
+
|
|
74
|
+
We have already released a more stable and user-friendly server database synchronization solution ([deployment guide](/docs/self-hosting/advanced/server-database)). We recommend users prioritize using the server database synchronization solution.
|
|
75
|
+
|
|
76
|
+
<Callout type={'warning'}>
|
|
77
|
+
Please note that we have officially announced the archiving of this sync feature in [PR
|
|
78
|
+
3182](https://github.com/lobehub/lobe-chat/pull/3182), and the above issues will no longer be
|
|
79
|
+
considered for fixes.
|
|
80
|
+
</Callout>
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: LobeChat WebRTC 同步配置指南
|
|
3
|
+
description: 在 LobeChat 中实现基于 WebRTC 和 YJS 的设备间实时数据同步。了解如何配置 WebRTC 并开启同步功能,以及使用局限性和已知问题。
|
|
4
|
+
tags:
|
|
5
|
+
- YJS
|
|
6
|
+
- 信令服务器
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# LobeChat WebRTC 同步
|
|
10
|
+
|
|
11
|
+
## WebRTC 简介
|
|
12
|
+
|
|
13
|
+
WebRTC (Web Real-Time Communication) 是一项实现浏览器之间点对点通信的技术。在 LobeChat 中,我们实验性地基于 WebRTC 和 YJS 实现了设备间的实时数据同步,无需依赖传统的服务器数据库。这种方案具有高度隐私性、零冲突性,并能提供实时会话同步体验。
|
|
14
|
+
|
|
15
|
+
## 配置 WebRTC 并实现同步
|
|
16
|
+
|
|
17
|
+
要使用 LobeChat 的 WebRTC 同步功能,需要完成以下步骤:
|
|
18
|
+
|
|
19
|
+
<Steps>
|
|
20
|
+
|
|
21
|
+
### 部署信令服务器
|
|
22
|
+
|
|
23
|
+
使用 Zeabur 平台一键部署 WebRTC 信令服务器:
|
|
24
|
+
|
|
25
|
+
[](https://zeabur.com/templates/MY0JZG?referralCode=arvinxx)
|
|
26
|
+
|
|
27
|
+
或者查看 [源码](https://github.com/lobehub/y-webrtc-signaling) 自行部署。
|
|
28
|
+
|
|
29
|
+
部署完成后,可以得到一个 URL,例如:`https://my-signaling-server.zeabur.app`。
|
|
30
|
+
|
|
31
|
+
### 在部署实例中开启 WebRTC 同步
|
|
32
|
+
|
|
33
|
+
LobeChat 默认隐藏了 WebRTC 同步功能,需要通过添加环境变量 `FEATURE_FLAGS=+webrtc_sync` 来开启 WebRTC 同步特性。
|
|
34
|
+
|
|
35
|
+
### 配置 LobeChat 的 WebRTC 同步设置
|
|
36
|
+
|
|
37
|
+
1. 打开 LobeChat 设置 -> 数据同步
|
|
38
|
+
2. 在 WebRTC 同步中填写信令服务器地址;
|
|
39
|
+
3. 设置同步频道名称和密码
|
|
40
|
+
|
|
41
|
+
<Image
|
|
42
|
+
alt={'LobeChat 数据同步设置页'}
|
|
43
|
+
height={356}
|
|
44
|
+
inStep
|
|
45
|
+
src={'https://github.com/lobehub/lobe-chat/assets/28616219/bf86bf1e-87fb-4015-8587-15ff28bb9c24'}
|
|
46
|
+
/>
|
|
47
|
+
|
|
48
|
+
### 在需要同步的设备上重复以上配置
|
|
49
|
+
|
|
50
|
+
确保所有设备使用相同的信令服务器、频道名称和密码,完成配置后,设备间应该可以开始自动同步数据。
|
|
51
|
+
|
|
52
|
+
</Steps>
|
|
53
|
+
|
|
54
|
+
## 使用局限性和已知问题
|
|
55
|
+
|
|
56
|
+
虽然 WebRTC 具有无数据库、比较灵活的特性,但目前该功能经过大范围社区测试,存在以下局限性和已知问题:
|
|
57
|
+
|
|
58
|
+
### 设备同时在线要求
|
|
59
|
+
|
|
60
|
+
WebRTC 要求设备同时在线才能进行同步,这意味着无法在一台设备离线时在另一台设备上进行更改并稍后同步。
|
|
61
|
+
|
|
62
|
+
这是 WebRTC 本身的通信特性有关系,由于在纯前端、无服务端的情况下,两个设备的数据同步只能通过点对点通信的形式达成。当一个设备在线,一个设备离线的情况下,我们无从感知数据到底应该从哪来,只有当两台设备都在线的时候,双发数据才能通信。其实这种模式更像是一个在线聊天室,大家都在线时才能看到对方的数据,然后达成同步。
|
|
63
|
+
|
|
64
|
+
因此 WebRTC 这种纯点对点的方式在某些情况下并无法完全满足用户的诉求(例如一个是公司电脑,一个是家里电脑),同时也存在一些数据同步层面的问题。
|
|
65
|
+
|
|
66
|
+
### 网络问题可能导致同步失败
|
|
67
|
+
|
|
68
|
+
由于 WebRTC 的实现机制,其点对点通信对于网络要求非常苛刻,我们的很多用户反馈:
|
|
69
|
+
|
|
70
|
+
- 在 PC 上可以互相同步、 手机 sim 卡无法和 PC 同步、但是换成和PC一样的WIFI可以和 PC 同步;
|
|
71
|
+
- 任何切换网络都无法同步;
|
|
72
|
+
|
|
73
|
+
### 稳定性与性能问题
|
|
74
|
+
|
|
75
|
+
- 部分用户报告在 Firefox 浏览器上遇到 ICE 连接失败的问题:[WebRTC Data Sync Feedback](https://github.com/lobehub/lobe-chat/issues/1683#issuecomment-2094745907)
|
|
76
|
+
- 对于超长文本或大量对话记录,同步过程可能变慢或不稳定:[当模型输出超长对话时,对话末尾会出现同步相关的内容标签,导致同步失败](https://github.com/lobehub/lobe-chat/issues/1962)
|
|
77
|
+
|
|
78
|
+
## 我们的建议
|
|
79
|
+
|
|
80
|
+
鉴于以上原因,我们建议用户将 WebRTC 同步功能视为实验性功能,并定期备份重要数据。
|
|
81
|
+
|
|
82
|
+
目前我们已经发布了更稳定、更用户友好的服务端数据库同步方案([部署指南](/zh/docs/self-hosting/advanced/server-database)),我们建议用户优先考虑使用服务端数据库同步方案。
|
|
83
|
+
|
|
84
|
+
<Callout type={'warning'}>
|
|
85
|
+
请注意,我们已经在 [PR 3182](https://github.com/lobehub/lobe-chat/pull/3182)
|
|
86
|
+
中正式宣布归档该同步特性,上述问题将不再考虑进行修复。
|
|
87
|
+
</Callout>
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: Groq
|
|
2
|
+
title: Groq Tools Calling
|
|
3
|
+
description: >-
|
|
4
|
+
了解 Groq 平台模型 Tools Calling的能力一览,包括LLAMA3 70B、LLAMA3
|
|
5
|
+
8B和Mixtral-8x7B的简单和复杂指令调用情况。
|
|
6
|
+
tags:
|
|
7
|
+
- Groq 平台模型
|
|
8
|
+
- Tools Calling
|
|
9
|
+
- LLAMA3 70B
|
|
10
|
+
- LLAMA3 8B
|
|
11
|
+
- Mixtral-8x7B
|
|
3
12
|
---
|
|
4
13
|
|
|
5
14
|
# Groq 平台模型 Tools Calling 评测(Llama 3/Mistral)
|
|
6
15
|
|
|
7
|
-
<Callout type={'info'}>
|
|
8
|
-
由于 Groq 本身不支持 stream,因此 Tools Calling 的调用是普通请求。
|
|
9
|
-
</Callout>
|
|
16
|
+
<Callout type={'info'}>由于 Groq 本身不支持 stream,因此 Tools Calling 的调用是普通请求。</Callout>
|
|
10
17
|
|
|
11
18
|
Groq 平台的模型 Tools Calling 能力一览:
|
|
12
19
|
|
|
@@ -16,7 +23,6 @@ Groq 平台的模型 Tools Calling 能力一览:
|
|
|
16
23
|
| LLAMA3 8B | ✅ | ❌ | ✅ | 🌟🌟 | 🌟 |
|
|
17
24
|
| Mixtral-8x7B | ✅ | ❌ | ✅ | ⛔ | 🌟🌟 |
|
|
18
25
|
|
|
19
|
-
|
|
20
26
|
## LLAMA3 70B
|
|
21
27
|
|
|
22
28
|
### 简单调用指令:天气查询
|
|
@@ -120,7 +126,7 @@ LLAMA3 8B 在 DallE 的输出场景下,只会输出 1 张图片,而不是像
|
|
|
120
126
|
POST /api/chat/groq 200 in 2517ms
|
|
121
127
|
```
|
|
122
128
|
|
|
123
|
-
|
|
129
|
+
</details>
|
|
124
130
|
|
|
125
131
|
## Mixtral-8x7B
|
|
126
132
|
|
package/locales/ar/setting.json
CHANGED
|
@@ -345,7 +345,7 @@
|
|
|
345
345
|
"unknownOS": "نظام التشغيل غير معروف"
|
|
346
346
|
},
|
|
347
347
|
"warning": {
|
|
348
|
-
"
|
|
348
|
+
"tip": "بعد فترة اختبار عامة طويلة، قد لا يكون تزامن WebRTC مستقرًا بما يكفي لتلبية احتياجات التزامن العامة. يرجى <1>نشر خادم الإشارة</1> بنفسك قبل الاستخدام."
|
|
349
349
|
},
|
|
350
350
|
"webrtc": {
|
|
351
351
|
"channelName": {
|
|
@@ -361,9 +361,14 @@
|
|
|
361
361
|
},
|
|
362
362
|
"desc": "اتصال البيانات النقطي الفوري يتطلب تواجد الأجهزة معًا للمزامنة",
|
|
363
363
|
"enabled": {
|
|
364
|
-
"invalid": "الرجاء
|
|
364
|
+
"invalid": "الرجاء ملء اسم خادم الإشارة واسم القناة المتزامنة قبل تمكينها",
|
|
365
365
|
"title": "تمكين المزامنة"
|
|
366
366
|
},
|
|
367
|
+
"signaling": {
|
|
368
|
+
"desc": "سيستخدم WebRTC هذا العنوان للتزامن",
|
|
369
|
+
"placeholder": "الرجاء إدخال عنوان خادم الإشارة",
|
|
370
|
+
"title": "خادم الإشارة"
|
|
371
|
+
},
|
|
367
372
|
"title": "WebRTC مزامنة"
|
|
368
373
|
}
|
|
369
374
|
},
|
|
@@ -345,7 +345,7 @@
|
|
|
345
345
|
"unknownOS": "Неизвестна операционна система"
|
|
346
346
|
},
|
|
347
347
|
"warning": {
|
|
348
|
-
"
|
|
348
|
+
"tip": "След дълъг период на обществено тестване, синхронизацията на WebRTC може да не бъде стабилна за общите изисквания за синхронизация на данни. Моля, <1>инсталирайте сигналния сървър</1> и го използвайте след това."
|
|
349
349
|
},
|
|
350
350
|
"webrtc": {
|
|
351
351
|
"channelName": {
|
|
@@ -361,9 +361,14 @@
|
|
|
361
361
|
},
|
|
362
362
|
"desc": "Комуникацията на данни в реално време между партньори изисква всички устройства да бъдат онлайн за синхронизиране.",
|
|
363
363
|
"enabled": {
|
|
364
|
-
"invalid": "Моля,
|
|
364
|
+
"invalid": "Моля, попълнете адреса на сигналния сървър и името на синхронизиращия канал, преди да го активирате.",
|
|
365
365
|
"title": "Активиране на синхронизиране"
|
|
366
366
|
},
|
|
367
|
+
"signaling": {
|
|
368
|
+
"desc": "WebRTC ще използва този адрес за синхронизация",
|
|
369
|
+
"placeholder": "Моля, въведете адреса на сигналния сървър",
|
|
370
|
+
"title": "Сигнален сървър"
|
|
371
|
+
},
|
|
367
372
|
"title": "WebRTC синхронизиране"
|
|
368
373
|
}
|
|
369
374
|
},
|
|
@@ -345,7 +345,7 @@
|
|
|
345
345
|
"unknownOS": "Unbekanntes Betriebssystem"
|
|
346
346
|
},
|
|
347
347
|
"warning": {
|
|
348
|
-
"
|
|
348
|
+
"tip": "Nach einer längeren Phase des Community-Tests kann die WebRTC-Synchronisierung möglicherweise nicht stabil genug sein, um allgemeine Synchronisierungsanforderungen zu erfüllen. Bitte <1>richten Sie einen Signalisierungsserver ein</1> und verwenden Sie ihn dann."
|
|
349
349
|
},
|
|
350
350
|
"webrtc": {
|
|
351
351
|
"channelName": {
|
|
@@ -361,9 +361,14 @@
|
|
|
361
361
|
},
|
|
362
362
|
"desc": "Echtzeit, Punkt-zu-Punkt-Datenkommunikation, bei der die Geräte gleichzeitig online sein müssen, um synchronisiert zu werden",
|
|
363
363
|
"enabled": {
|
|
364
|
-
"invalid": "Bitte geben Sie zuerst den
|
|
364
|
+
"invalid": "Bitte geben Sie zuerst den Signalisierungsserver und den Synchronisierungskanal an, bevor Sie dies aktivieren.",
|
|
365
365
|
"title": "Synchronisierung aktivieren"
|
|
366
366
|
},
|
|
367
|
+
"signaling": {
|
|
368
|
+
"desc": "WebRTC wird diese Adresse für die Synchronisierung verwenden",
|
|
369
|
+
"placeholder": "Bitte geben Sie die Adresse des Signalisierungsservers ein",
|
|
370
|
+
"title": "Signalisierungsserver"
|
|
371
|
+
},
|
|
367
372
|
"title": "WebRTC-Synchronisierung"
|
|
368
373
|
}
|
|
369
374
|
},
|
|
@@ -345,7 +345,7 @@
|
|
|
345
345
|
"unknownOS": "Unknown OS"
|
|
346
346
|
},
|
|
347
347
|
"warning": {
|
|
348
|
-
"
|
|
348
|
+
"tip": "After a long period of community testing, WebRTC synchronization may not reliably meet general data synchronization needs. Please <1>deploy a signaling server</1> before use."
|
|
349
349
|
},
|
|
350
350
|
"webrtc": {
|
|
351
351
|
"channelName": {
|
|
@@ -361,9 +361,14 @@
|
|
|
361
361
|
},
|
|
362
362
|
"desc": "Real-time, peer-to-peer data communication requires all devices to be online for synchronization.",
|
|
363
363
|
"enabled": {
|
|
364
|
-
"invalid": "Please
|
|
364
|
+
"invalid": "Please fill in the signaling server and synchronization channel name before enabling.",
|
|
365
365
|
"title": "Enable Sync"
|
|
366
366
|
},
|
|
367
|
+
"signaling": {
|
|
368
|
+
"desc": "WebRTC will use this address for synchronization",
|
|
369
|
+
"placeholder": "Enter signaling server address",
|
|
370
|
+
"title": "Signaling Server"
|
|
371
|
+
},
|
|
367
372
|
"title": "WebRTC Sync"
|
|
368
373
|
}
|
|
369
374
|
},
|
|
@@ -345,7 +345,7 @@
|
|
|
345
345
|
"unknownOS": "Sistema operativo desconocido"
|
|
346
346
|
},
|
|
347
347
|
"warning": {
|
|
348
|
-
"
|
|
348
|
+
"tip": "Después de un largo período de pruebas comunitarias, la sincronización WebRTC puede no ser capaz de satisfacer de manera estable las demandas generales de sincronización de datos. Por favor, <1>implementa tu propio servidor de señalización</1> antes de usarlo."
|
|
349
349
|
},
|
|
350
350
|
"webrtc": {
|
|
351
351
|
"channelName": {
|
|
@@ -361,9 +361,14 @@
|
|
|
361
361
|
},
|
|
362
362
|
"desc": "Comunicación de datos en tiempo real y punto a punto. Los dispositivos deben estar en línea simultáneamente para sincronizarse",
|
|
363
363
|
"enabled": {
|
|
364
|
-
"invalid": "Por favor,
|
|
364
|
+
"invalid": "Por favor, completa la información del servidor de señalización y el nombre del canal de sincronización antes de habilitarlo",
|
|
365
365
|
"title": "Activar sincronización"
|
|
366
366
|
},
|
|
367
|
+
"signaling": {
|
|
368
|
+
"desc": "WebRTC utilizará esta dirección para la sincronización",
|
|
369
|
+
"placeholder": "Introduce la dirección del servidor de señalización",
|
|
370
|
+
"title": "Servidor de señalización"
|
|
371
|
+
},
|
|
367
372
|
"title": "Sincronización WebRTC"
|
|
368
373
|
}
|
|
369
374
|
},
|
|
@@ -345,7 +345,7 @@
|
|
|
345
345
|
"unknownOS": "Système d'exploitation inconnu"
|
|
346
346
|
},
|
|
347
347
|
"warning": {
|
|
348
|
-
"
|
|
348
|
+
"tip": "Après une longue période de test communautaire, la synchronisation WebRTC peut ne pas répondre de manière stable aux besoins généraux de synchronisation des données. Veuillez <1>déployer votre propre serveur de signalisation</1> avant utilisation."
|
|
349
349
|
},
|
|
350
350
|
"webrtc": {
|
|
351
351
|
"channelName": {
|
|
@@ -361,9 +361,14 @@
|
|
|
361
361
|
},
|
|
362
362
|
"desc": "Communication de données en temps réel et en pair-à-pair. Les appareils doivent être en ligne simultanément pour se synchroniser",
|
|
363
363
|
"enabled": {
|
|
364
|
-
"invalid": "Veuillez
|
|
364
|
+
"invalid": "Veuillez saisir l'adresse du serveur de signalisation et le nom du canal de synchronisation avant d'activer.",
|
|
365
365
|
"title": "Activer la synchronisation"
|
|
366
366
|
},
|
|
367
|
+
"signaling": {
|
|
368
|
+
"desc": "WebRTC utilisera cette adresse pour la synchronisation",
|
|
369
|
+
"placeholder": "Veuillez entrer l'adresse du serveur de signalisation",
|
|
370
|
+
"title": "Serveur de signalisation"
|
|
371
|
+
},
|
|
367
372
|
"title": "Synchronisation WebRTC"
|
|
368
373
|
}
|
|
369
374
|
},
|
|
@@ -345,7 +345,7 @@
|
|
|
345
345
|
"unknownOS": "Sistema operativo sconosciuto"
|
|
346
346
|
},
|
|
347
347
|
"warning": {
|
|
348
|
-
"
|
|
348
|
+
"tip": "Dopo un lungo periodo di test della comunità, la sincronizzazione WebRTC potrebbe non essere in grado di soddisfare in modo stabile le esigenze generali di sincronizzazione dei dati. Si prega di <1>configurare un server di segnalazione</1> prima di utilizzarlo."
|
|
349
349
|
},
|
|
350
350
|
"webrtc": {
|
|
351
351
|
"channelName": {
|
|
@@ -361,9 +361,14 @@
|
|
|
361
361
|
},
|
|
362
362
|
"desc": "Comunicazione dati in tempo reale punto a punto, entrambi i dispositivi devono essere online per sincronizzarsi",
|
|
363
363
|
"enabled": {
|
|
364
|
-
"invalid": "
|
|
364
|
+
"invalid": "Si prega di inserire l'indirizzo del server di segnalazione e il nome del canale di sincronizzazione prima di abilitare.",
|
|
365
365
|
"title": "Abilita la sincronizzazione"
|
|
366
366
|
},
|
|
367
|
+
"signaling": {
|
|
368
|
+
"desc": "WebRTC utilizzerà questo indirizzo per la sincronizzazione",
|
|
369
|
+
"placeholder": "Inserisci l'indirizzo del server di segnalazione",
|
|
370
|
+
"title": "Server di segnalazione"
|
|
371
|
+
},
|
|
367
372
|
"title": "Sincronizzazione WebRTC"
|
|
368
373
|
}
|
|
369
374
|
},
|
|
@@ -345,7 +345,7 @@
|
|
|
345
345
|
"unknownOS": "不明なOS"
|
|
346
346
|
},
|
|
347
347
|
"warning": {
|
|
348
|
-
"
|
|
348
|
+
"tip": "コミュニティの長期にわたる公開テストの結果、WebRTC 同期は一般的なデータ同期要求を安定して満たすことができない可能性があります。 <1>シグナリングサーバーをデプロイ</1> してからご使用ください。"
|
|
349
349
|
},
|
|
350
350
|
"webrtc": {
|
|
351
351
|
"channelName": {
|
|
@@ -361,9 +361,14 @@
|
|
|
361
361
|
},
|
|
362
362
|
"desc": "リアルタイムでピアツーピアのデータ通信を行い、デバイスが同時にオンラインである必要があります",
|
|
363
363
|
"enabled": {
|
|
364
|
-
"invalid": "
|
|
364
|
+
"invalid": "シグナリングサーバーと同期チャネル名を入力してから有効にしてください",
|
|
365
365
|
"title": "同期を有効にする"
|
|
366
366
|
},
|
|
367
|
+
"signaling": {
|
|
368
|
+
"desc": "WebRTC はこのアドレスを使用して同期します",
|
|
369
|
+
"placeholder": "シグナリングサーバーのアドレスを入力してください",
|
|
370
|
+
"title": "シグナリングサーバー"
|
|
371
|
+
},
|
|
367
372
|
"title": "WebRTC 同期"
|
|
368
373
|
}
|
|
369
374
|
},
|
|
@@ -345,7 +345,7 @@
|
|
|
345
345
|
"unknownOS": "알 수 없는 OS"
|
|
346
346
|
},
|
|
347
347
|
"warning": {
|
|
348
|
-
"
|
|
348
|
+
"tip": "커뮤니티 베타 테스트를 거친 후, WebRTC 동기화는 일반 데이터 동기화 요구를 안정적으로 충족시키지 못할 수 있습니다. <1>시그널링 서버를 배포</1>한 후 사용하십시오."
|
|
349
349
|
},
|
|
350
350
|
"webrtc": {
|
|
351
351
|
"channelName": {
|
|
@@ -361,9 +361,14 @@
|
|
|
361
361
|
},
|
|
362
362
|
"desc": "실시간, 피어 투 피어 데이터 통신으로 장치가 동시에 온라인 상태여야만 동기화할 수 있습니다",
|
|
363
363
|
"enabled": {
|
|
364
|
-
"invalid": "동기화 채널 이름을 입력한 후에
|
|
364
|
+
"invalid": "시그널링 서버와 동기화 채널 이름을 입력한 후에 활성화하십시오.",
|
|
365
365
|
"title": "동기화 활성화"
|
|
366
366
|
},
|
|
367
|
+
"signaling": {
|
|
368
|
+
"desc": "WebRTC는 이 주소를 사용하여 동기화합니다.",
|
|
369
|
+
"placeholder": "시그널링 서버 주소를 입력하세요",
|
|
370
|
+
"title": "시그널링 서버"
|
|
371
|
+
},
|
|
367
372
|
"title": "WebRTC 동기화"
|
|
368
373
|
}
|
|
369
374
|
},
|
|
@@ -345,7 +345,7 @@
|
|
|
345
345
|
"unknownOS": "Onbekend besturingssysteem"
|
|
346
346
|
},
|
|
347
347
|
"warning": {
|
|
348
|
-
"
|
|
348
|
+
"tip": "Na een lange periode van openbare tests in de community, kan WebRTC-synchronisatie mogelijk niet stabiel voldoen aan algemene synchronisatiebehoeften. Gelieve zelf een <1>signaleringsserver implementeren</1> voordat u het gebruikt."
|
|
349
349
|
},
|
|
350
350
|
"webrtc": {
|
|
351
351
|
"channelName": {
|
|
@@ -361,9 +361,14 @@
|
|
|
361
361
|
},
|
|
362
362
|
"desc": "Realtime, point-to-point datacommunicatie, apparaten moeten tegelijkertijd online zijn om te synchroniseren",
|
|
363
363
|
"enabled": {
|
|
364
|
-
"invalid": "
|
|
364
|
+
"invalid": "Vul eerst de signaleringsserver en synchronisatiekanaalnaam in voordat u deze inschakelt",
|
|
365
365
|
"title": "Synchronisatie inschakelen"
|
|
366
366
|
},
|
|
367
|
+
"signaling": {
|
|
368
|
+
"desc": "WebRTC zal dit adres gebruiken voor synchronisatie",
|
|
369
|
+
"placeholder": "Voer het adres van de signaleringsserver in",
|
|
370
|
+
"title": "Signaleringsserver"
|
|
371
|
+
},
|
|
367
372
|
"title": "WebRTC Synchronisatie"
|
|
368
373
|
}
|
|
369
374
|
},
|
|
@@ -345,7 +345,7 @@
|
|
|
345
345
|
"unknownOS": "Nieznany system"
|
|
346
346
|
},
|
|
347
347
|
"warning": {
|
|
348
|
-
"
|
|
348
|
+
"tip": "After a long period of community testing, WebRTC synchronization may not be able to reliably meet general data synchronization needs. Please <1>deploy a signaling server</1> before use."
|
|
349
349
|
},
|
|
350
350
|
"webrtc": {
|
|
351
351
|
"channelName": {
|
|
@@ -361,9 +361,14 @@
|
|
|
361
361
|
},
|
|
362
362
|
"desc": "Bezpośrednia, punkt-do-punktu komunikacja danych w czasie rzeczywistym, wymaga jednoczesnej obecności urządzeń online do synchronizacji",
|
|
363
363
|
"enabled": {
|
|
364
|
-
"invalid": "
|
|
364
|
+
"invalid": "Please fill in the signaling server and synchronization channel name before enabling.",
|
|
365
365
|
"title": "Włącz synchronizację"
|
|
366
366
|
},
|
|
367
|
+
"signaling": {
|
|
368
|
+
"desc": "WebRTC will use this address for synchronization",
|
|
369
|
+
"placeholder": "Enter signaling server address",
|
|
370
|
+
"title": "Signaling Server"
|
|
371
|
+
},
|
|
367
372
|
"title": "Synchronizacja WebRTC"
|
|
368
373
|
}
|
|
369
374
|
},
|
|
@@ -345,7 +345,7 @@
|
|
|
345
345
|
"unknownOS": "Sistema operacional desconhecido"
|
|
346
346
|
},
|
|
347
347
|
"warning": {
|
|
348
|
-
"
|
|
348
|
+
"tip": "Após um longo período de testes comunitários, a sincronização WebRTC pode não atender de forma estável às demandas gerais de sincronização de dados. Por favor, <1>implante um servidor de sinalização</1> antes de usar."
|
|
349
349
|
},
|
|
350
350
|
"webrtc": {
|
|
351
351
|
"channelName": {
|
|
@@ -361,9 +361,14 @@
|
|
|
361
361
|
},
|
|
362
362
|
"desc": "Comunicação de dados em tempo real ponto a ponto. Os dispositivos precisam estar online simultaneamente para sincronizar",
|
|
363
363
|
"enabled": {
|
|
364
|
-
"invalid": "Por favor,
|
|
364
|
+
"invalid": "Por favor, preencha o endereço do servidor de sinalização e o nome do canal de sincronização antes de ativar.",
|
|
365
365
|
"title": "Ativar sincronização"
|
|
366
366
|
},
|
|
367
|
+
"signaling": {
|
|
368
|
+
"desc": "O WebRTC usará este endereço para sincronização",
|
|
369
|
+
"placeholder": "Insira o endereço do servidor de sinalização",
|
|
370
|
+
"title": "Servidor de Sinalização"
|
|
371
|
+
},
|
|
367
372
|
"title": "Sincronização WebRTC"
|
|
368
373
|
}
|
|
369
374
|
},
|
|
@@ -345,7 +345,7 @@
|
|
|
345
345
|
"unknownOS": "Неизвестная система"
|
|
346
346
|
},
|
|
347
347
|
"warning": {
|
|
348
|
-
"
|
|
348
|
+
"tip": "После длительного общественного тестирования синхронизация WebRTC может не надежно удовлетворять общие потребности в синхронизации данных. Пожалуйста, <1>разверните собственный сигнальный сервер</1> перед использованием."
|
|
349
349
|
},
|
|
350
350
|
"webrtc": {
|
|
351
351
|
"channelName": {
|
|
@@ -361,9 +361,14 @@
|
|
|
361
361
|
},
|
|
362
362
|
"desc": "Реальное время, точка-точка передачи данных, устройства должны быть онлайн одновременно для синхронизации",
|
|
363
363
|
"enabled": {
|
|
364
|
-
"invalid": "Пожалуйста, введите имя канала синхронизации перед
|
|
364
|
+
"invalid": "Пожалуйста, введите адрес сигнального сервера и имя канала синхронизации перед включением.",
|
|
365
365
|
"title": "Включить синхронизацию"
|
|
366
366
|
},
|
|
367
|
+
"signaling": {
|
|
368
|
+
"desc": "WebRTC будет использовать этот адрес для синхронизации",
|
|
369
|
+
"placeholder": "Введите адрес сигнального сервера",
|
|
370
|
+
"title": "Сигнальный сервер"
|
|
371
|
+
},
|
|
367
372
|
"title": "WebRTC синхронизация"
|
|
368
373
|
}
|
|
369
374
|
},
|
|
@@ -345,7 +345,7 @@
|
|
|
345
345
|
"unknownOS": "Bilinmeyen Sistem"
|
|
346
346
|
},
|
|
347
347
|
"warning": {
|
|
348
|
-
"
|
|
348
|
+
"tip": "WebRTC'nin uzun bir topluluk beta testinden sonra, genel veri senkronizasyon ihtiyaçlarını kararlı bir şekilde karşılayamayabileceği uyarısı. Lütfen <1> sinyal sunucusunu dağıtın </1> ve ardından kullanın."
|
|
349
349
|
},
|
|
350
350
|
"webrtc": {
|
|
351
351
|
"channelName": {
|
|
@@ -361,9 +361,14 @@
|
|
|
361
361
|
},
|
|
362
362
|
"desc": "Gerçek zamanlı, noktadan noktaya veri iletişimi, senkronizasyon için cihazların aynı anda çevrimiçi olması gerekir",
|
|
363
363
|
"enabled": {
|
|
364
|
-
"invalid": "Lütfen senkronizasyon
|
|
364
|
+
"invalid": "Lütfen sinyal sunucusu ve senkronizasyon kanal adını girerek etkinleştirin",
|
|
365
365
|
"title": "Senkronizasyonu Etkinleştir"
|
|
366
366
|
},
|
|
367
|
+
"signaling": {
|
|
368
|
+
"desc": "WebRTC senkronizasyon için bu adresi kullanacak",
|
|
369
|
+
"placeholder": "Lütfen sinyal sunucusu adresini girin",
|
|
370
|
+
"title": "Sinyal Sunucusu"
|
|
371
|
+
},
|
|
367
372
|
"title": "WebRTC Senkronizasyonu"
|
|
368
373
|
}
|
|
369
374
|
},
|
|
@@ -345,7 +345,7 @@
|
|
|
345
345
|
"unknownOS": "Hệ điều hành không xác định"
|
|
346
346
|
},
|
|
347
347
|
"warning": {
|
|
348
|
-
"
|
|
348
|
+
"tip": "经过较长一段时间社区公测,WebRTC 同步可能无法稳定满足通用的数据同步诉求。请自行 <1>部署信令服务器</1> 后使用。"
|
|
349
349
|
},
|
|
350
350
|
"webrtc": {
|
|
351
351
|
"channelName": {
|
|
@@ -361,7 +361,6 @@
|
|
|
361
361
|
},
|
|
362
362
|
"desc": "Truyền thông dữ liệu thời gian thực, điểm-điểm, cần thiết bị cùng online mới có thể đồng bộ",
|
|
363
363
|
"enabled": {
|
|
364
|
-
"invalid": "Vui lòng nhập tên kênh đồng bộ trước khi bật",
|
|
365
364
|
"title": "Bật đồng bộ"
|
|
366
365
|
},
|
|
367
366
|
"title": "WebRTC Đồng bộ"
|
|
@@ -407,5 +406,15 @@
|
|
|
407
406
|
"store": "Cửa hàng tiện ích"
|
|
408
407
|
},
|
|
409
408
|
"title": "Công cụ mở rộng"
|
|
409
|
+
},
|
|
410
|
+
"webrtc": {
|
|
411
|
+
"enabled": {
|
|
412
|
+
"invalid": "请填写信令服务器和同步频道名称后再开启"
|
|
413
|
+
},
|
|
414
|
+
"signaling": {
|
|
415
|
+
"desc": "WebRTC sẽ sử dụng địa chỉ này để đồng bộ",
|
|
416
|
+
"placeholder": "Vui lòng nhập địa chỉ máy chủ tín hiệu",
|
|
417
|
+
"title": "Máy chủ tín hiệu"
|
|
418
|
+
}
|
|
410
419
|
}
|
|
411
420
|
}
|
|
@@ -345,7 +345,7 @@
|
|
|
345
345
|
"unknownOS": "未知系统"
|
|
346
346
|
},
|
|
347
347
|
"warning": {
|
|
348
|
-
"
|
|
348
|
+
"tip": "经过较长一段时间社区公测,WebRTC 同步可能无法稳定满足通用的数据同步诉求。请自行 <1>部署信令服务器</1> 后使用。"
|
|
349
349
|
},
|
|
350
350
|
"webrtc": {
|
|
351
351
|
"channelName": {
|
|
@@ -361,9 +361,14 @@
|
|
|
361
361
|
},
|
|
362
362
|
"desc": "实时、点对点的数据通信,需设备同时在线才可同步",
|
|
363
363
|
"enabled": {
|
|
364
|
-
"invalid": "
|
|
364
|
+
"invalid": "请填写信令服务器和同步频道名称后再开启",
|
|
365
365
|
"title": "开启同步"
|
|
366
366
|
},
|
|
367
|
+
"signaling": {
|
|
368
|
+
"desc": "WebRTC 将使用该地址进行同步",
|
|
369
|
+
"placeholder": "请输入信令服务器地址",
|
|
370
|
+
"title": "信令服务器"
|
|
371
|
+
},
|
|
367
372
|
"title": "WebRTC 同步"
|
|
368
373
|
}
|
|
369
374
|
},
|
|
@@ -345,7 +345,7 @@
|
|
|
345
345
|
"unknownOS": "未知系統"
|
|
346
346
|
},
|
|
347
347
|
"warning": {
|
|
348
|
-
"
|
|
348
|
+
"tip": "經過較長一段時間社區公測,WebRTC 同步可能無法穩定滿足通用的資料同步需求。請自行 <1>部署信令伺服器</1> 後使用。"
|
|
349
349
|
},
|
|
350
350
|
"webrtc": {
|
|
351
351
|
"channelName": {
|
|
@@ -361,9 +361,14 @@
|
|
|
361
361
|
},
|
|
362
362
|
"desc": "實時、點對點的數據通信,需裝置同時在線才可同步",
|
|
363
363
|
"enabled": {
|
|
364
|
-
"invalid": "
|
|
364
|
+
"invalid": "請填寫信令伺服器和同步頻道名稱後再啟用",
|
|
365
365
|
"title": "開啟同步"
|
|
366
366
|
},
|
|
367
|
+
"signaling": {
|
|
368
|
+
"desc": "WebRTC 將使用該地址進行同步",
|
|
369
|
+
"placeholder": "請輸入信令伺服器地址",
|
|
370
|
+
"title": "信令伺服器"
|
|
371
|
+
},
|
|
367
372
|
"title": "WebRTC 同步"
|
|
368
373
|
}
|
|
369
374
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/chat",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.3",
|
|
4
4
|
"description": "Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"framework",
|
|
@@ -113,9 +113,9 @@
|
|
|
113
113
|
"@khmyznikov/pwa-install": "^0.3.9",
|
|
114
114
|
"@lobehub/chat-plugin-sdk": "^1.32.4",
|
|
115
115
|
"@lobehub/chat-plugins-gateway": "^1.9.0",
|
|
116
|
-
"@lobehub/icons": "^1.
|
|
116
|
+
"@lobehub/icons": "^1.26.0",
|
|
117
117
|
"@lobehub/tts": "^1.24.3",
|
|
118
|
-
"@lobehub/ui": "^1.146.
|
|
118
|
+
"@lobehub/ui": "^1.146.6",
|
|
119
119
|
"@microsoft/fetch-event-source": "^2.0.1",
|
|
120
120
|
"@neondatabase/serverless": "^0.9.4",
|
|
121
121
|
"@next/third-parties": "^14.2.4",
|
|
@@ -4,6 +4,7 @@ import { Form, type ItemGroup, SelectWithImg, SliderWithInput } from '@lobehub/u
|
|
|
4
4
|
import { Select } from 'antd';
|
|
5
5
|
import isEqual from 'fast-deep-equal';
|
|
6
6
|
import { Monitor, Moon, Sun } from 'lucide-react';
|
|
7
|
+
import { useRouter } from 'next/navigation';
|
|
7
8
|
import { memo } from 'react';
|
|
8
9
|
import { useTranslation } from 'react-i18next';
|
|
9
10
|
|
|
@@ -12,7 +13,7 @@ import { enableAuth } from '@/const/auth';
|
|
|
12
13
|
import { FORM_STYLE } from '@/const/layoutTokens';
|
|
13
14
|
import { imageUrl } from '@/const/url';
|
|
14
15
|
import AvatarWithUpload from '@/features/AvatarWithUpload';
|
|
15
|
-
import { localeOptions } from '@/locales/resources';
|
|
16
|
+
import { Locales, localeOptions } from '@/locales/resources';
|
|
16
17
|
import { useUserStore } from '@/store/user';
|
|
17
18
|
import { settingsSelectors, userGeneralSettingsSelectors } from '@/store/user/selectors';
|
|
18
19
|
import { switchLang } from '@/utils/client/switchLang';
|
|
@@ -23,6 +24,7 @@ type SettingItemGroup = ItemGroup;
|
|
|
23
24
|
|
|
24
25
|
const Theme = memo(() => {
|
|
25
26
|
const { t } = useTranslation('setting');
|
|
27
|
+
const router = useRouter();
|
|
26
28
|
const [form] = Form.useForm();
|
|
27
29
|
const settings = useUserStore(settingsSelectors.currentSettings, isEqual);
|
|
28
30
|
const themeMode = useUserStore(userGeneralSettingsSelectors.currentThemeMode);
|
|
@@ -30,6 +32,11 @@ const Theme = memo(() => {
|
|
|
30
32
|
|
|
31
33
|
useSyncSettings(form);
|
|
32
34
|
|
|
35
|
+
const handleLangChange = (value: Locales) => {
|
|
36
|
+
switchLang(value);
|
|
37
|
+
router.refresh();
|
|
38
|
+
};
|
|
39
|
+
|
|
33
40
|
const theme: SettingItemGroup = {
|
|
34
41
|
children: [
|
|
35
42
|
{
|
|
@@ -74,7 +81,7 @@ const Theme = memo(() => {
|
|
|
74
81
|
{
|
|
75
82
|
children: (
|
|
76
83
|
<Select
|
|
77
|
-
onChange={
|
|
84
|
+
onChange={handleLangChange}
|
|
78
85
|
options={[{ label: t('settingTheme.lang.autoMode'), value: 'auto' }, ...localeOptions]}
|
|
79
86
|
/>
|
|
80
87
|
),
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { Alert } from '@lobehub/ui';
|
|
4
|
+
import Link from 'next/link';
|
|
4
5
|
import { memo } from 'react';
|
|
5
|
-
import {
|
|
6
|
+
import { Trans } from 'react-i18next';
|
|
6
7
|
import { Flexbox } from 'react-layout-kit';
|
|
7
8
|
|
|
8
9
|
import { MAX_WIDTH } from '@/const/layoutTokens';
|
|
10
|
+
import { WEBRTC_SYNC_DOCUMENTS } from '@/const/url';
|
|
9
11
|
import { useUserStore } from '@/store/user';
|
|
10
12
|
import { preferenceSelectors } from '@/store/user/selectors';
|
|
11
13
|
|
|
@@ -13,7 +15,6 @@ interface ExperimentAlertProps {
|
|
|
13
15
|
mobile?: boolean;
|
|
14
16
|
}
|
|
15
17
|
const ExperimentAlert = memo<ExperimentAlertProps>(({ mobile }) => {
|
|
16
|
-
const { t } = useTranslation('setting');
|
|
17
18
|
const [hideSyncAlert, updatePreference] = useUserStore((s) => [
|
|
18
19
|
preferenceSelectors.hideSyncAlert(s),
|
|
19
20
|
s.updatePreference,
|
|
@@ -25,7 +26,20 @@ const ExperimentAlert = memo<ExperimentAlertProps>(({ mobile }) => {
|
|
|
25
26
|
<Alert
|
|
26
27
|
banner={mobile}
|
|
27
28
|
closable
|
|
28
|
-
message={
|
|
29
|
+
message={
|
|
30
|
+
<Trans i18nKey="sync.warning.tip" ns={'setting'}>
|
|
31
|
+
经过较长一段时间测试,WebRTC 同步可能无法稳定满足通用的数据同步诉求。请自行
|
|
32
|
+
<Link
|
|
33
|
+
aria-label={'Webrtc Sync deployment'}
|
|
34
|
+
href={WEBRTC_SYNC_DOCUMENTS}
|
|
35
|
+
style={{ color: 'inherit', textDecoration: 'underline' }}
|
|
36
|
+
target="_blank"
|
|
37
|
+
>
|
|
38
|
+
部署信令服务器
|
|
39
|
+
</Link>
|
|
40
|
+
后使用。
|
|
41
|
+
</Trans>
|
|
42
|
+
}
|
|
29
43
|
onClose={() => {
|
|
30
44
|
updatePreference({ hideSyncAlert: true });
|
|
31
45
|
}}
|
|
@@ -25,9 +25,16 @@ const WebRTC = memo(() => {
|
|
|
25
25
|
useSyncSettings(form);
|
|
26
26
|
|
|
27
27
|
const channelName = AntForm.useWatch(['sync', 'webrtc', 'channelName'], form);
|
|
28
|
+
const signaling = AntForm.useWatch(['sync', 'webrtc', 'signaling'], form);
|
|
28
29
|
|
|
29
30
|
const config: SettingItemGroup = {
|
|
30
31
|
children: [
|
|
32
|
+
{
|
|
33
|
+
children: <Input placeholder={t('sync.webrtc.signaling.placeholder')} />,
|
|
34
|
+
desc: t('sync.webrtc.signaling.desc'),
|
|
35
|
+
label: t('sync.webrtc.signaling.title'),
|
|
36
|
+
name: ['sync', 'webrtc', 'signaling'],
|
|
37
|
+
},
|
|
31
38
|
{
|
|
32
39
|
children: <ChannelNameInput form={form} />,
|
|
33
40
|
desc: t('sync.webrtc.channelName.desc'),
|
|
@@ -46,14 +53,14 @@ const WebRTC = memo(() => {
|
|
|
46
53
|
name: ['sync', 'webrtc', 'channelPassword'],
|
|
47
54
|
},
|
|
48
55
|
{
|
|
49
|
-
children:
|
|
50
|
-
|
|
51
|
-
<
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
56
|
+
children:
|
|
57
|
+
!channelName || !signaling ? (
|
|
58
|
+
<Tooltip title={t('sync.webrtc.enabled.invalid')}>
|
|
59
|
+
<Switch disabled />
|
|
60
|
+
</Tooltip>
|
|
61
|
+
) : (
|
|
62
|
+
<Switch />
|
|
63
|
+
),
|
|
57
64
|
|
|
58
65
|
label: t('sync.webrtc.enabled.title'),
|
|
59
66
|
minWidth: undefined,
|
package/src/const/url.ts
CHANGED
|
@@ -21,6 +21,7 @@ export const DOCKER_IMAGE = 'https://hub.docker.com/r/lobehub/lobe-chat';
|
|
|
21
21
|
export const DOCUMENTS = urlJoin(OFFICIAL_SITE, '/docs');
|
|
22
22
|
export const USAGE_DOCUMENTS = urlJoin(DOCUMENTS, '/usage');
|
|
23
23
|
export const SELF_HOSTING_DOCUMENTS = urlJoin(DOCUMENTS, '/self-hosting');
|
|
24
|
+
export const WEBRTC_SYNC_DOCUMENTS = urlJoin(SELF_HOSTING_DOCUMENTS, '/advanced/webrtc');
|
|
24
25
|
|
|
25
26
|
export const WIKI = urlJoin(GITHUB, 'wiki');
|
|
26
27
|
export const WIKI_PLUGIN_GUIDE = urlJoin(USAGE_DOCUMENTS, '/plugins/development');
|
|
@@ -48,14 +48,7 @@ class DataSync {
|
|
|
48
48
|
};
|
|
49
49
|
|
|
50
50
|
connect = async (params: StartDataSyncParams) => {
|
|
51
|
-
const {
|
|
52
|
-
channel,
|
|
53
|
-
onSyncEvent,
|
|
54
|
-
onSyncStatusChange,
|
|
55
|
-
user,
|
|
56
|
-
onAwarenessChange,
|
|
57
|
-
signaling = 'wss://y-webrtc-signaling.lobehub.com',
|
|
58
|
-
} = params;
|
|
51
|
+
const { channel, onSyncEvent, onSyncStatusChange, user, onAwarenessChange, signaling } = params;
|
|
59
52
|
// ====== 1. init yjs doc ====== //
|
|
60
53
|
|
|
61
54
|
await this.initYDoc();
|
|
@@ -348,7 +348,7 @@ export default {
|
|
|
348
348
|
unknownOS: '未知系统',
|
|
349
349
|
},
|
|
350
350
|
warning: {
|
|
351
|
-
|
|
351
|
+
tip: '经过较长一段时间社区公测,WebRTC 同步可能无法稳定满足通用的数据同步诉求。请自行 <1>部署信令服务器</1> 后使用。',
|
|
352
352
|
},
|
|
353
353
|
webrtc: {
|
|
354
354
|
channelName: {
|
|
@@ -364,10 +364,14 @@ export default {
|
|
|
364
364
|
},
|
|
365
365
|
desc: '实时、点对点的数据通信,需设备同时在线才可同步',
|
|
366
366
|
enabled: {
|
|
367
|
-
invalid: '
|
|
368
|
-
// desc: 'WebRTC 将使用此名创建同步频道,确保频道名称唯一',
|
|
367
|
+
invalid: '请填写信令服务器和同步频道名称后再开启',
|
|
369
368
|
title: '开启同步',
|
|
370
369
|
},
|
|
370
|
+
signaling: {
|
|
371
|
+
desc: 'WebRTC 将使用该地址进行同步',
|
|
372
|
+
placeholder: '请输入信令服务器地址',
|
|
373
|
+
title: '信令服务器',
|
|
374
|
+
},
|
|
371
375
|
title: 'WebRTC 同步',
|
|
372
376
|
},
|
|
373
377
|
},
|
|
@@ -46,7 +46,7 @@ export const createSyncSlice: StateCreator<
|
|
|
46
46
|
// double-check the sync ability
|
|
47
47
|
// if there is no channelName, don't start sync
|
|
48
48
|
const sync = syncSettingsSelectors.webrtcConfig(get());
|
|
49
|
-
if (!sync.channelName) return false;
|
|
49
|
+
if (!sync.channelName || !sync.signaling) return false;
|
|
50
50
|
|
|
51
51
|
const name = syncSettingsSelectors.deviceName(get());
|
|
52
52
|
|
package/src/types/sync.ts
CHANGED