Commit Graph

1051 Commits

Author SHA1 Message Date
Fringg
de97a030d2 fix: rewrite 5 broken background components from Aceternity sources
- Aurora: remove invert filter (broken on dark bg), use dark gradient directly
- Beams: use animated linearGradient positions instead of pathLength animation
- Beams Collision: add collision detection, explosion particles, AnimatePresence
- Gemini Effect: rewrite as SVG motion.path with animated pathLength (was canvas)
- Noise: change mixBlendMode from overlay to screen (overlay invisible on dark bg)
2026-02-25 07:31:16 +03:00
Fringg
1a702a68b9 feat: replace animated backgrounds with Aceternity UI system
- Add 16 animated background components (aurora, sparkles, vortex, shooting-stars,
  beams, beams-collision, gradient-animation, wavy, lines, boxes, meteors, grid,
  dots, spotlight, noise, ripple, gemini-effect)
- Add full admin BackgroundEditor with live preview, type gallery, per-type settings
- Add BackgroundRenderer with lazy loading, localStorage cache, mobile reduction
- Add input sanitization (sanitizeColor, clampNumber) across all components
- Add translations for en, ru, zh, fa locales
- Remove old Aurora (WebGL/OGL) and AnimatedBackground (CSS wave-blob)
- Remove ogl dependency, add simplex-noise
2026-02-25 07:12:59 +03:00
Fringg
78e70992f1 fix: replace broken modal with inline confirmation for role revoke 2026-02-25 05:36:23 +03:00
Fringg
f829076bc2 fix: redesign role revoke confirmation dialog 2026-02-25 05:30:05 +03:00
Fringg
66f7fcb3dc feat: show query params in audit log details 2026-02-25 05:24:25 +03:00
Fringg
5d0e3539e2 feat: improve audit log - translate actions, fix resource filter, show request body 2026-02-25 05:11:57 +03:00
Fringg
a1a8dc2203 feat: add weekdays condition to ABAC policies 2026-02-25 04:53:42 +03:00
Fringg
a050125ea8 feat: allow editing system roles 2026-02-25 04:45:46 +03:00
Fringg
3d6987f761 feat: add granular user permissions (balance, subscription, promo_group, referral, send_offer)
Split users:edit into fine-grained permissions. Guard UI sections
with hasPermission checks so moderators only see what they can do.
2026-02-25 04:42:40 +03:00
Fringg
80bfaca457 feat: add translations for permission sections and actions
Translate all permission section names (users, tickets, etc.) and
action names (read, edit, delete, etc.) in ru/en/zh/fa locales.
Apply translations in PermissionMatrix, PolicyEdit, and Policies list.
2026-02-25 04:33:35 +03:00
Fringg
bc5d832e0d fix: guard user detail API calls with RBAC permission checks
Hide sync tab and skip sync/promo-groups API calls when moderator
lacks users:sync and promo_groups:read permissions.
2026-02-25 04:29:35 +03:00
Fringg
85c93158fb refactor: replace role/policy modals with separate pages
- Create AdminRoleEdit.tsx for /admin/roles/create and /admin/roles/:id/edit
- Create AdminPolicyEdit.tsx for /admin/policies/create and /admin/policies/:id/edit
- Remove create/edit modals from AdminRoles.tsx and AdminPolicies.tsx
- Add new lazy routes in App.tsx with proper permission gates
- Keep delete confirmation as small inline modal (appropriate for destructive action)
2026-02-25 04:20:37 +03:00
Fringg
56188b1f8a fix: RBAC policies page role handling and permission gates
- Read policy role_id from top-level field instead of conditions object
- Use policy.role_name for display, remove conditions.role_id lookup
- Remove duplicate role_id injection into conditions payload on submit
- Fix PermissionGate strings: policies:* -> roles:* to match backend
- Remove redundant client-side status filtering in audit log (already
  filtered server-side)
2026-02-25 04:07:13 +03:00
Fringg
4c9c3992ab fix: RBAC frontend type mismatches and translations
- Move RBAC translations from banSystem to admin namespace in all 4 locales
- Fix AccessPolicy type: action (string) -> actions (string[])
- Fix AuditLogEntry type to match backend: add status, request_method, request_path, resource_type, user info
- Fix AuditLogFilters: resource -> resource_type, add status filter
- Handle null details safely in audit log expanded view
- Fix policy form submission and display to use actions array
2026-02-25 03:40:54 +03:00
Fringg
c4e3211baa fix: add missing onError handlers on RBAC mutations
- deleteMutation onError in AdminRoles and AdminPolicies
- revokeMutation onError in AdminRoleAssign
- handleExport error handling in AdminAuditLog
- add missing i18n keys: deleteFailed, revokeFailed, exportError
2026-02-25 03:17:12 +03:00
Fringg
874ee2682e feat: add RBAC permission system to admin cabinet frontend
- Permission store (Zustand) with wildcard matching and role level checks
- PermissionRoute guard for route-level access control
- PermissionGate component for element-level visibility
- Admin Roles page: CRUD, permission editor, role assignment
- Admin Policies page: ABAC policy management (time/IP conditions)
- Admin Audit Log page: filterable log viewer with CSV export
- AdminPanel sidebar navigation gated by permissions
- 4 locale files updated (en, ru, zh, fa) with RBAC translations
- API client module for all RBAC endpoints
2026-02-25 03:02:52 +03:00
Fringg
48be067d1b feat: add per-channel disable settings and global settings to channel admin
- Add global settings section (CHANNEL_IS_REQUIRED_SUB, trial/paid toggles)
  at top of AdminChannelSubscriptions page
- Add per-channel disable_trial_on_leave and disable_paid_on_leave toggles
  in each channel card with inline Toggle controls
- Update RequiredChannel type and API request interfaces with new fields
- Add translations for globalSettings and perChannel in en/ru/fa/zh locales
2026-02-25 00:24:36 +03:00
Fringg
5a55892145 feat: add channel edit in admin, hide subscribed channels in blocking screen
- Admin panel: added Edit button on channel cards with inline edit form
  (title, link, sort order) using existing PATCH API
- Subscription screen: filter out already-subscribed channels so users
  only see what they still need to subscribe to
- Updated channelIdHint to remove @username reference (numeric only)
- Added i18n keys: edit, editing, form.save (en/ru/fa/zh)
2026-02-24 03:12:12 +03:00
Fringg
a767fe96d3 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
2026-02-24 02:51:03 +03:00
Egor
8ea9a1d6a0 Merge pull request #234 from BEDOLAGA-DEV/main
Dev
2026-02-23 23:38:14 +03:00
Egor
3ba30fa456 Merge pull request #233 from BEDOLAGA-DEV/release-please--branches--main--components--cabinet-frontend
chore(main): release 1.19.1
2026-02-23 21:33:14 +03:00
github-actions[bot]
c1c6e98ee1 chore(main): release 1.19.1 2026-02-23 18:32:32 +00:00
Egor
06f68c76bc Merge pull request #232 from BEDOLAGA-DEV/dev
Dev
2026-02-23 21:31:48 +03:00
Fringg
67bacd3e7a fix: correct memory display to use actual usage instead of cache-inclusive
memory.used from systeminformation includes disk cache/buffers,
showing ~91% when actual usage is ~18%. Now uses (total - available)
which matches htop/free output. Also added PB/EB units to formatBytes.
2026-02-23 19:27:18 +03:00
Fringg
e8acfee3e4 fix: remove double URL-decode in extractTelegramUserId 2026-02-23 18:13:02 +03:00
Fringg
ee6ec5959c fix: detect Telegram account switch across tab closes
The old clearStaleSessionIfNeeded stored initData in sessionStorage for
comparison, but sessionStorage is cleared on tab close — so switching
Telegram accounts between separate Mini App openings was never detected.

Fix: store the Telegram user ID in localStorage (survives tab close).
On every launch, compare the fresh initData user ID with the stored one.
If they differ, clear all auth tokens and cached user data to force
re-authentication as the correct account.
2026-02-23 17:53:47 +03:00
Fringg
d1043e83ea fix: add max attribute to expected referrals input
Prevent users from entering values exceeding int32 range.
2026-02-23 17:27:34 +03:00
Fringg
03ad255bf1 perf: add Zustand selectors to prevent cascading re-renders
Replace all bare useAuthStore(), useBlockingStore(), and
useSuccessNotification() calls with individual field selectors.
This prevents components from re-rendering when unrelated store
fields change.

- 21 useAuthStore usages across 20 files: individual selectors
  for 1-2 fields, useShallow for 3+ fields
- 5 useBlockingStore usages: individual selectors
- 2 useSuccessNotification usages: individual selectors
2026-02-23 17:15:30 +03:00
Fringg
30ece694d4 perf: fix render cycle in useBranding and conditional polling
- Remove isFullscreen from useBranding useEffect deps to prevent
  re-render loop (requestFullscreen changes isFullscreen which
  re-triggers the effect); use ref guard instead
- Make AdminBroadcasts 5s polling conditional: only poll when there
  are active broadcasts (queued/in_progress/cancelling)
2026-02-23 17:15:20 +03:00
Fringg
7cf72735ec fix: plug memory leaks in blob URLs and traffic cache
- Add URL.revokeObjectURL on unmount and media removal in
  AdminBroadcastCreate, AdminPinnedMessageCreate, Support
- Track blob URLs via refs to revoke before creating new ones
- Add clearCreateAttachment/clearReplyAttachment helpers in Support
  to properly revoke blob URLs when clearing attachments
- Cap adminTraffic cache at 20 entries with FIFO eviction to prevent
  unbounded memory growth from different filter combinations
2026-02-23 17:15:11 +03:00
Fringg
17b2f2e903 perf: extract Twemoji options to module-level const
Prevent MutationObserver re-initialization on every render by moving
the options object out of JSX (was creating a new object reference
on each render of AppWithNavigator).
2026-02-23 17:15:03 +03:00
Fringg
860493058a perf: fix GPU-heavy CSS patterns
- Remove mix-blend-mode: overlay from body::before noise texture
  (was forcing fullscreen GPU compositing on every paint)
- Disable noise texture on mobile via display:none media query
- Replace backdrop-filter animation in backdropFadeIn/Out keyframes
  with opacity-only animation (backdrop-filter transition is expensive)
- Replace toast progress bar width animation with scaleX (GPU-composited)
- Remove redundant will-change: transform from .glass and .wave-blob
2026-02-23 17:14:57 +03:00
Fringg
9a84e13e6c perf: fix critical WebGL GPU resource leaks in Aurora
- Fix isWebglAvailable() leaking a full WebGL context on every check
  by replacing OGL Renderer with raw canvas.getContext() + loseContext()
- Add visibilitychange listener to fully stop rAF loop when tab hidden
  and restart on visibility restore (was running 24/7 in background)
- Properly destroy WebGL context on unmount via WEBGL_lose_context
  extension and gl.deleteProgram() (was only nulling JS refs)
- Reduce target FPS from 20 to 10 (slow gradient, visually identical)
2026-02-23 17:14:47 +03:00
Fringg
0b4e8253aa fix: render newlines in tariff description
Add whitespace-pre-line to tariff description div so newline
characters entered via admin panel are rendered as line breaks.
2026-02-23 16:23:33 +03:00
Fringg
ed65c29bac fix: parse raw query string for deep link params to avoid double-decode
Previous fix used URLSearchParams.get() which already fully decodes,
then called decodeURIComponent() again causing double-decode of %
sequences. Parse raw query string pairs directly instead —
decodeURIComponent does not treat + as space, preserving base64.
2026-02-23 15:59:43 +03:00
Fringg
65add9a111 fix: preserve + chars in deep link URL params for crypto links
URLSearchParams decodes + as space, breaking base64-encoded crypto
deep links (ss://, vless://, etc). Use raw param extraction with
manual decoding to preserve + characters.
2026-02-23 15:50:37 +03:00
Fringg
321bedcb61 fix: stack promo offer discounts with promo group discounts
Redesign applyPromoDiscount to apply promo offer on top of promo group
prices instead of treating them as mutually exclusive. Calculate combined
discount percent from the deepest original price. Show promo banner in
confirm step regardless of existing server discounts.
2026-02-23 15:44:23 +03:00
Fringg
91d567f9cc fix: add resend email cooldown and allow email change for all auth types
Add 60-second cooldown timer on resend verification email button to
prevent spam. Remove auth_type restriction on change email button so
OAuth users can also change their email.
2026-02-23 15:44:16 +03:00
Egor
62709a3a63 Merge pull request #230 from BEDOLAGA-DEV/release-please--branches--main--components--cabinet-frontend
chore(main): release 1.19.0
2026-02-19 02:14:46 +03:00
github-actions[bot]
7beac4adae chore(main): release 1.19.0 2026-02-18 23:14:32 +00:00
Egor
9bb66f014a Merge pull request #229 from BEDOLAGA-DEV/dev
dev
2026-02-19 02:14:10 +03:00
Fringg
2b2ead837c feat: add referral code persistence across all auth methods
Mirrors campaign.ts localStorage pattern to capture ?ref= from URL and pass
referral_code to backend during Telegram Widget, OAuth, email login, and
Mini App authentication. Fixes redirect loop when email auth is disabled.
2026-02-18 23:59:32 +03:00
Egor
d9e295e9a1 Merge pull request #228 from BEDOLAGA-DEV/release-please--branches--main--components--cabinet-frontend
chore(main): release 1.18.0
2026-02-18 10:03:57 +03:00
github-actions[bot]
7a01540461 chore(main): release 1.18.0 2026-02-18 06:57:28 +00:00
Egor
12204b6925 Merge pull request #227 from BEDOLAGA-DEV/dev
Dev
2026-02-18 09:56:56 +03:00
Fringg
271a005e87 feat: show traffic reset info in subscription card 2026-02-18 09:41:36 +03:00
Fringg
cfe9f642d8 feat: show traffic reset period on tariff cards
Display daily/weekly/monthly reset badge next to traffic and devices.
Hidden for NO_RESET tariffs.
2026-02-18 09:36:39 +03:00
Fringg
19e62fccf1 fix: rename Серверы to Локации in subscription card 2026-02-18 09:29:44 +03:00
Fringg
0fac3689e5 fix: remove server/location count from tariff cards and confirmation
Server info only shown in user's active subscription card.
2026-02-18 09:28:43 +03:00
Fringg
ecc089da64 fix: show locations count instead of servers on tariff cards
servers_count already represents squad count on backend.
Renamed display labels to "locations" on tariff cards and
confirmation view. Server names still shown in subscription card.
2026-02-18 09:25:44 +03:00