Commit Graph

1476 Commits

Author SHA1 Message Date
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
4ebc21b348 feat: add Traffic tab with per-inbound breakdown in admin remnawave
- Add NodeRealtimeStats and InboundTraffic TypeScript interfaces
- Type getNodesRealtime return as NodeRealtimeStats[]
- Add new Traffic tab to AdminRemnawave page showing per-node
  inbound/outbound traffic sorted by total bytes
- Display download/upload/total per inbound tag for each node
2026-03-28 22:47:29 +03:00
Fringg
a34a34204c refactor: update remnawave API types for v2.7.0
- ServerInfo: remove cpu_physical_cores, memory_available
- NodeInfo: replace cpu_count/cpu_model/total_ram with versions/system,
  xray_uptime changed to number, users_online now required
- NodeStatus: same field updates, remove dead uptime field
- Extract formatUptime to shared utils/format.ts
- Update AdminRemnawave and AdminDashboard components
2026-03-28 22:32:22 +03:00
Fringg
59e65283e1 fix: remove duplicate floating orbs background from admin panel
The CosmosBackground orbs were overlapping the app's existing theme
background, creating a double-layer effect. Removed the component
entirely so only the theme background is visible.
2026-03-28 21:25:20 +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
8ba5ceae10 fix: allow zero price for device and traffic topup in tariff settings
- device_price_kopeks: change > 0 to >= 0 so 0 (free) is sent instead of undefined
- traffic_topup_packages: change > 0 to >= 0 so free traffic packages can be added
2026-03-28 13:30:19 +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
c0mrade
a57674c22b chore: disable i18next promotional console message 2026-03-27 14:12:52 +03:00
c0mrade
3b659b7450 fix: bottom nav disappears after visiting payment page in Telegram
- Reset isKeyboardOpen on route change so bottom nav always restores
- Disable autoFocus on payment input in Telegram Mini App
- Skip auto-focus on Profile email inputs in Telegram
2026-03-27 13:40:13 +03:00
c0mrade
5246ad2a09 feat: add server selection for test_access promo offer templates
AdminPromoOfferTemplateEdit now shows checkboxes to select test
squad servers when editing a test_access template.
2026-03-27 12:31:46 +03:00
c0mrade
c697ddb224 fix: auto-reload on stale chunk errors after deploy
When a new build changes chunk hashes, users with cached index.html
get "Failed to fetch dynamically imported module" errors. Now:
- lazyWithRetry() wraps all lazy imports with auto-reload on failure
- ErrorBoundary catches chunk errors and auto-reloads once
- 30s guard in sessionStorage prevents reload loops
2026-03-26 20:55:29 +03:00
c0mrade
94b9b9eb94 feat: tariff selector for trial subscription promo codes
- Add tariff_id/tariff_name to PromoCode types
- AdminPromocodeCreate: tariff dropdown for trial_subscription type
- Shows default trial tariff or warns if none configured
2026-03-26 20:09:29 +03:00
c0mrade
6de864ac43 fix: promocode multi-tariff support in cabinet
- Balance page: handle select_subscription response — show subscription
  picker when promo code adds days and user has multiple tariffs
- API: activatePromocode now accepts optional subscriptionId
- AdminPromocodeCreate: show trial tariff info when creating
  trial_subscription promo code, warn if no trial tariff configured
2026-03-26 19:43:42 +03:00
Fringg
9546e0ffe6 fix: add missing balance cache invalidation after mutations
- Subscription.tsx: devicePurchase + trafficPurchase onSuccess → invalidate ['balance']
- RenewSubscription.tsx: renewMutation onSuccess → invalidate ['balance']
- SubscriptionPurchase.tsx: purchaseMutation onSuccess → invalidate ['balance'] + ['subscriptions-list']
- subscription.ts: refreshTraffic uses withSubId (already fixed, formatting)
2026-03-26 10:44:00 +03:00
c0mrade
96ff2585f2 Merge pull request #359 from BEDOLAGA-DEV/feat/multi-subscription
feat: multi-subscription frontend support
2026-03-25 18:48:38 +03:00
c0mrade
45b7c857fc fix: back button goes to dashboard in single-tariff to prevent redirect loop
In single-tariff mode, Subscriptions list auto-redirects to detail page.
Back button from detail now goes to / (dashboard) instead of /subscriptions,
breaking the redirect loop.
2026-03-25 18:40:50 +03:00
c0mrade
98e9cfadc6 fix: use declarative Navigate instead of navigate() in render + fix useEffect deps
Subscriptions.tsx: navigate() in render → <Navigate> component (React safe).
Subscription.tsx: same fix for multi-tariff redirect.
AdminUserDetail.tsx: useRef guard for one-time auto-select instead of
activeSubscriptionId in dependency array (prevented manual selection).
2026-03-25 18:11:30 +03:00
c0mrade
29003a6cbe fix: make buy-another-tariff button more prominent on dashboard
Changed from faded dashed border (opacity-50, text-xs) to accent-colored
background with larger text for better visibility in multi-tariff mode.
2026-03-25 16:53:32 +03:00
c0mrade
16ccf78c95 fix: show warning hint when subscription must be selected before wheel spin
When user has 2+ eligible subscriptions and chooses subscription_days
payment, a visible warning hint now appears explaining they need to
select a subscription before spinning.
2026-03-25 16:49:45 +03:00
c0mrade
e86b214008 fix: resolve eslint warnings in NewsSection and AdminTickets
NewsSection: wrap items in useMemo to stabilize dependency reference.
AdminTickets: copy ref values to local vars for cleanup function.
2026-03-25 11:47:41 +03:00
c0mrade
fd01c0f393 fix: preserve subscription context in navigation and cache keys
SubscriptionCardActive: passes ?sub= to /connection navigation.
Connection: QR state includes subscriptionId for back-navigation.
ConnectionQR: preserves subscription context on back button.
Dashboard + Subscription: localStorage traffic cache keyed per-subscription
to prevent cooldown bleed between different subscriptions.
2026-03-25 11:47:31 +03:00
c0mrade
4de47cfa94 fix: multi-subscription frontend improvements
- Connection page: reads subscription_id from ?sub= query param
- Subscription detail: passes subscriptionId to /connection URL
- Dashboard: skip single-subscription and devices queries in multi-tariff
  mode (data comes from subscriptions-list instead)
2026-03-24 22:18:02 +03:00
c0mrade
324aaa1f33 redesign: inline delete confirmation on web — expands in place instead of modal/sheet 2026-03-24 19:11:48 +03:00
c0mrade
93fa435ff7 fix: constrain delete Sheet width on desktop — centered max-w-md with rounded corners 2026-03-24 18:57:01 +03:00
c0mrade
debee7729f fix: platform-aware delete confirmation + trial CTA to purchase
Delete subscription:
- Telegram mini app: native destructive popup (red button)
- Web (mobile + desktop): Sheet bottom panel with full-width buttons
- Both: proper loading state on delete button

Trial CTA: leads to /subscription/purchase (trial cannot be renewed)
2026-03-24 18:30:59 +03:00
c0mrade
23edd6a211 fix: hide panel info/traffic/devices from subscription list level, show only in detail 2026-03-24 18:05:42 +03:00
c0mrade
20f0e44d2d fix: remove duplicate 'Create subscription' block in multi-subscription admin view 2026-03-24 17:53:28 +03:00
c0mrade
3a3cd0b445 redesign: admin subscription tab — two-level navigation for multi-tariff
Level 1 (subscription list):
- Cards with tariff name, status badge, traffic, date, devices
- Click to drill into subscription detail
- "Создать подписку" with filtered purchased tariffs

Level 2 (subscription detail):
- Back button to return to list
- All actions scoped to selected subscription
- No "Сменить тариф" in multi-subscription mode
- Panel info, devices, traffic stats per-subscription

Single subscription: keeps current behavior (direct detail view)
2026-03-24 17:44:58 +03:00
c0mrade
c7c2167908 fix: admin per-subscription panel data + hide purchased tariffs in create
- getPanelInfo/getNodeUsage/getUserDevices: pass subscriptionId
- deleteUserDevice/resetUserDevices: pass subscriptionId
- Reload panel data when switching between subscriptions
- Create subscription: filter out already purchased tariffs
2026-03-24 16:55:09 +03:00
c0mrade
fe75fa45f0 feat: delete expired subscriptions with confirmation dialog
- API: deleteSubscription() calls DELETE /subscriptions/:id
- Subscription detail: "Удалить подписку" button for expired subs
  in multi-tariff mode
- Radix Dialog confirmation with warning text, cancel/confirm buttons
- Navigates to /subscriptions after successful deletion
2026-03-24 15:31:10 +03:00
c0mrade
2921d8cae6 feat: wheel subscription picker for multi-tariff mode
- API: spin() accepts subscriptionId, WheelConfig has eligible_subscriptions
- Auto-select subscription when only one eligible
- Show subscription picker when multiple eligible (days payment)
- Disable spin button until subscription selected (when >1 eligible)
- Daily tariffs excluded from eligible list
2026-03-24 14:41:20 +03:00
c0mrade
31d0953c23 feat: add WebBackButton to all sub-pages, widen renew page layout
- New WebBackButton component: visible on web, hidden in Telegram
  (native back button handles navigation there)
- Added to: Subscription detail, SubscriptionPurchase, RenewSubscription
- RenewSubscription: removed max-w-lg, grid layout for period cards
2026-03-24 14:01:55 +03:00
c0mrade
f1cb9e5c66 redesign: subscriptions list page — full width, grid layout, accent add button
- Remove max-w-lg constraint to match dashboard width
- Grid layout: 2 columns on desktop, 1 on mobile
- Move "Новый тариф" button to header row as accent-styled button
- Larger empty state with more breathing room
2026-03-24 13:31:25 +03:00
c0mrade
348d654892 fix: send subscription_id as query param in ALL POST/PATCH endpoints
All backend endpoints accept subscription_id via Query(...) parameter,
but frontend was sending it in the request body via bodyWithSubId helper.
This caused multi-tariff operations (pause, autopay, renew, traffic,
devices, servers, tariff switch) to silently fail — backend couldn't
find subscription_id in query params and fell back to first subscription.

Changed bodyWithSubId to return [body, config] tuple with subscription_id
in params, spread into axios calls as separate arguments.
2026-03-24 12:45:47 +03:00
c0mrade
871b4769aa feat: show autopay/auto-charge status on subscription cards, invalidate list on toggle
- SubscriptionListCard: always show autopay status (green check / red cross)
  for regular tariffs, show auto-charge status for daily tariffs
- Hide autopay for trial subscriptions
- Autopay mutation: invalidate subscriptions-list for instant UI update
- Types: added is_daily, is_daily_paused to SubscriptionListItem
2026-03-24 12:28:02 +03:00
c0mrade
b0421b94a6 fix: send subscription_id as query param in autopay PATCH, not in body 2026-03-24 12:05:48 +03:00
c0mrade
6a53221cc1 fix: hide renewal button for daily tariffs in multi-tariff mode, fix hint text
- Daily tariffs renew automatically — no manual renewal CTA needed
- Show "Продление подписки" hint in multi-tariff instead of "Продление и смена тарифа"
2026-03-24 11:10:30 +03:00
c0mrade
10824b7322 fix: show missing balance amount on renew page, no tariff switch in multi-tariff
- RenewSubscription: display actual missing amount instead of {{missing}} placeholder
- SubscriptionPurchase: suppress "switch tariff" title in multi-tariff mode
  (only renewal exists, no tariff switching)
2026-03-24 10:58:37 +03:00
c0mrade
82eb03dec9 feat: separate renewal and purchase flows in multi-tariff mode
Renewal flow (per-subscription):
- New /subscriptions/:id/renew page showing only period options for
  the specific tariff with balance display and renew button
- PurchaseCTAButton links to /renew in multi-tariff mode

Purchase flow (new tariffs only):
- Hide already purchased tariffs (is_purchased flag from backend)
- Fallback UI when all tariffs are owned
- Types: added is_purchased, all_tariffs_purchased fields
2026-03-24 10:47:49 +03:00
c0mrade
a709ddbec2 chore: remove unused reactjs-tiptap-editor dependency
This package was not imported anywhere in the codebase but pulled in
@excalidraw/excalidraw and old @radix-ui packages that caused peer
dependency warnings on every npm install (React 19 vs React 16-18).
Tiptap is used directly via @tiptap/* packages.
2026-03-23 21:58:31 +03:00
c0mrade
9d3fb37d60 fix: remove duplicate back buttons, improve multi-subscription UX
- Remove custom back buttons from Subscription detail and SubscriptionPurchase
  pages — native Telegram mini-app back button already handles navigation
- SubscriptionListCard: distinct trial badge with star icon and amber styling,
  trial cards get amber border/background for visual differentiation
- SubscriptionPurchase: change "Купить тариф" to "Новый тариф" when adding
  a new tariff in multi-subscription mode
- Subscription detail: show tariff name as title in multi-tariff mode
2026-03-23 21:38:04 +03:00
c0mrade
376e1bb56d feat: enhance subscription list UX with progress bars, status badges, and glass theme
- SubscriptionListCard: replace status dot with localized status badge,
  add traffic progress bar with color coding, use locale-aware date format
- Subscriptions page: apply glass theme colors, improve empty state styling,
  add SVG plus icon for buy button, skeleton loader with glass theme
- Subscription detail: invalidate subscriptions-list cache on mutations
2026-03-23 18:57:05 +03:00
c0mrade
f4de6d8ad8 fix: multi-subscription UI audit fixes and cache invalidation improvements
- Fix AdminUserDetail multi-subscription display with useMemo optimization
- Update Dashboard subscription cards and purchase entry points
- Fix WebSocket notification handlers for multi-subscription context
- Update SubscriptionPurchase cache invalidation for multi-tariff mode
- Fix Subscriptions list page and navigation patterns
- Update App routing, DeepLinkRedirect, and CommandPalette for multi-sub
- Add SubscriptionListCard component
- Fix TopUpResult and PromoOffersSection navigation
2026-03-23 18:57:05 +03:00
c0mrade
258bfd7654 fix: remove unused multiSubCount variable 2026-03-23 18:57:05 +03:00
c0mrade
09f467bfb3 feat: show per-subscription mini-cards on Dashboard with tariff name, traffic, devices, date 2026-03-23 18:57:05 +03:00
c0mrade
865a78b801 fix: hide legacy subscription card on Dashboard in multi-tariff mode 2026-03-23 18:57:05 +03:00
c0mrade
bcbfa4191e feat: multi-tariff purchase UX - disable switch, show Buy for new tariffs, correct page title 2026-03-23 18:57:05 +03:00
c0mrade
a0c21a11aa fix: navigation links point to /subscriptions (list page) instead of legacy /subscription 2026-03-23 18:57:05 +03:00
c0mrade
f0d520dbaa fix: show subscriptions link on dashboard even with single subscription in multi-tariff mode 2026-03-23 18:57:05 +03:00