feat: add multi-channel subscription blocking UI and admin management

- Channel subscription blocking screen with per-channel status display
- Safe URL handling with protocol validation (no open redirect)
- Race-condition-safe subscription check with useRef guard
- Admin channel management page with create, toggle, delete
- Error handlers on all admin mutations with haptic feedback
- Proper type guard for channel subscription error detection
- Accessibility: aria-labels on icon-only buttons
- Localization: en, ru, zh, fa translations
This commit is contained in:
Fringg
2026-02-24 02:50:52 +03:00
parent 8ea9a1d6a0
commit a767fe96d3
12 changed files with 758 additions and 113 deletions

View File

@@ -741,7 +741,8 @@
"updates": "更新",
"pinnedMessages": "置顶消息",
"partners": "合作伙伴",
"withdrawals": "提现"
"withdrawals": "提现",
"channelSubscriptions": "必订频道"
},
"panel": {
"title": "管理面板",
@@ -768,7 +769,8 @@
"updatesDesc": "机器人和面板版本",
"pinnedMessagesDesc": "管理用户置顶消息",
"partnersDesc": "管理合作伙伴申请和佣金",
"withdrawalsDesc": "审核和处理提现请求"
"withdrawalsDesc": "审核和处理提现请求",
"channelSubscriptionsDesc": "管理必订频道订阅"
},
"trafficUsage": {
"title": "流量使用",
@@ -1052,6 +1054,28 @@
"editMessage": "编辑",
"cantDeleteActive": "无法删除活跃消息"
},
"channelSubscriptions": {
"title": "必订频道",
"subtitle": "用户必须订阅这些频道",
"addChannel": "添加频道",
"empty": "未配置频道",
"enabled": "已启用",
"disabled": "已禁用",
"enable": "启用",
"disable": "禁用",
"delete": "删除",
"deleteConfirm": "删除此频道?",
"sortOrder": "排序",
"form": {
"title": "显示名称",
"channelId": "频道ID",
"channelIdHint": "@username 或 -100XXXXXXXXXX",
"channelLink": "频道链接",
"channelLinkHint": "https://t.me/channel",
"submit": "添加",
"cancel": "取消"
}
},
"settings": {
"title": "系统设置",
"allCategories": "所有分类",
@@ -2640,7 +2664,9 @@
"waitSeconds": "请等待 {{seconds}} 秒",
"hint": "订阅后点击检查按钮",
"notSubscribed": "您还没有订阅该频道",
"checkError": "检查失败。请稍后重试。"
"checkError": "检查失败。请稍后重试。",
"subscribed": "已订阅",
"channelsRequired": "请订阅以下所有频道以继续"
},
"blacklisted": {
"title": "访问被拒绝",