Commit Graph

261 Commits

Author SHA1 Message Date
c0mrade
e6f6713b0e fix: batch bug fixes matching backend changes
- Promo code errors: add inactive/not_yet_valid translations (4 locales) + Balance.tsx parser
- Daily 100% discount: render price block when originalDailyPrice > 0
- Webvisor: enable in Yandex Metrika init config
- Referral attribution: consume campaign/referral slugs only after successful auth (all login methods)
- registerWithEmail: consume referral code after success
- AdminSettings: move TARIFF_MODE_SETTINGS to module scope (fix eslint warning)
2026-04-08 18:33:47 +03:00
c0mrade
207af81c95 fix: support 100% discount display + fix Telegram link widget race condition
- formatPrice shows "Бесплатно/Free" when price is 0 (SubscriptionPurchase, Subscription, RenewSubscription)
- Add subscription.free locale key (ru/en/zh/fa)
- Fix TelegramLinkWidget NS_BINDING_ABORTED: move legacy widget callback to ref pattern, remove unstable deps (showToast, t, navigate) from useEffect — prevents iframe destruction on re-render
- Clean up OIDC effect deps
2026-04-03 17:23:38 +03:00
Fringg
222a1239ef feat: add "Add Referral" button to referrals tab
- New search UI in referrals list section to find and bind users
  as this user's referrals (calls assign-referrer on target user)
- Debounced search with cancelled flag and loading state
- Click-outside to close dropdown
- i18n: addReferral, referralAdded keys in all 4 locales
2026-03-29 04:02:40 +03:00
Fringg
e32663f291 feat: add Referrals tab to admin user detail page
- New Рефералы tab with three sections:
  - Referred By: shows who referred this user, assign/remove referrer
  - Stats grid: total referrals, earnings, commission, referral code
  - Referrals list: all referred users with navigate and remove buttons
- User search with debounce for assigning referrer
- Shows warning when selected user already has a referrer
- API methods: assignReferrer, removeReferrer, removeReferral
- i18n translations for all 4 locales (en, ru, zh, fa)
2026-03-29 03:43:47 +03:00
Fringg
21813ef82e feat: redesign admin settings with tree navigation and compact layout
- Replace flat sidebar with collapsible tree groups (7 groups, 52 sub-items)
- Map all 61 backend category keys to sidebar navigation
- Add QuickToggles panel for boolean settings
- Replace card-style SettingRow with compact SettingsTableRow
- Add breadcrumb navigation for tree sub-items
- Add source badges (modified/DB/ENV) on settings
- Implement two-level mobile navigation with group chips
- Add i18n translations for all new keys (en, ru, zh, fa)
2026-03-29 02:38:52 +03:00
Fringg
5d7b94fc48 fix: add i18n keys for Traffic tab, prevent sort mutation
- Add traffic tab/section locale keys to ru, en, zh, fa
- Use spread copy before .sort() to avoid mutating React Query cache
2026-03-28 22:52:30 +03:00
Fringg
0bb064e2c0 feat: redesign admin panel with glass morphism UI, animated background, and stats bar
- Rewrite AdminPanel with cosmic floating orbs background using theme colors
- Add stats bar: uptime, bot version, cabinet version, trial/paid counts from API
- Glass morphism cards with 3D tilt effect (rAF-throttled) and entry animations
- Live search with Cmd+K shortcut, highlight matches, permission-aware filtering
- Register Tailwind `light:` variant for proper light theme support
- Mobile optimizations: reduced orbs (3), lower blur (80px), compact 2-col stats
- Telegram MiniApp safe area support via useTelegramSDK
- Full accessibility: aria-hidden on decorative SVGs, aria-labels, role="status"
- React.memo on StatsBar, GlassCard, CosmosBackground for render performance
- Memo-stable section refs via Set<id> pattern to preserve GlassCard memo during search
- i18n keys added to all 4 locales (ru, en, zh, fa)
2026-03-28 21:17:51 +03:00
Fringg
aa989a6ade feat: add subscription selector to admin sync tab for multi-tariff
- Add subscription dropdown to sync tab when user has 2+ subscriptions
- Pass subscription_id to getSyncStatus, syncFromPanel, syncToPanel
- loadSyncStatus re-fetches when selected subscription changes
- Show tariff name in UUID info section from API response
- Add selectSubscription i18n keys to all 4 locales
2026-03-28 19:50:10 +03:00
c0mrade
a50c06c101 feat: add Remnawave panel 2.7.0 support
- Add MONTH_ROLLING traffic reset mode (button, locales: ru/en/zh/fa)
- Add NodeInfo config_profile and active_plugin_uuid fields
- Update bandwidth display: remove /s suffix, label as Inbound Traffic
- Update tariffs.ts type comment with MONTH_ROLLING
2026-03-28 12:35:47 +03:00
Fringg
be7219ec06 feat: add delete buttons for categories and tags in combobox dropdown
- Add onDelete prop to ColoredItemCombobox with X button per item
- Wire up deleteCategory/deleteTag API calls in AdminNewsCreate
- Auto-clear selection if the deleted item was selected
- Spinner on delete, haptic feedback, i18n aria-label
2026-03-23 15:48:27 +03:00
Fringg
2ae01c95ae feat: add category/tag management UI with ColoredItemCombobox
- ColoredItemCombobox component with search, color swatches, inline creation
- Replace text inputs with combobox dropdowns for category and tag selection
- API methods for categories/tags CRUD
- TypeScript types for NewsCategory, NewsTag
- i18n keys for combobox (ru, en)
2026-03-23 15:30:02 +03:00
Fringg
723591e5c3 feat: add media upload to news editor with drag-drop, paste, and file picker
Upload images/videos directly to server from editor. DOMPurify video
sanitization, XSS protection, upload cancellation on unmount.
2026-03-23 11:58:18 +03:00
Fringg
38b0f4be9a fix: add news link to admin panel, prevent empty news section flash
- Add News item to marketing group in AdminPanel with NewspaperIcon
- Add news nav/panel translations for all 4 locales (ru, en, zh, fa)
- Don't render NewsSection until query confirms articles exist
- Remove skeleton that caused brief flash when news list is empty
2026-03-23 11:21:25 +03:00
Fringg
74e6d52fee fix: news feature security, accessibility, performance improvements
- DOMPurify strict allowlist with sandbox on iframes
- safeColor() CSS injection prevention for category_color
- URL validation (http/https) for images and links
- encodeURIComponent for slug in API calls
- Keyboard navigation on news cards (Enter/Space)
- aria-label, aria-pressed, type=button on all buttons
- 44px touch targets on remaining buttons
- memo() wrappers + stable callbacks (fewer re-renders)
- Canvas draw call batching (~75% reduction)
- TipTap extensions useMemo deps fix ([t] -> [])
- Featured image loading=eager fetchPriority=high (LCP)
- Unsafe Number(id) NaN guard
2026-03-23 11:09:52 +03:00
Fringg
99fc33625e feat: add news section with admin editor and public article view
- NewsSection with animated grid background, category filters, featured cards
- AdminNews list page with toggle publish/featured, pagination
- AdminNewsCreate with TipTap rich text editor, URL validation
- NewsArticle detail page with DOMPurify sanitization, Telegram back button
- Toggle component with WCAG 44px touch targets, role=switch
- Prose styles for highlight marks and responsive iframes
- i18n translations (en, ru, zh, fa)
2026-03-23 10:49:46 +03:00
Fringg
5b12784ab8 feat: show subscription revenue and referral earnings in network stats
Add subscription revenue (total from subscription payments) to the
stats panel alongside referral earnings. Layout updated to 2-column
grid with subscription revenue highlighted in accent color.
2026-03-22 10:31:29 +03:00
Fringg
cc64f7b8ea fix: rename "Regular user" to "No subscription" in legend
The gray color in the referral network legend represents users without
a subscription, not "regular/organic" users. Updated labels in all
4 locales (en, ru, fa, zh) to reflect this.
2026-03-22 09:51:43 +03:00
Fringg
b18f3fb211 feat: add fill+border dual-color nodes, radial layout, and dark labels
Node fill color now encodes subscription status (paid/trial active/expired),
while border color indicates referral role (partner/top/active referrer).
Added BFS-based radial initial positioning to spread referral branches outward.
Updated legend with two sections and adjusted FA2 gravity for less clustering.
2026-03-22 09:25:23 +03:00
Fringg
b289ea9c23 feat: color-code referral network nodes by subscription status
Add subscription status colors: green (paid active), blue (trial active),
red (paid expired), orange (trial expired). Extract NODE_COLORS constant
as single source of truth. Add SubscriptionStatus union type. Show status
badge in user detail panel. Add i18n for all 4 locales.
2026-03-22 09:07:32 +03:00
Fringg
8e59af96c5 fix: superadmin assignments show ENV badge, block UI revoke
Superadmin role (level 999) is managed via env config only. Hide X
button for superadmin assignments and show ENV badge instead. Filter
superadmin from assignable roles dropdown. Add envManaged translation
to all 4 locales.
2026-03-22 08:41:41 +03:00
Fringg
76c9d6448a feat: add QR code and command to deeplink auth fallback, fix polling on tab return 2026-03-22 05:16:56 +03:00
Fringg
86d997d01d feat: custom broadcast buttons UI and fix stale mediaType bug
- Add inline custom button editor (no popups): label, type
  (callback/URL), action value with byte-level validation
- Frontend validates callback_data in UTF-8 bytes via TextEncoder
- URLs restricted to https:// and tg:// matching backend
- Form wrapped in <form> for Enter key submit support
- Fix pre-existing stale mediaType bug in file upload handler
- Translations added for ru, en, zh, fa locales
2026-03-22 01:54:38 +03:00
Fringg
2780898d1c fix: scope selector UX, ARIA, and code quality improvements
- removeScope preserves graph state when items remain (only resets on empty)
- Extract shared CheckIcon, CloseIcon, Spinner, ScopeListItem components
- Unify three handleSelect* into single handleToggle
- Fix shared mutable Set in reset state (factory function)
- Add MAX_SCOPE_ITEMS UI feedback (disabled button, warning banner)
- Correct ARIA: dialog > tablist + listbox > option structure
- Event listeners only attached when dropdown is open
- isSelected uses Set lookup via useMemo instead of O(n) scan
- Clear user search only on add, not on deselect
2026-03-20 02:44:29 +03:00
Fringg
db76cd0c64 feat: multi-select scope for referral network graph
Replace single-select scope with multi-select supporting multiple
campaigns, partners, and users simultaneously. Chips UI with remove
buttons, clear-all, sorted query keys for cache stability.
2026-03-20 02:31:11 +03:00
Fringg
a6faf702ec feat: redesign referral network with scope selector
- Replace full graph with scoped view (campaign/partner/user)
- ScopeSelector component with tabs and searchable dropdown
- Store resets all state on scope change (selection, hover, filters)
- Remove dead NetworkSearch component and graphInstance globals
- i18n keys for scope selector in all 4 locales
2026-03-20 01:50:09 +03:00
Fringg
2adb0047dd feat: add partner → campaign edges with distinct color to referral network 2026-03-20 01:17:01 +03:00
Fringg
235eaec85f feat: add referral network graph visualization page
Interactive Sigma.js + graphology graph with ForceAtlas2 web worker
layout, campaign/user node coloring, filters via nodeReducer pattern,
search highlighting, user/campaign detail side panels, and 4-locale
translations. Dependencies: sigma v3, graphology, graphology-layout-forceatlas2.
2026-03-19 07:56:01 +03:00
Fringg
84f0e4e9b4 feat: add media attachment support for admin ticket replies
Admin can now attach photos, videos, and documents when replying to
tickets. Upload happens on file selection via existing media upload
endpoint. Includes attachment preview with type-specific icons,
upload progress, error handling, race condition protection, and
proper blob URL lifecycle management.

Added video player rendering for video attachments in message thread.
Updated ticket list preview to show [media_type] for media-only messages.
2026-03-19 06:39:05 +03:00
Fringg
a3a6fad9b7 feat: display manual admin top-ups in sales statistics 2026-03-18 22:41:02 +03:00
Fringg
df73b3f77e feat: редизайн страницы платежей в админке — поиск, фильтры, статистика
Поиск по инвойсу/клиенту, фильтры по статусу/периоду/методу, карточки статистики,
кастомный диапазон дат, обработка ошибок, локализация на 4 языка.
2026-03-18 05:40:56 +03:00
Fringg
914a802c1b fix: добавлена подпись «Стоимость вращения» к блоку оплаты спина 2026-03-18 04:35:32 +03:00
Fringg
8636bd7659 feat: блокировка кнопки устройств при лимите + убраны дубли трафика
- Кнопка «Подключить устройство» заблокирована при достижении лимита
- Haptic feedback при нажатии на заблокированную кнопку
- Предупреждение «Отключите устройства для подключения новых»
- Убран дублирующийся текст трафика под прогресс-баром (безлимит)
2026-03-18 04:21:34 +03:00
Fringg
246fafdbfc feat: добавлена поддержка SeverPay в кабинете
- Иконка SeverPay (синий градиент, SP)
- Лейбл в paymentMethods
- Статус decline в FAILED_STATUSES
- Локализация (ru, en, fa, zh)
2026-03-18 03:49:36 +03:00
Fringg
6a1a9f5db7 feat: deep link авторизация при блокировке oauth.telegram.org
Добавлен fallback через бота когда виджет Telegram не загружается:
- Таймаут 8 сек на загрузку скрипта (OIDC + legacy)
- Автоматический переход на deep link auth
- Polling каждые 2.5 сек до подтверждения в боте
- ConnectedAccounts: таймаут + сообщение при недоступности
- Переводы: ru, en, zh, fa
2026-03-17 21:29:21 +03:00
Fringg
e023373f56 feat: dual referral links UI (bot + cabinet) with independent copy states
- add bot referral link section with Telegram icon (conditionally rendered)
- add cabinet referral link section with chain-link icon
- independent copy button state per link type
- add bot_referral_link to ReferralInfo type
- add i18n keys: botLink, cabinetLink in ru/en/fa/zh
2026-03-15 01:14:25 +03:00
Fringg
b4f9f332cf feat: add LIMITED subscription status support with traffic-exhausted UX
- Add is_limited to Subscription type
- Show yellow traffic-exhausted badge on Subscription and AdminUsers pages
- SubscriptionCardExpired: amber theme with warning icon and buy-traffic CTA for limited
- Dashboard: route limited subscriptions to SubscriptionCardExpired
- Subscription page: show additional options (buy traffic) for limited subs
- Use is_limited boolean instead of status string comparison
- Add trafficLimited translations for ru, en, zh, fa
- AdminUserDetail StatusBadge: add limited yellow styling
2026-03-12 18:37:22 +03:00
Fringg
5a5a987893 feat: add show_in_gift toggle UI for tariffs in admin panel
Add pill toggle in tariff create/edit form and purple gift badge
in tariff list. Includes i18n for ru, en, zh, fa locales.
2026-03-12 04:16:04 +03:00
Fringg
695ab42e03 feat: add gifts tab to admin user detail page
Display sent and received gift subscriptions with status badges,
extracted GiftCard component, and full i18n support (ru/en/zh/fa).
2026-03-11 03:30:13 +03:00
Fringg
8b056e0b46 fix: hide Quick Renew for expired trial subscriptions
Show only Tariffs button as primary CTA when trial expires.
Remove duplicate gift.copyMessage i18n keys.
2026-03-10 20:33:31 +03:00
firewookie
8c9eadc273 FIX PR Problems 2026-03-10 15:58:02 +05:00
FireWookie
798c702704 Merge pull request #1 from FireWookie/dev
Dev
2026-03-10 15:11:31 +05:00
FireWookie
377513d782 Merge branch 'BEDOLAGA-DEV:main' into dev_nikita 2026-03-10 15:08:17 +05:00
Fringg
39bdf8b5c3 fix: CopiedToast not visible due to CSS transform context
Use createPortal to render toast at document.body level,
escaping framer-motion's transform on the tab content wrapper.
Remove unused useRef import and shareToastTapCopy i18n key.
2026-03-10 07:39:04 +03:00
Fringg
0322974ebd fix: replace orphaned shareModal i18n keys in GiftResult
GiftResult.tsx referenced gift.shareModalCopied and shareModalCopyAll
which were removed with the modal. Use common.copied and add new
gift.copyMessage key instead.
2026-03-10 07:30:17 +03:00
Fringg
9fbfcf21ff refactor: replace share modal with auto-copy toast
Remove the full-screen ShareModal dialog that appeared when sharing a
gift code. Replace with a bottom toast that automatically copies the
share message to clipboard on button press and slides up from the
bottom. The toast auto-dismisses after 5 seconds and can be tapped
to copy again.
2026-03-10 07:27:39 +03:00
Fringg
7549ae70eb feat: show localized error for self-activation attempt 2026-03-10 06:45:14 +03:00
Fringg
51ec799c0c feat: split my gifts into Active/Activated/Received sections
Sent gifts are now sorted into "Active gifts" (awaiting activation)
and "Activated" (already used). Received gifts remain separate.
2026-03-10 06:39:50 +03:00
Fringg
1bafcca1ef fix: gift UI improvements — declension, GB display, share modal, deep links
- Fix Russian device count declension (_one/_few/_many)
- Show traffic GB and tariff description in buy tab
- Replace copy/share buttons with share modal (bot + cabinet links)
- GiftResult: code-only success state with formatted share message
- Support ?tab=activate&code=TOKEN for auto-activation via cabinet link
- Add is_code_only + purchase_token to API types
2026-03-10 06:03:28 +03:00
Fringg
af3e535c69 feat: gift subscription redesign — code-only purchase + 3-tab UI
- Remove recipient input from buy flow (code-only gifts)
- 3-tab UI: Buy, Activate, My Gifts with animations
- After purchase, switch to My Gifts tab to show gift code
- Gift code display with copy/share buttons
- Activate tab: enter gift code to activate subscription
- My Gifts tab: sent/received gifts with status badges
- Fix: use navigator.language instead of hardcoded ru-RU for dates
- Fix: spread array before sort to prevent React Query cache mutation
- Fix: ARIA tab linkage with proper id/aria-labelledby
- Fix: guard VITE_BOT_USERNAME against undefined in share URLs
- Fix: wrap clipboard/share fallbacks in try/catch
- Add error state to MyGiftsTabContent
2026-03-10 05:37:57 +03:00
Fringg
ea06ad1d8f fix: show fallback when tariff has no available periods for renewal
When all periods are removed from a tariff, users saw an empty
purchase form with no way to renew. Now shows a message explaining
the situation and a button to choose a different tariff.
2026-03-10 01:27:48 +03:00