Skip to content

Commit

Permalink
✨ feat: add User Stats and Refactor Profile (lobehub#5149)
Browse files Browse the repository at this point in the history
* ♻️ refactor: Refactor Profile

* ✅ test: Fix test

* ✨ feat: Update nextAuth profile

* ♻️ refactor: Refactor hook

* 💄 style: Update style

* ✅ test: Fix test

* 💄 style: Update sats services

* ♻️ refactor: Server service arrow function

* ✨ feat: Add Rank

* ♻️ refactor: rebase

* ♻️ refactor: rebase

* ✨ feat: Add heatmap

* ♻️ refactor: refactor to support upload user profile in next-auth

* 💄 style: Update Stats style

* 📝 docs: Update i18n

* Revert "♻️ refactor: refactor to support upload user profile in next-auth"

This reverts commit d479ec3.

* ✨ feat: Add Welcome

* 💄 style: Update stats style

* 💄 style: Update stats style

* ✨ feat: Add Share Modal

* 🔧 chore: Update i18n

* upgrade

* upgrade

* 💄 style: Update Share style

* ✅ test: Fix test

* 💄 style: Update Modal Loading

* ✨ feat: Add Model Usage Rank

* add test and fix some

* 🐛 fix: Fix Valid Date

* 🐛 fix: Fix test

* ✅ test: Fix rank order

* 🐛 fix: Fix mobile

* 💄 style: Update BrandLoading

* 💄 style: Update moible AiHeatmaps style

* 💄 style: Add Inbox

* 📝 docs: Add Changelog

* 📝 docs: Fix typo

* ✅ test: Fix test

* 📝 docs: Update Changelog

* fix

---------

Co-authored-by: arvinxx <[email protected]>
  • Loading branch information
canisminor1990 and arvinxx authored Jan 3, 2025
1 parent 301a945 commit cbc219c
Show file tree
Hide file tree
Showing 137 changed files with 5,049 additions and 716 deletions.
1 change: 1 addition & 0 deletions docs/.cdn.cache.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"https://github.com/user-attachments/assets/29508dda-2382-430f-bc81-fb23f02149f8": "/blog/assets/29b13dc042e3b839ad8865354afe2fac.webp",
"https://github.com/user-attachments/assets/2a4116a7-15ad-43e5-b801-cc62d8da2012": "/blog/assets/37d85fdfccff9ed56e9c6827faee01c7.webp",
"https://github.com/user-attachments/assets/385eaca6-daea-484a-9bea-ba7270b4753d": "/blog/assets/d6129350de510a62fe87b2d2f0fb9477.webp",
"https://github.com/user-attachments/assets/3d80e0f5-d32a-4412-85b2-e709731460a0": "/blog/assets2d409f43b58953ad5396c6beab8a0719.webp",
"https://github.com/user-attachments/assets/484f28f4-017c-4ed7-948b-4a8d51f0b63a": "/blog/assets/5bbb4b421d6df63780b3c7a05f5a102d.webp",
"https://github.com/user-attachments/assets/533f7a5e-8a93-4a57-a62f-8233897d72b5": "/blog/assets/9498087e85f27e692716a63cb3b58d79.webp",
"https://github.com/user-attachments/assets/6069332b-8e15-4d3c-8a77-479e8bc09c23": "/blog/assets/603fefbb944bc6761ebdab5956fc0084.webp",
Expand Down
27 changes: 27 additions & 0 deletions docs/changelog/2025-01-03-user-profile.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
title: LobeChat Supports User Data Statistics and Activity Sharing
description: >-
LobeChat now supports multi-dimensional user data statistics and activity
sharing
---

# User Data Statistics and Activity Sharing 💯

Want to know about your activity performance on LobeChat?

Now, you can comprehensively understand your AI data through the statistics feature, and even generate personal activity sharing images to share your LobeChat activity with friends.

## 📊 Data Statistics

- **Statistics**: Number of Assistants / Topics / Messages / Total Word Count
- **Rankings**:
- Model Usage Rate `Top 10`
- Assistant Usage Rate `Top 10`
- Topic Content Volume `Top 10`
- **Heat Map**: Activity distribution over the past year
- **User Activity Sharing**: Generate personal activity sharing images

## 👉 How to Use

1. Requires `PgLite` or `Database` mode
2. Click on your profile picture to enter "Account" - "Data Statistics" page
26 changes: 26 additions & 0 deletions docs/changelog/2025-01-03-user-profile.zh-CN.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
title: LobeChat 支持用户数据统计与活跃度分享
description: LobeChat 现已支持多维度用户数据统计与活跃度分享
---

# 用户数据统计与活跃度分享 💯

想要了解自己在 LobeChat 上的活跃度表现吗?

现在,您可以通过数据统计功能,全方位了解自己的 AI 数据,还可以生成个人活跃度分享图片,与好友分享您在 LobeChat 上的活跃度。

## 📊 数据统计

- **数据统计**: 助手数 / 话题数 / 消息数 / 累计字数
- **排行版**:
- 模型使用率 `Top 10`
- 助手使用率 `Top 10`
- 话题内容量 `Top 10`
- **热力图**: 过去一年内的活跃度分布
- **用户活跃度分享**: 生成个人活跃度分享图片

## 👉 使用方式

1. 需要使用 `PgLite``数据库` 模式
2. 点击个人头像进入「账户管理」-「数据统计」页面

5 changes: 5 additions & 0 deletions docs/changelog/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
"$schema": "https://github.com/lobehub/lobe-chat/blob/main/docs/changelog/schema.json",
"cloud": [],
"community": [
{
"image": "https://github.com/user-attachments/assets/3d80e0f5-d32a-4412-85b2-e709731460a0",
"id": "2025-01-03-user-profile",
"date": "2025-01-03"
},
{
"image": "https://github.com/user-attachments/assets/2048b4c2-4a56-4029-acf9-71e35ff08652",
"id": "2024-11-27-forkable-chat",
Expand Down
4 changes: 3 additions & 1 deletion docs/self-hosting/advanced/auth/next-auth/wechat.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
title: Configure Wechat Authentication Service in LobeChat
description: Learn how to configure Wechat authentication service in LobeChat, including creating a new Wechat App, setting permissions, and environment variables.
description: >-
Learn how to configure Wechat authentication service in LobeChat, including
creating a new Wechat App, setting permissions, and environment variables.
tags:
- Wechat Authentication
- Wechat App
Expand Down
4 changes: 2 additions & 2 deletions docs/self-hosting/advanced/auth/next-auth/wechat.zh-CN.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
title: 在 LobeChat 中配置微信身份验证服务
description: 学习如何在 LobeChat 中配置微信身份验证服务,包括创建新的微信网站应用、设置权限和环境变量。
tags:
-微信身份验证
-微信网站应用
- 微信身份验证
- 微信网站应用
- 环境变量配置
- 单点登录
- LobeChat
Expand Down
80 changes: 76 additions & 4 deletions locales/ar/auth.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,80 @@
{
"date": {
"prevMonth": "الشهر الماضي",
"recent30Days": "آخر 30 يومًا"
},
"header": {
"desc": "إدارة معلومات حسابك.",
"title": "الحساب"
},
"heatmaps": {
"legend": {
"less": "غير نشط",
"more": "نشط"
},
"months": {
"apr": "أبريل",
"aug": "أغسطس",
"dec": "ديسمبر",
"feb": "فبراير",
"jan": "يناير",
"jul": "يوليو",
"jun": "يونيو",
"mar": "مارس",
"may": "مايو",
"nov": "نوفمبر",
"oct": "أكتوبر",
"sep": "سبتمبر"
},
"tooltip": "{{date}} أرسل {{count}} رسائل في ذلك اليوم",
"totalCount": "إجمالي {{count}} رسائل أرسلت في العام الماضي"
},
"login": "تسجيل الدخول",
"loginOrSignup": "تسجيل الدخول / التسجيل",
"profile": "الملف الشخصي",
"security": "الأمان",
"loginOrSignup": "تسجيل الدخول / الاشتراك",
"profile": {
"avatar": "الصورة الشخصية",
"email": "عنوان البريد الإلكتروني",
"username": "اسم المستخدم"
},
"signout": "تسجيل الخروج",
"signup": "التسجيل"
"signup": "الاشتراك",
"stats": {
"aiheatmaps": "مؤشر النشاط",
"assistants": "المساعدون",
"assistantsRank": {
"left": "المساعد",
"right": "المواضيع",
"title": "ترتيب استخدام المساعد"
},
"createdAt": "تاريخ التسجيل",
"days": "أيام",
"empty": {
"desc": "يرجى تجميع المزيد من بيانات الدردشة للعرض",
"title": "لا توجد بيانات"
},
"lastYearActivity": "النشاط في العام الماضي",
"messages": "رسائل",
"modelsRank": {
"left": "النموذج",
"right": "الرسائل",
"title": "ترتيب استخدام النموذج"
},
"share": {
"title": "مؤشر نشاط الذكاء الاصطناعي الخاص بي"
},
"topics": "المواضيع",
"topicsRank": {
"left": "الموضوع",
"right": "الرسائل",
"title": "ترتيب محتوى الموضوع"
},
"updatedAt": "تاريخ التحديث",
"welcome": "{{username}}، هذا هو يومك <span>{{days}}</span> مع {{appName}}",
"words": "كلمات"
},
"tab": {
"profile": "الملف الشخصي",
"security": "الأمان",
"stats": "الإحصائيات"
}
}
78 changes: 75 additions & 3 deletions locales/bg-BG/auth.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,80 @@
{
"date": {
"prevMonth": "Миналия месец",
"recent30Days": "Последните 30 дни"
},
"header": {
"desc": "Управлявайте информацията за вашия акаунт.",
"title": "Акаунт"
},
"heatmaps": {
"legend": {
"less": "Неактивен",
"more": "Активен"
},
"months": {
"apr": "Апр",
"aug": "Авг",
"dec": "Дек",
"feb": "Фев",
"jan": "Ян",
"jul": "Юл",
"jun": "Юн",
"mar": "Мар",
"may": "Май",
"nov": "Ное",
"oct": "Окт",
"sep": "Сеп"
},
"tooltip": "{{date}} изпратил(а) {{count}} съобщения този ден",
"totalCount": "Общо {{count}} съобщения изпратени през последната година"
},
"login": "Вход",
"loginOrSignup": "Вход / Регистрация",
"profile": "Профил",
"security": "Сигурност",
"profile": {
"avatar": "Аватар",
"email": "Имейл адрес",
"username": "Потребителско име"
},
"signout": "Изход",
"signup": "Регистрация"
"signup": "Регистрация",
"stats": {
"aiheatmaps": "Индекс на активност",
"assistants": "Асистенти",
"assistantsRank": {
"left": "Асистент",
"right": "Тематики",
"title": "Ранг на използване на асистенти"
},
"createdAt": "Регистриран на",
"days": "дни",
"empty": {
"desc": "Моля, натрупайте повече данни от чат, за да видите",
"title": "Няма данни"
},
"lastYearActivity": "активност през последната година",
"messages": "Съобщения",
"modelsRank": {
"left": "Модел",
"right": "Съобщения",
"title": "Ранг на използване на модели"
},
"share": {
"title": "Моят индекс на активност с ИИ"
},
"topics": "Тематики",
"topicsRank": {
"left": "Тематика",
"right": "Съобщения",
"title": "Ранг на съдържание на тематики"
},
"updatedAt": "Актуализиран на",
"welcome": "{{username}}, това е вашият <span>{{days}}</span> ден с {{appName}}",
"words": "Думи"
},
"tab": {
"profile": "Профил",
"security": "Сигурност",
"stats": "Статистика"
}
}
84 changes: 78 additions & 6 deletions locales/de-DE/auth.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,80 @@
{
"login": "Anmelden",
"loginOrSignup": "Anmelden / Registrieren",
"profile": "Profil",
"security": "Sicherheit",
"signout": "Abmelden",
"signup": "Registrieren"
"date": {
"prevMonth": "Letzter Monat",
"recent30Days": "Letzte 30 Tage"
},
"header": {
"desc": "Verwalten Sie Ihre Kontoinformationen.",
"title": "Konto"
},
"heatmaps": {
"legend": {
"less": "Inaktiv",
"more": "Aktiv"
},
"months": {
"apr": "Apr",
"aug": "Aug",
"dec": "Dez",
"feb": "Feb",
"jan": "Jan",
"jul": "Jul",
"jun": "Jun",
"mar": "Mär",
"may": "Mai",
"nov": "Nov",
"oct": "Okt",
"sep": "Sep"
},
"tooltip": "{{date}} hat {{count}} Nachrichten an diesem Tag gesendet",
"totalCount": "Insgesamt wurden {{count}} Nachrichten im letzten Jahr gesendet"
},
"login": "Einloggen",
"loginOrSignup": "Einloggen / Registrieren",
"profile": {
"avatar": "Avatar",
"email": "E-Mail-Adresse",
"username": "Benutzername"
},
"signout": "Ausloggen",
"signup": "Registrieren",
"stats": {
"aiheatmaps": "Aktivitätsindex",
"assistants": "Assistenten",
"assistantsRank": {
"left": "Assistent",
"right": "Themen",
"title": "Rang der Assistentennutzung"
},
"createdAt": "Registriert am",
"days": "Tage",
"empty": {
"desc": "Bitte sammeln Sie mehr Chatdaten, um sie anzuzeigen",
"title": "Keine Daten"
},
"lastYearActivity": "Aktivität im letzten Jahr",
"messages": "Nachrichten",
"modelsRank": {
"left": "Modell",
"right": "Nachrichten",
"title": "Rang der Modellenutzung"
},
"share": {
"title": "Mein AI Aktivitätsindex"
},
"topics": "Themen",
"topicsRank": {
"left": "Thema",
"right": "Nachrichten",
"title": "Rang des Themeninhalts"
},
"updatedAt": "Aktualisiert am",
"welcome": "{{username}}, dies ist Ihr <span>{{days}}</span> Tag mit {{appName}}",
"words": "Wörter"
},
"tab": {
"profile": "Profil",
"security": "Sicherheit",
"stats": "Statistiken"
}
}
Loading

0 comments on commit cbc219c

Please sign in to comment.