@lobehub/chat 1.42.6 → 1.43.0
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 +33 -0
- package/changelog/v1.json +12 -0
- package/docs/.cdn.cache.json +1 -0
- package/docs/changelog/2025-01-03-user-profile.mdx +27 -0
- package/docs/changelog/2025-01-03-user-profile.zh-CN.mdx +26 -0
- package/docs/self-hosting/advanced/auth/next-auth/wechat.mdx +3 -1
- package/docs/self-hosting/advanced/auth/next-auth/wechat.zh-CN.mdx +2 -2
- package/locales/ar/auth.json +76 -4
- package/locales/bg-BG/auth.json +75 -3
- package/locales/de-DE/auth.json +78 -6
- package/locales/en-US/auth.json +78 -6
- package/locales/es-ES/auth.json +75 -3
- package/locales/fa-IR/auth.json +77 -5
- package/locales/fr-FR/auth.json +78 -6
- package/locales/it-IT/auth.json +76 -4
- package/locales/ja-JP/auth.json +76 -4
- package/locales/ko-KR/auth.json +75 -3
- package/locales/nl-NL/auth.json +76 -4
- package/locales/pl-PL/auth.json +76 -4
- package/locales/pt-BR/auth.json +76 -4
- package/locales/ru-RU/auth.json +75 -3
- package/locales/tr-TR/auth.json +74 -3
- package/locales/vi-VN/auth.json +75 -3
- package/locales/zh-CN/auth.json +75 -3
- package/locales/zh-TW/auth.json +75 -3
- package/package.json +4 -3
- package/src/app/(main)/(mobile)/me/(home)/__tests__/UserBanner.test.tsx +4 -0
- package/src/app/(main)/(mobile)/me/(home)/__tests__/useCategory.test.tsx +0 -46
- package/src/app/(main)/(mobile)/me/(home)/features/UserBanner.tsx +11 -14
- package/src/app/(main)/(mobile)/me/(home)/features/useCategory.tsx +6 -21
- package/src/app/(main)/(mobile)/me/profile/features/Category.tsx +38 -21
- package/src/app/(main)/(mobile)/me/profile/layout.tsx +0 -3
- package/src/app/(main)/(mobile)/me/profile/page.tsx +3 -3
- package/src/app/(main)/chat/loading.tsx +2 -2
- package/src/app/(main)/discover/loading.tsx +2 -8
- package/src/app/(main)/files/loading.tsx +2 -2
- package/src/app/(main)/profile/(home)/Client.tsx +53 -0
- package/src/app/(main)/profile/(home)/[[...slugs]]/page.tsx +38 -0
- package/src/app/(main)/profile/@category/default.tsx +9 -0
- package/src/app/(main)/profile/@category/features/CategoryContent.tsx +38 -0
- package/src/app/(main)/profile/_layout/Desktop/Header.tsx +85 -0
- package/src/app/(main)/profile/_layout/Desktop/SideBar.tsx +42 -0
- package/src/app/(main)/profile/_layout/Desktop/index.tsx +48 -0
- package/src/app/(main)/profile/_layout/Mobile/Header.tsx +23 -5
- package/src/app/(main)/profile/_layout/Mobile/index.tsx +12 -5
- package/src/app/(main)/profile/_layout/type.ts +6 -0
- package/src/app/(main)/profile/error.tsx +5 -0
- package/src/app/(main)/profile/features/ClerkProfile.tsx +72 -0
- package/src/app/(main)/profile/hooks/useCategory.tsx +51 -0
- package/src/app/(main)/profile/layout.tsx +7 -17
- package/src/app/(main)/profile/loading.tsx +2 -22
- package/src/app/(main)/profile/not-found.tsx +3 -0
- package/src/app/(main)/profile/security/page.tsx +34 -0
- package/src/app/(main)/profile/stats/Client.tsx +52 -0
- package/src/app/(main)/profile/stats/features/AiHeatmaps.tsx +130 -0
- package/src/app/(main)/profile/stats/features/AssistantsRank.tsx +115 -0
- package/src/app/(main)/profile/stats/features/ModelsRank.tsx +84 -0
- package/src/app/(main)/profile/stats/features/ShareButton/Preview.tsx +159 -0
- package/src/app/(main)/profile/stats/features/ShareButton/ShareModal.tsx +87 -0
- package/src/app/(main)/profile/stats/features/ShareButton/TotalCard.tsx +39 -0
- package/src/app/(main)/profile/stats/features/ShareButton/index.tsx +26 -0
- package/src/app/(main)/profile/stats/features/TimeLabel.tsx +30 -0
- package/src/app/(main)/profile/stats/features/TopicsRank.tsx +103 -0
- package/src/app/(main)/profile/stats/features/TotalAssistants.tsx +56 -0
- package/src/app/(main)/profile/stats/features/TotalMessages.tsx +56 -0
- package/src/app/(main)/profile/stats/features/TotalTopics.tsx +53 -0
- package/src/app/(main)/profile/stats/features/TotalWords.tsx +54 -0
- package/src/app/(main)/profile/stats/features/Welcome.tsx +86 -0
- package/src/app/(main)/profile/{[[...slugs]] → stats}/page.tsx +4 -5
- package/src/app/(main)/repos/[id]/evals/dataset/page.tsx +2 -2
- package/src/app/(main)/repos/[id]/evals/evaluation/page.tsx +2 -2
- package/src/app/(main)/settings/@category/features/CategoryContent.tsx +1 -1
- package/src/app/(main)/settings/_layout/Desktop/index.tsx +1 -1
- package/src/app/(main)/settings/_layout/Mobile/Header.tsx +1 -1
- package/src/app/(main)/settings/_layout/Mobile/index.tsx +2 -0
- package/src/app/(main)/settings/common/features/Theme/index.tsx +2 -17
- package/src/app/(main)/settings/loading.tsx +2 -2
- package/src/components/Loading/BrandTextLoading/index.tsx +2 -2
- package/src/components/Statistic/index.tsx +15 -0
- package/src/components/StatisticCard/TitleWithPercentage.tsx +80 -0
- package/src/components/StatisticCard/growthPercentage.tsx +8 -0
- package/src/components/StatisticCard/index.tsx +209 -0
- package/src/const/url.ts +3 -3
- package/src/database/server/models/__tests__/message.test.ts +346 -35
- package/src/database/server/models/__tests__/session.test.ts +185 -2
- package/src/database/server/models/__tests__/topic.test.ts +136 -0
- package/src/database/server/models/__tests__/user.test.ts +140 -1
- package/src/database/server/models/message.ts +109 -14
- package/src/database/server/models/session.ts +75 -4
- package/src/database/server/models/topic.ts +43 -3
- package/src/database/server/models/user.ts +22 -0
- package/src/database/utils/genWhere.ts +39 -0
- package/src/features/ShareModal/ShareImage/index.tsx +11 -24
- package/src/features/ShareModal/ShareImage/type.ts +1 -6
- package/src/features/User/DataStatistics.tsx +21 -14
- package/src/features/User/UserPanel/PanelContent.tsx +12 -16
- package/src/features/User/UserPanel/useMenu.tsx +4 -6
- package/src/features/User/__tests__/PanelContent.test.tsx +4 -0
- package/src/features/User/__tests__/useMenu.test.tsx +1 -21
- package/src/hooks/useActiveTabKey.ts +34 -1
- package/src/{features/ShareModal/ShareImage → hooks}/useScreenshot.ts +51 -6
- package/src/locales/default/auth.ts +74 -2
- package/src/server/ld.test.ts +1 -1
- package/src/server/modules/AssistantStore/index.ts +3 -2
- package/src/server/routers/lambda/message.ts +35 -6
- package/src/server/routers/lambda/session.ts +17 -3
- package/src/server/routers/lambda/topic.ts +17 -3
- package/src/server/routers/lambda/user.ts +4 -0
- package/src/server/services/changelog/index.ts +1 -1
- package/src/services/message/_deprecated.ts +16 -0
- package/src/services/message/client.test.ts +0 -18
- package/src/services/message/client.ts +12 -9
- package/src/services/message/server.ts +12 -4
- package/src/services/message/type.ts +15 -3
- package/src/services/session/_deprecated.ts +5 -0
- package/src/services/session/client.ts +6 -2
- package/src/services/session/server.ts +6 -2
- package/src/services/session/type.ts +7 -1
- package/src/services/topic/_deprecated.ts +5 -0
- package/src/services/topic/client.ts +6 -2
- package/src/services/topic/server.ts +7 -1
- package/src/services/topic/type.ts +7 -2
- package/src/services/user/_deprecated.ts +4 -0
- package/src/services/user/client.ts +4 -0
- package/src/services/user/server.ts +4 -0
- package/src/services/user/type.ts +5 -0
- package/src/store/global/initialState.ts +6 -0
- package/src/store/user/slices/auth/action.test.ts +1 -33
- package/src/store/user/slices/auth/action.ts +0 -9
- package/src/store/user/slices/common/action.test.ts +2 -2
- package/src/types/message/index.ts +5 -0
- package/src/types/session/index.ts +8 -0
- package/src/types/topic/topic.ts +7 -0
- package/src/utils/format.ts +1 -1
- package/src/utils/time.ts +23 -0
- package/src/app/(main)/profile/[[...slugs]]/Client.tsx +0 -76
- package/src/components/Loading/BrandTextLoading/LobeChatText/SVG.tsx +0 -44
- package/src/components/Loading/BrandTextLoading/LobeChatText/index.tsx +0 -6
- package/src/components/Loading/BrandTextLoading/LobeChatText/style.css +0 -32
- package/src/hooks/useActiveSettingsKey.ts +0 -20
package/locales/tr-TR/auth.json
CHANGED
@@ -1,8 +1,79 @@
|
|
1
1
|
{
|
2
|
+
"date": {
|
3
|
+
"prevMonth": "Geçen Ay",
|
4
|
+
"recent30Days": "Son 30 Gün"
|
5
|
+
},
|
6
|
+
"header": {
|
7
|
+
"desc": "Hesap bilgilerinizi yönetin.",
|
8
|
+
"title": "Hesap"
|
9
|
+
},
|
10
|
+
"heatmaps": {
|
11
|
+
"legend": {
|
12
|
+
"less": "Pasif",
|
13
|
+
"more": "Aktif"
|
14
|
+
},
|
15
|
+
"months": {
|
16
|
+
"apr": "Nis",
|
17
|
+
"aug": "Ağu",
|
18
|
+
"dec": "Ara",
|
19
|
+
"feb": "Şub",
|
20
|
+
"jan": "Oca",
|
21
|
+
"jul": "Tem",
|
22
|
+
"jun": "Haz",
|
23
|
+
"mar": "Mar",
|
24
|
+
"may": "May",
|
25
|
+
"nov": "Kas",
|
26
|
+
"oct": "Eki",
|
27
|
+
"sep": "Eyl"
|
28
|
+
},
|
29
|
+
"tooltip": "{{date}} tarihinde {{count}} mesaj gönderildi",
|
30
|
+
"totalCount": "Geçen yıl toplam {{count}} mesaj gönderildi"
|
31
|
+
},
|
2
32
|
"login": "Giriş Yap",
|
3
33
|
"loginOrSignup": "Giriş Yap / Kayıt Ol",
|
4
|
-
"profile":
|
5
|
-
|
34
|
+
"profile": {
|
35
|
+
"avatar": "Avatar",
|
36
|
+
"email": "E-posta Adresi",
|
37
|
+
"username": "Kullanıcı Adı"
|
38
|
+
},
|
6
39
|
"signout": "Çıkış Yap",
|
7
|
-
"signup": "
|
40
|
+
"signup": "Kayıt Ol",
|
41
|
+
"stats": {
|
42
|
+
"aiheatmaps": "Aktivite İndeksi",
|
43
|
+
"assistants": "Asistanlar",
|
44
|
+
"assistantsRank": {
|
45
|
+
"left": "Asistan",
|
46
|
+
"right": "Konu",
|
47
|
+
"title": "Asistan Kullanım Sıralaması"
|
48
|
+
},
|
49
|
+
"createdAt": "Kayıtlı olduğu tarih",
|
50
|
+
"days": "gün",
|
51
|
+
"empty": {
|
52
|
+
"desc": "Görüntülemek için daha fazla sohbet verisi biriktirin",
|
53
|
+
"title": "Veri Yok"
|
54
|
+
},
|
55
|
+
"lastYearActivity": "geçen yılki aktivite",
|
56
|
+
"messages": "Mesajlar",
|
57
|
+
"modelsRank": {
|
58
|
+
"left": "Model",
|
59
|
+
"right": "Mesajlar",
|
60
|
+
"title": "Model Kullanım Sıralaması"
|
61
|
+
},
|
62
|
+
"share": {
|
63
|
+
"title": "AI Aktivite İndeksim"
|
64
|
+
},
|
65
|
+
"topics": "Konu",
|
66
|
+
"topicsRank": {
|
67
|
+
"left": "Konu",
|
68
|
+
"right": "Mesajlar",
|
69
|
+
"title": "Konu İçerik Sıralaması"
|
70
|
+
},
|
71
|
+
"updatedAt": "Güncellenme tarihi",
|
72
|
+
"welcome": "{{username}}, bu {{appName}} ile geçirdiğin <span>{{days}}</span> gün."
|
73
|
+
},
|
74
|
+
"tab": {
|
75
|
+
"profile": "Profil",
|
76
|
+
"security": "Güvenlik",
|
77
|
+
"stats": "İstatistikler"
|
78
|
+
}
|
8
79
|
}
|
package/locales/vi-VN/auth.json
CHANGED
@@ -1,8 +1,80 @@
|
|
1
1
|
{
|
2
|
+
"date": {
|
3
|
+
"prevMonth": "Tháng trước",
|
4
|
+
"recent30Days": "30 ngày qua"
|
5
|
+
},
|
6
|
+
"header": {
|
7
|
+
"desc": "Quản lý thông tin tài khoản của bạn.",
|
8
|
+
"title": "Tài khoản"
|
9
|
+
},
|
10
|
+
"heatmaps": {
|
11
|
+
"legend": {
|
12
|
+
"less": "Không hoạt động",
|
13
|
+
"more": "Hoạt động"
|
14
|
+
},
|
15
|
+
"months": {
|
16
|
+
"apr": "Th4",
|
17
|
+
"aug": "Th8",
|
18
|
+
"dec": "Th12",
|
19
|
+
"feb": "Th2",
|
20
|
+
"jan": "Th1",
|
21
|
+
"jul": "Th7",
|
22
|
+
"jun": "Th6",
|
23
|
+
"mar": "Th3",
|
24
|
+
"may": "Th5",
|
25
|
+
"nov": "Th11",
|
26
|
+
"oct": "Th10",
|
27
|
+
"sep": "Th9"
|
28
|
+
},
|
29
|
+
"tooltip": "{{date}} đã gửi {{count}} tin nhắn trong ngày đó",
|
30
|
+
"totalCount": "Tổng cộng {{count}} tin nhắn đã gửi trong năm qua"
|
31
|
+
},
|
2
32
|
"login": "Đăng nhập",
|
3
33
|
"loginOrSignup": "Đăng nhập / Đăng ký",
|
4
|
-
"profile":
|
5
|
-
|
34
|
+
"profile": {
|
35
|
+
"avatar": "Ảnh đại diện",
|
36
|
+
"email": "Địa chỉ email",
|
37
|
+
"username": "Tên người dùng"
|
38
|
+
},
|
6
39
|
"signout": "Đăng xuất",
|
7
|
-
"signup": "Đăng ký"
|
40
|
+
"signup": "Đăng ký",
|
41
|
+
"stats": {
|
42
|
+
"aiheatmaps": "Chỉ số hoạt động",
|
43
|
+
"assistants": "Trợ lý",
|
44
|
+
"assistantsRank": {
|
45
|
+
"left": "Trợ lý",
|
46
|
+
"right": "Chủ đề",
|
47
|
+
"title": "Xếp hạng sử dụng trợ lý"
|
48
|
+
},
|
49
|
+
"createdAt": "Đăng ký vào",
|
50
|
+
"days": "ngày",
|
51
|
+
"empty": {
|
52
|
+
"desc": "Vui lòng tích lũy thêm dữ liệu trò chuyện để xem",
|
53
|
+
"title": "Không có dữ liệu"
|
54
|
+
},
|
55
|
+
"lastYearActivity": "hoạt động trong năm qua",
|
56
|
+
"messages": "Tin nhắn",
|
57
|
+
"modelsRank": {
|
58
|
+
"left": "Mô hình",
|
59
|
+
"right": "Tin nhắn",
|
60
|
+
"title": "Xếp hạng sử dụng mô hình"
|
61
|
+
},
|
62
|
+
"share": {
|
63
|
+
"title": "Chỉ số hoạt động AI của tôi"
|
64
|
+
},
|
65
|
+
"topics": "Chủ đề",
|
66
|
+
"topicsRank": {
|
67
|
+
"left": "Chủ đề",
|
68
|
+
"right": "Tin nhắn",
|
69
|
+
"title": "Xếp hạng nội dung chủ đề"
|
70
|
+
},
|
71
|
+
"updatedAt": "Cập nhật vào",
|
72
|
+
"welcome": "{{username}}, đây là ngày <span>{{days}}</span> của bạn với {{appName}}",
|
73
|
+
"words": "Từ"
|
74
|
+
},
|
75
|
+
"tab": {
|
76
|
+
"profile": "Hồ sơ",
|
77
|
+
"security": "Bảo mật",
|
78
|
+
"stats": "Thống kê"
|
79
|
+
}
|
8
80
|
}
|
package/locales/zh-CN/auth.json
CHANGED
@@ -1,8 +1,80 @@
|
|
1
1
|
{
|
2
|
+
"date": {
|
3
|
+
"prevMonth": "上个月",
|
4
|
+
"recent30Days": "最近30天"
|
5
|
+
},
|
6
|
+
"header": {
|
7
|
+
"desc": "管理您的账户信息。",
|
8
|
+
"title": "账户"
|
9
|
+
},
|
10
|
+
"heatmaps": {
|
11
|
+
"legend": {
|
12
|
+
"less": "不活跃",
|
13
|
+
"more": "活跃"
|
14
|
+
},
|
15
|
+
"months": {
|
16
|
+
"apr": "四月",
|
17
|
+
"aug": "八月",
|
18
|
+
"dec": "十二月",
|
19
|
+
"feb": "二月",
|
20
|
+
"jan": "一月",
|
21
|
+
"jul": "七月",
|
22
|
+
"jun": "六月",
|
23
|
+
"mar": "三月",
|
24
|
+
"may": "五月",
|
25
|
+
"nov": "十一月",
|
26
|
+
"oct": "十月",
|
27
|
+
"sep": "九月"
|
28
|
+
},
|
29
|
+
"tooltip": "{{date}} 当日发送 {{count}} 条消息",
|
30
|
+
"totalCount": "过去一年共发送 {{count}} 条消息"
|
31
|
+
},
|
2
32
|
"login": "登录",
|
3
33
|
"loginOrSignup": "登录 / 注册",
|
4
|
-
"profile":
|
5
|
-
|
34
|
+
"profile": {
|
35
|
+
"avatar": "头像",
|
36
|
+
"email": "电子邮件地址",
|
37
|
+
"username": "用户名"
|
38
|
+
},
|
6
39
|
"signout": "退出登录",
|
7
|
-
"signup": "注册"
|
40
|
+
"signup": "注册",
|
41
|
+
"stats": {
|
42
|
+
"aiheatmaps": "AI 指数",
|
43
|
+
"assistants": "助手数",
|
44
|
+
"assistantsRank": {
|
45
|
+
"left": "助手名称",
|
46
|
+
"right": "话题数",
|
47
|
+
"title": "助手使用率"
|
48
|
+
},
|
49
|
+
"createdAt": "用户创建于",
|
50
|
+
"days": "天",
|
51
|
+
"empty": {
|
52
|
+
"desc": "请积累更多聊天数据后查看",
|
53
|
+
"title": "暂无数据"
|
54
|
+
},
|
55
|
+
"lastYearActivity": "过去一年活跃度",
|
56
|
+
"messages": "消息数",
|
57
|
+
"modelsRank": {
|
58
|
+
"left": "模型名称",
|
59
|
+
"right": "消息数",
|
60
|
+
"title": "模型使用率"
|
61
|
+
},
|
62
|
+
"share": {
|
63
|
+
"title": "我的 AI 活跃指数"
|
64
|
+
},
|
65
|
+
"topics": "话题数",
|
66
|
+
"topicsRank": {
|
67
|
+
"left": "话题名称",
|
68
|
+
"right": "消息数",
|
69
|
+
"title": "话题内容量"
|
70
|
+
},
|
71
|
+
"updatedAt": "数据更新至",
|
72
|
+
"welcome": "{{username}}, 这是你和 {{appName}} 相伴的第 <span>{{days}}</span> 天",
|
73
|
+
"words": "累计字数"
|
74
|
+
},
|
75
|
+
"tab": {
|
76
|
+
"profile": "个人资料",
|
77
|
+
"security": "安全",
|
78
|
+
"stats": "数据统计"
|
79
|
+
}
|
8
80
|
}
|
package/locales/zh-TW/auth.json
CHANGED
@@ -1,8 +1,80 @@
|
|
1
1
|
{
|
2
|
+
"date": {
|
3
|
+
"prevMonth": "上個月",
|
4
|
+
"recent30Days": "最近30天"
|
5
|
+
},
|
6
|
+
"header": {
|
7
|
+
"desc": "管理您的帳戶資訊。",
|
8
|
+
"title": "帳戶"
|
9
|
+
},
|
10
|
+
"heatmaps": {
|
11
|
+
"legend": {
|
12
|
+
"less": "不活躍",
|
13
|
+
"more": "活躍"
|
14
|
+
},
|
15
|
+
"months": {
|
16
|
+
"apr": "四月",
|
17
|
+
"aug": "八月",
|
18
|
+
"dec": "十二月",
|
19
|
+
"feb": "二月",
|
20
|
+
"jan": "一月",
|
21
|
+
"jul": "七月",
|
22
|
+
"jun": "六月",
|
23
|
+
"mar": "三月",
|
24
|
+
"may": "五月",
|
25
|
+
"nov": "十一月",
|
26
|
+
"oct": "十月",
|
27
|
+
"sep": "九月"
|
28
|
+
},
|
29
|
+
"tooltip": "{{date}} 當日發送 {{count}} 條消息",
|
30
|
+
"totalCount": "過去一年共發送 {{count}} 條消息"
|
31
|
+
},
|
2
32
|
"login": "登入",
|
3
33
|
"loginOrSignup": "登入 / 註冊",
|
4
|
-
"profile":
|
5
|
-
|
34
|
+
"profile": {
|
35
|
+
"avatar": "頭像",
|
36
|
+
"email": "電子郵件地址",
|
37
|
+
"username": "用戶名"
|
38
|
+
},
|
6
39
|
"signout": "登出",
|
7
|
-
"signup": "註冊"
|
40
|
+
"signup": "註冊",
|
41
|
+
"stats": {
|
42
|
+
"aiheatmaps": "AI 指數",
|
43
|
+
"assistants": "助手數",
|
44
|
+
"assistantsRank": {
|
45
|
+
"left": "助手名稱",
|
46
|
+
"right": "話題數",
|
47
|
+
"title": "助手使用率"
|
48
|
+
},
|
49
|
+
"createdAt": "用戶創建於",
|
50
|
+
"days": "天",
|
51
|
+
"empty": {
|
52
|
+
"desc": "請累積更多聊天數據後查看",
|
53
|
+
"title": "暫無數據"
|
54
|
+
},
|
55
|
+
"lastYearActivity": "過去一年活躍度",
|
56
|
+
"messages": "消息數",
|
57
|
+
"modelsRank": {
|
58
|
+
"left": "模型名稱",
|
59
|
+
"right": "消息數",
|
60
|
+
"title": "模型使用率"
|
61
|
+
},
|
62
|
+
"share": {
|
63
|
+
"title": "我的 AI 活躍指數"
|
64
|
+
},
|
65
|
+
"topics": "話題數",
|
66
|
+
"topicsRank": {
|
67
|
+
"left": "話題名稱",
|
68
|
+
"right": "消息數",
|
69
|
+
"title": "話題內容量"
|
70
|
+
},
|
71
|
+
"updatedAt": "數據更新至",
|
72
|
+
"welcome": "{{username}}, 這是你和 {{appName}} 相伴的第 <span>{{days}}</span> 天",
|
73
|
+
"words": "總字數"
|
74
|
+
},
|
75
|
+
"tab": {
|
76
|
+
"profile": "個人資料",
|
77
|
+
"security": "安全",
|
78
|
+
"stats": "數據統計"
|
79
|
+
}
|
8
80
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@lobehub/chat",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.43.0",
|
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",
|
@@ -125,11 +125,12 @@
|
|
125
125
|
"@icons-pack/react-simple-icons": "9.6.0",
|
126
126
|
"@khmyznikov/pwa-install": "^0.3.9",
|
127
127
|
"@langchain/community": "^0.3.0",
|
128
|
+
"@lobehub/charts": "^1.9.12",
|
128
129
|
"@lobehub/chat-plugin-sdk": "^1.32.4",
|
129
130
|
"@lobehub/chat-plugins-gateway": "^1.9.0",
|
130
131
|
"@lobehub/icons": "^1.56.0",
|
131
132
|
"@lobehub/tts": "^1.25.1",
|
132
|
-
"@lobehub/ui": "^1.
|
133
|
+
"@lobehub/ui": "^1.156.3",
|
133
134
|
"@neondatabase/serverless": "^0.10.1",
|
134
135
|
"@next/third-parties": "^15.0.0",
|
135
136
|
"@react-spring/web": "^9.7.5",
|
@@ -176,7 +177,7 @@
|
|
176
177
|
"mammoth": "^1.8.0",
|
177
178
|
"modern-screenshot": "^4.4.39",
|
178
179
|
"nanoid": "^5.0.7",
|
179
|
-
"next": "^15.1.
|
180
|
+
"next": "^15.1.3",
|
180
181
|
"next-auth": "beta",
|
181
182
|
"next-mdx-remote": "^4.4.1",
|
182
183
|
"nextjs-toploader": "^3.7.15",
|
@@ -24,6 +24,10 @@ vi.mock('@/features/User/UserLoginOrSignup/Community', () => ({
|
|
24
24
|
default: vi.fn(() => <div>Mocked UserLoginOrSignup</div>),
|
25
25
|
}));
|
26
26
|
|
27
|
+
vi.mock('@/const/version', () => ({
|
28
|
+
isDeprecatedEdition: false,
|
29
|
+
}));
|
30
|
+
|
27
31
|
// 定义一个变量来存储 enableAuth 的值
|
28
32
|
let enableAuth = true;
|
29
33
|
let enableClerk = false;
|
@@ -57,26 +57,6 @@ describe('useCategory', () => {
|
|
57
57
|
|
58
58
|
const { result } = renderHook(() => useCategory(), { wrapper });
|
59
59
|
|
60
|
-
act(() => {
|
61
|
-
const items = result.current;
|
62
|
-
expect(items.some((item) => item.key === 'profile')).toBe(false);
|
63
|
-
expect(items.some((item) => item.key === 'setting')).toBe(true);
|
64
|
-
expect(items.some((item) => item.key === 'data')).toBe(true);
|
65
|
-
expect(items.some((item) => item.key === 'docs')).toBe(true);
|
66
|
-
expect(items.some((item) => item.key === 'feedback')).toBe(true);
|
67
|
-
expect(items.some((item) => item.key === 'changelog')).toBe(true);
|
68
|
-
});
|
69
|
-
});
|
70
|
-
|
71
|
-
it('should return correct items when the user is logged in with Clerk', () => {
|
72
|
-
act(() => {
|
73
|
-
useUserStore.setState({ isSignedIn: true });
|
74
|
-
});
|
75
|
-
enableAuth = true;
|
76
|
-
enableClerk = true;
|
77
|
-
|
78
|
-
const { result } = renderHook(() => useCategory(), { wrapper });
|
79
|
-
|
80
60
|
act(() => {
|
81
61
|
const items = result.current;
|
82
62
|
expect(items.some((item) => item.key === 'profile')).toBe(true);
|
@@ -88,31 +68,6 @@ describe('useCategory', () => {
|
|
88
68
|
});
|
89
69
|
});
|
90
70
|
|
91
|
-
it('should return correct items when the user is logged in with NextAuth', () => {
|
92
|
-
act(() => {
|
93
|
-
useUserStore.setState({
|
94
|
-
isSignedIn: true,
|
95
|
-
enableAuth: () => true,
|
96
|
-
enabledNextAuth: true,
|
97
|
-
});
|
98
|
-
});
|
99
|
-
enableClerk = false;
|
100
|
-
|
101
|
-
const { result } = renderHook(() => useCategory(), { wrapper });
|
102
|
-
|
103
|
-
act(() => {
|
104
|
-
const items = result.current;
|
105
|
-
// Should not render profile for NextAuth, it's Clerk only
|
106
|
-
expect(items.some((item) => item.key === 'profile')).toBe(false);
|
107
|
-
expect(items.some((item) => item.key === 'setting')).toBe(true);
|
108
|
-
expect(items.some((item) => item.key === 'data')).toBe(true);
|
109
|
-
expect(items.some((item) => item.key === 'docs')).toBe(true);
|
110
|
-
expect(items.some((item) => item.key === 'feedback')).toBe(true);
|
111
|
-
expect(items.some((item) => item.key === 'changelog')).toBe(true);
|
112
|
-
expect(items.some((item) => item.key === 'nextauthSignout')).toBe(true);
|
113
|
-
});
|
114
|
-
});
|
115
|
-
|
116
71
|
it('should return correct items when the user is not logged in', () => {
|
117
72
|
act(() => {
|
118
73
|
useUserStore.setState({ isSignedIn: false, enableAuth: () => true });
|
@@ -128,7 +83,6 @@ describe('useCategory', () => {
|
|
128
83
|
expect(items.some((item) => item.key === 'docs')).toBe(true);
|
129
84
|
expect(items.some((item) => item.key === 'feedback')).toBe(true);
|
130
85
|
expect(items.some((item) => item.key === 'changelog')).toBe(true);
|
131
|
-
expect(items.some((item) => item.key === 'nextauthSignout')).toBe(false);
|
132
86
|
});
|
133
87
|
});
|
134
88
|
|
@@ -1,9 +1,11 @@
|
|
1
1
|
'use client';
|
2
2
|
|
3
|
+
import Link from 'next/link';
|
3
4
|
import { useRouter } from 'next/navigation';
|
4
5
|
import { memo } from 'react';
|
5
6
|
import { Flexbox } from 'react-layout-kit';
|
6
7
|
|
8
|
+
import { isDeprecatedEdition } from '@/const/version';
|
7
9
|
import DataStatistics from '@/features/User/DataStatistics';
|
8
10
|
import UserInfo from '@/features/User/UserInfo';
|
9
11
|
import UserLoginOrSignup from '@/features/User/UserLoginOrSignup/Community';
|
@@ -21,21 +23,16 @@ const UserBanner = memo(() => {
|
|
21
23
|
|
22
24
|
return (
|
23
25
|
<Flexbox gap={12} paddingBlock={8}>
|
24
|
-
{!enableAuth ? (
|
26
|
+
{!enableAuth || (enableAuth && isLoginWithAuth) ? (
|
25
27
|
<>
|
26
|
-
<
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
if (enabledNextAuth) return;
|
35
|
-
router.push('/me/profile');
|
36
|
-
}}
|
37
|
-
/>
|
38
|
-
<DataStatistics paddingInline={12} />
|
28
|
+
<Link href={'/profile'} style={{ color: 'inherit' }}>
|
29
|
+
<UserInfo />
|
30
|
+
</Link>
|
31
|
+
{!isDeprecatedEdition && (
|
32
|
+
<Link href={'/profile/stats'} style={{ color: 'inherit' }}>
|
33
|
+
<DataStatistics paddingInline={12} />
|
34
|
+
</Link>
|
35
|
+
)}
|
39
36
|
</>
|
40
37
|
) : (
|
41
38
|
<UserLoginOrSignup
|
@@ -6,7 +6,6 @@ import {
|
|
6
6
|
Download,
|
7
7
|
Feather,
|
8
8
|
FileClockIcon,
|
9
|
-
LogOut,
|
10
9
|
Settings2,
|
11
10
|
} from 'lucide-react';
|
12
11
|
import { useRouter } from 'next/navigation';
|
@@ -28,15 +27,11 @@ export const useCategory = () => {
|
|
28
27
|
const { canInstall, install } = usePWAInstall();
|
29
28
|
const { t } = useTranslation(['common', 'setting', 'auth']);
|
30
29
|
const { showCloudPromotion, hideDocs } = useServerConfigStore(featureFlagsSelectors);
|
31
|
-
const [isLogin, isLoginWithAuth,
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
authSelectors.enabledAuth(s),
|
37
|
-
s.logout,
|
38
|
-
authSelectors.isLoginWithNextAuth(s),
|
39
|
-
]);
|
30
|
+
const [isLogin, isLoginWithAuth, enableAuth] = useUserStore((s) => [
|
31
|
+
authSelectors.isLogin(s),
|
32
|
+
authSelectors.isLoginWithAuth(s),
|
33
|
+
authSelectors.enabledAuth(s),
|
34
|
+
]);
|
40
35
|
|
41
36
|
const profile: CellProps[] = [
|
42
37
|
{
|
@@ -121,20 +116,11 @@ export const useCategory = () => {
|
|
121
116
|
},
|
122
117
|
].filter(Boolean) as CellProps[];
|
123
118
|
|
124
|
-
const nextAuthSignOut: CellProps[] = [
|
125
|
-
{
|
126
|
-
icon: LogOut,
|
127
|
-
key: 'nextauthSignout',
|
128
|
-
label: t('auth:signout'),
|
129
|
-
onClick: signOut,
|
130
|
-
},
|
131
|
-
];
|
132
|
-
|
133
119
|
const mainItems = [
|
134
120
|
{
|
135
121
|
type: 'divider',
|
136
122
|
},
|
137
|
-
...(
|
123
|
+
...(!enableAuth || (enableAuth && isLoginWithAuth) ? profile : []),
|
138
124
|
...(enableAuth ? (isLoginWithAuth ? settings : []) : settingsWithoutAuth),
|
139
125
|
/* ↓ cloud slot ↓ */
|
140
126
|
|
@@ -142,7 +128,6 @@ export const useCategory = () => {
|
|
142
128
|
...(canInstall ? pwa : []),
|
143
129
|
...(isLogin && !isServerMode ? data : []),
|
144
130
|
...(!hideDocs ? helps : []),
|
145
|
-
...(enableAuth && isLoginWithNextAuth ? nextAuthSignOut : []),
|
146
131
|
].filter(Boolean) as CellProps[];
|
147
132
|
|
148
133
|
return mainItems;
|
@@ -1,43 +1,60 @@
|
|
1
1
|
'use client';
|
2
2
|
|
3
|
-
import { LogOut, ShieldCheck, UserCircle } from 'lucide-react';
|
3
|
+
import { ChartColumnBigIcon, LogOut, ShieldCheck, UserCircle } from 'lucide-react';
|
4
4
|
import { useRouter } from 'next/navigation';
|
5
5
|
import { memo } from 'react';
|
6
6
|
import { useTranslation } from 'react-i18next';
|
7
7
|
|
8
8
|
import Cell, { CellProps } from '@/components/Cell';
|
9
|
+
import { isDeprecatedEdition } from '@/const/version';
|
10
|
+
import { ProfileTabs } from '@/store/global/initialState';
|
9
11
|
import { useUserStore } from '@/store/user';
|
12
|
+
import { authSelectors } from '@/store/user/slices/auth/selectors';
|
10
13
|
|
11
14
|
const Category = memo(() => {
|
15
|
+
const [isLogin, enableAuth, isLoginWithClerk, signOut] = useUserStore((s) => [
|
16
|
+
authSelectors.isLogin(s),
|
17
|
+
authSelectors.enabledAuth(s),
|
18
|
+
authSelectors.isLoginWithClerk(s),
|
19
|
+
s.logout,
|
20
|
+
]);
|
12
21
|
const router = useRouter();
|
13
22
|
const { t } = useTranslation('auth');
|
14
|
-
const signOut = useUserStore((s) => s.logout);
|
15
23
|
const items: CellProps[] = [
|
16
24
|
{
|
17
25
|
icon: UserCircle,
|
18
|
-
key:
|
19
|
-
label: t('profile'),
|
26
|
+
key: ProfileTabs.Profile,
|
27
|
+
label: t('tab.profile'),
|
20
28
|
onClick: () => router.push('/profile'),
|
21
29
|
},
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
{
|
29
|
-
type: 'divider',
|
30
|
-
},
|
31
|
-
{
|
32
|
-
icon: LogOut,
|
33
|
-
key: 'logout',
|
34
|
-
label: t('signout', { ns: 'auth' }),
|
35
|
-
onClick: () => {
|
36
|
-
signOut();
|
37
|
-
router.push('/login');
|
30
|
+
enableAuth &&
|
31
|
+
isLoginWithClerk && {
|
32
|
+
icon: ShieldCheck,
|
33
|
+
key: ProfileTabs.Security,
|
34
|
+
label: t('tab.security'),
|
35
|
+
onClick: () => router.push('/profile/security'),
|
38
36
|
},
|
37
|
+
!isDeprecatedEdition && {
|
38
|
+
icon: ChartColumnBigIcon,
|
39
|
+
key: ProfileTabs.Stats,
|
40
|
+
label: t('tab.stats'),
|
41
|
+
onClick: () => router.push('/profile/stats'),
|
39
42
|
},
|
40
|
-
|
43
|
+
enableAuth &&
|
44
|
+
isLogin && {
|
45
|
+
type: 'divider',
|
46
|
+
},
|
47
|
+
enableAuth &&
|
48
|
+
isLogin && {
|
49
|
+
icon: LogOut,
|
50
|
+
key: 'logout',
|
51
|
+
label: t('signout', { ns: 'auth' }),
|
52
|
+
onClick: () => {
|
53
|
+
signOut();
|
54
|
+
router.push('/login');
|
55
|
+
},
|
56
|
+
},
|
57
|
+
].filter(Boolean) as CellProps[];
|
41
58
|
|
42
59
|
return items?.map((item, index) => <Cell key={item.key || index} {...item} />);
|
43
60
|
});
|
@@ -1,13 +1,10 @@
|
|
1
|
-
import { notFound } from 'next/navigation';
|
2
1
|
import { PropsWithChildren } from 'react';
|
3
2
|
|
4
3
|
import MobileContentLayout from '@/components/server/MobileNavLayout';
|
5
|
-
import { enableClerk } from '@/const/auth';
|
6
4
|
|
7
5
|
import Header from './features/Header';
|
8
6
|
|
9
7
|
const Layout = ({ children }: PropsWithChildren) => {
|
10
|
-
if (!enableClerk) return notFound();
|
11
8
|
return <MobileContentLayout header={<Header />}>{children}</MobileContentLayout>;
|
12
9
|
};
|
13
10
|
|
@@ -7,10 +7,10 @@ import { isMobileDevice } from '@/utils/server/responsive';
|
|
7
7
|
import Category from './features/Category';
|
8
8
|
|
9
9
|
export const generateMetadata = async () => {
|
10
|
-
const { t } = await translation('
|
10
|
+
const { t } = await translation('auth');
|
11
11
|
return metadataModule.generate({
|
12
|
-
description: t('
|
13
|
-
title: t('
|
12
|
+
description: t('header.desc'),
|
13
|
+
title: t('header.title'),
|
14
14
|
url: '/me/profile',
|
15
15
|
});
|
16
16
|
};
|
@@ -1,3 +1,3 @@
|
|
1
|
-
import
|
1
|
+
import Loading from '@/components/Loading/BrandTextLoading';
|
2
2
|
|
3
|
-
export default () => <
|
3
|
+
export default () => <Loading />;
|
@@ -1,9 +1,3 @@
|
|
1
|
-
import
|
1
|
+
import Loading from '@/components/Loading/BrandTextLoading';
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
export default () => (
|
6
|
-
<Center height={'90vh'} width={'100%'}>
|
7
|
-
<CircleLoading />
|
8
|
-
</Center>
|
9
|
-
);
|
3
|
+
export default () => <Loading />;
|