feat: Move notification settings to user profile and add i18n support

- Move notification config from system settings (.env) to user profile (database)
- Add user-specific notification settings API endpoints (GET/PUT /api/user/notification-settings)
- Add notification_settings column to qd_users table
- Update portfolio and trading-assistant to use profile notification settings
- Add notification settings UI in profile page with all channels (browser, telegram, email, phone, discord, webhook)
- Add i18n translations for notification settings in 10 languages
- Fix timestamp parsing in TradingRecords and portfolio (handle both ISO strings and Unix timestamps)
- Fix header icons alignment for mobile responsive layout
- Fix equity curve timestamp bug (handle datetime objects properly)
- Remove unused login.js exports and clean up user.js store
- Remove husky, commitlint and other dev dependencies
- Clean up env.example by removing user-specific notification params
- Update signal_notifier to prioritize user-specific tokens over global env vars
This commit is contained in:
Jinyu Xu
2026-01-17 01:37:32 +07:00
parent 10ad20abf6
commit c5d000e1c9
33 changed files with 1209 additions and 24317 deletions
+35
View File
@@ -2315,6 +2315,41 @@ const locale = {
'profile.referral.noReferrals': '暂无邀请记录',
'profile.referral.shareNow': '立即分享邀请',
// Profile - Notification Settings (通知设置)
'profile.notifications.title': '通知设置',
'profile.notifications.hint': '配置您的默认通知方式,在创建资产监控和预警时将自动使用这些设置',
'profile.notifications.defaultChannels': '默认通知渠道',
'profile.notifications.browser': '站内通知',
'profile.notifications.email': '邮件',
'profile.notifications.phone': '短信',
'profile.notifications.telegramBotToken': 'Telegram Bot Token',
'profile.notifications.telegramBotTokenPlaceholder': '请输入您的 Telegram Bot Token',
'profile.notifications.telegramBotTokenHint': '通过 @BotFather 创建机器人获取 Token',
'profile.notifications.telegramChatId': 'Telegram Chat ID',
'profile.notifications.telegramPlaceholder': '请输入您的 Telegram Chat ID(如 123456789',
'profile.notifications.telegramHint': '发送 /start 给 @userinfobot 可获取您的 Chat ID',
'profile.notifications.notifyEmail': '通知邮箱',
'profile.notifications.emailPlaceholder': '接收通知的邮箱地址',
'profile.notifications.emailHint': '默认使用账户邮箱,可设置其他邮箱接收通知',
'profile.notifications.phonePlaceholder': '请输入手机号(如 +8613800138000',
'profile.notifications.phoneHint': '需要管理员配置 Twilio 服务后才能使用短信通知',
'profile.notifications.discordWebhook': 'Discord Webhook',
'profile.notifications.discordPlaceholder': 'https://discord.com/api/webhooks/...',
'profile.notifications.discordHint': '在 Discord 服务器设置中创建 Webhook',
'profile.notifications.webhookUrl': 'Webhook URL',
'profile.notifications.webhookPlaceholder': 'https://your-server.com/webhook',
'profile.notifications.webhookHint': '自定义 Webhook 地址,将以 POST JSON 方式推送通知',
'profile.notifications.webhookToken': 'Webhook Token(可选)',
'profile.notifications.webhookTokenPlaceholder': '用于验证请求的 Bearer Token',
'profile.notifications.webhookTokenHint': '将作为 Authorization: Bearer Token 发送到 Webhook',
'profile.notifications.testBtn': '发送测试通知',
'profile.notifications.saveSuccess': '通知设置保存成功',
'profile.notifications.selectChannel': '请至少选择一个通知渠道',
'profile.notifications.fillTelegramToken': '请填写 Telegram Bot Token',
'profile.notifications.fillTelegram': '请填写 Telegram Chat ID',
'profile.notifications.fillEmail': '请填写通知邮箱',
'profile.notifications.testSent': '测试通知已发送,请检查您的通知渠道',
// User Manage - Credits & VIP
'userManage.credits': '积分',
'userManage.adjustCredits': '调整积分',