Commit Graph

680 Commits

Author SHA1 Message Date
Fringg
1a0a5ff453 feat: add per-button enable/disable toggle and custom labels per locale
- Add Toggle per section card to show/hide button in main menu
- Add collapsible locale label inputs (ru, en, ua, zh, fa) per section
- Normalize server response for backward compatibility with older API
- Update all 4 locale files with new translation keys
2026-02-12 23:42:58 +03:00
Fringg
e586129c37 feat: add 'no color' option for button style customization
Adds a 'default' style option that removes color from buttons, showing
Telegram's native default style. Updates type, UI chip, preview, and
translations for all 4 locales.
2026-02-12 23:25:49 +03:00
Fringg
b2898730b9 feat: add ButtonsTab for per-section button style customization
Visual editor in admin settings for configuring Telegram button colors
and custom emoji IDs per menu section. Includes API client, draft state
management, save/reset, and translations for ru/en/fa/zh locales.
2026-02-12 23:16:08 +03:00
Fringg
aa5113b8e3 feat: add admin pinned messages section
- API client with full CRUD, broadcast, activate/deactivate, unpin endpoints
- List page with active/inactive badges, action buttons, pagination
- Create/edit form with content editor, media upload, display settings toggles
- Routes and navigation in admin marketing group
- i18n translations for ru, en, fa, zh
2026-02-12 19:33:18 +03:00
Fringg
a0b10e688c fix: allow email change for unverified emails without code verification
Skip code-based flow for unverified emails — replace email directly
and send verification to the new address. Show success step immediately
instead of asking for a verification code.
2026-02-11 18:28:49 +03:00
Fringg
1d6ec70116 fix: handle unlimited traffic package selection and button text
- Fix falsy check: selectedTrafficPackage !== null instead of truthy
  (gb=0 for unlimited was evaluated as false, hiding the buy button)
- Show "Buy Unlimited" instead of "Buy 0 GB" for unlimited packages
- Add buyUnlimited translation key to all 4 locales
2026-02-11 18:20:21 +03:00
Fringg
2964236cdc refactor: replace forgot password modal with inline screen, fix Safari iOS animation jank 2026-02-11 06:06:22 +03:00
Fringg
d596b05048 fix: remove redundant subtitle and register hint from login page 2026-02-11 05:54:49 +03:00
Fringg
fc0dd39550 fix: use openTelegramLink for CryptoBot payment to open invoice in Telegram 2026-02-11 05:50:31 +03:00
Fringg
dcfd362c43 refactor: replace ChangeEmailModal with inline email change flow in Profile
- Remove modal-based email change (491 lines deleted)
- Add inline step-by-step flow directly in email card (email → code → success)
- Add change email button for unverified emails (typo fix use case)
- Hide change email for OAuth users (google, yandex, discord, vk)
- Auto-focus inputs, Enter submit, animated transitions, 3s auto-close on success
2026-02-11 05:42:47 +03:00
Fringg
45cbfb5ecb feat: compact login page with collapsible email, icon OAuth row, safe areas
- OAuth providers: horizontal icon row with labels instead of stacked full-width buttons
- Email form: collapsed by default behind "Войти по Email" pill toggle with smooth CSS Grid animation
- Telegram safe areas: use useTelegramSDK() for top/bottom insets with env() CSS fallback
- Compact layout: smaller logo (48x48), tighter spacing, fits on one mobile screen
- Language switcher offset by safe area to avoid Telegram header overlap
- 100dvh for proper Telegram Mini App viewport handling
2026-02-11 05:29:19 +03:00
Fringg
a744b41910 fix: harden OAuth login flow — open redirect, path traversal, info leak
- Validate authorize_url is HTTPS before redirect (open redirect prevention)
- encodeURIComponent on provider name in API URL paths (path traversal prevention)
- encodeURIComponent on referralCode in t.me deep link
- Gate console.warn behind import.meta.env.DEV (no info leak in prod)
2026-02-11 02:58:04 +03:00
Fringg
f74e316161 fix: guard oauthProviders with Array.isArray to prevent TypeError on Login page
Fixes 'Cannot read properties of undefined (reading length)' crash
in Telegram WebView when API returns unexpected response shape.
2026-02-11 02:42:32 +03:00
Fringg
6bf0af4ff3 fix: remove colored background from logo on login page
Match logo styling with the rest of the app - use dark neutral
background instead of accent gradient, consistent border and shadow.
2026-02-11 01:43:52 +03:00
Fringg
f10a02ceb6 feat: show affected subscriptions count on tariff deletion
Update delete mutation to use affected_subscriptions from API response.
Show contextual success notification with subscription count.
Add deleteSuccessWithSubscriptions translation key in all 4 locales.
2026-02-09 22:30:28 +03:00
c0mrade
a4e6e35da1 fix: check apps before subscription on connection page
Move the empty apps check before the subscription check so that
an empty or unconfigured appConfig shows "not configured" instead
of the misleading "no subscription" message.
2026-02-09 12:29:00 +03:00
c0mrade
fb25df6f0f feat: add empty state for connection page when no apps configured
Show different messages depending on user role:
- Regular users see a friendly "check back later" message
- Admins see a prompt with a link to /admin/apps settings
2026-02-09 11:23:33 +03:00
c0mrade
e5ed6d0401 fix: hide Telegram back button on bottom nav pages
Back button was showing on all non-root routes including top-level
pages reachable from the bottom navigation menu (subscription, balance,
referral, support, wheel). These pages don't need a back button since
users navigate between them via the bottom tab bar.
2026-02-09 10:48:25 +03:00
Fringg
0389acdf83 fix: prevent useCloseOnSuccessNotification from firing on mount
The hook checked closeOthersSignal > 0 which only skipped signal=0.
After first payment, signal stays at 1+ forever causing TopUpAmount
to immediately navigate away on every mount. Now tracks the signal
value at mount time and only reacts to changes after mount.
2026-02-09 05:53:33 +03:00
Fringg
0c34668e40 feat: render GitHub markdown in release changelogs
Replace raw preformatted text with rendered markdown:
headers, bold, links, lists, inline code. Sanitized
with DOMPurify. Styled with Tailwind child selectors.
2026-02-08 23:28:07 +03:00
Fringg
a15b3d4101 feat: add admin updates page with release history
Shows bot and cabinet releases with version badges,
changelogs, and update detection via __APP_VERSION__.
2026-02-08 23:20:49 +03:00
Fringg
ab0270ac58 feat: add system info card to admin dashboard
Shows cabinet version, bot version, Python version, uptime, users and
active subscriptions at the bottom of the dashboard page.
2026-02-08 22:52:14 +03:00
Fringg
5678dfd558 feat: enable sorting on enrichment columns 2026-02-08 22:39:31 +03:00
Fringg
a8ea5c958f fix: show email for OAuth/email users in traffic table
Add email field to UserTrafficItem type and display it below
user name when no Telegram username is present.
2026-02-08 22:04:57 +03:00
Fringg
893c69ab6f feat: add enrichment columns to admin traffic usage table
Add 5 new columns (connected devices, spending, start/end dates, last node)
with progressive loading shimmer placeholders and 4-language translations.
2026-02-08 21:49:45 +03:00
Fringg
2dfa520604 feat: add admin traffic packages and device limit management UI
Add device limit +/- stepper, traffic packages display with inline
delete, add traffic dropdown from tariff config, translations for
ru/en/zh/fa.
2026-02-08 21:13:46 +03:00
Fringg
6f31fbe6b5 feat: add device management UI in admin user card
Show connected devices in subscription tab with ability to:
- View device platform, model, HWID and connection date
- Delete individual devices
- Reset all devices at once
2026-02-08 20:49:07 +03:00
Fringg
92d206f5b6 feat: add inline referral commission editing in admin user card
Admins can now edit individual referral commission percent directly
in the user detail card. Shows "Default" when no custom value is set.
2026-02-08 20:29:56 +03:00
Fringg
23f56afaf7 fix: stretch low-res Aurora canvas to fill viewport
OGL renderer.setSize() sets both the internal buffer and CSS dimensions,
so the 10% resolution canvas was only covering 10% of the screen.
Now explicitly reset canvas.style.width/height to 100% after setSize()
so the small buffer is upscaled by the browser to full viewport.
2026-02-08 17:46:23 +03:00
Fringg
56788b12e7 perf: reduce Aurora animated background GPU load by ~95%
- Render WebGL canvas at 10% viewport resolution (~20K px vs 2M px)
- Replace backdrop-filter: blur(80px) with filter: blur(20px) on canvas
  (backdrop-filter composites ALL layers underneath — 10-20x more expensive)
- Disable antialiasing (useless when output is blurred)
- Lower target FPS from 30 to 20 (imperceptible for ambient background)
- Add CSS contain: strict to isolate layout/paint recalculations
- Remove separate blur overlay div (one element instead of two)

Reported: GTX 1660S showed 30-55% GPU load with cabinet open.
Expected: ~1-5% GPU after this change.
2026-02-08 17:40:35 +03:00
Fringg
de09ea039b fix: hide backend URL from logo by fetching as blob
Logo images were exposing the backend API URL in the DOM via <img src>.
Now preloadLogo() fetches the image as a blob and serves it through
URL.createObjectURL(), so only blob: URLs appear in the page source.
Blob is invalidated on logo upload/delete.
2026-02-08 17:40:24 +03:00
Fringg
20ea2006ff fix: persist refresh token across Telegram Mini App reopens
Telegram Mini App creates a new WebView on each open, clearing
sessionStorage. Combined with 24h auth_date validation on backend,
returning users couldn't re-authenticate after closing the app.

- Move refresh token to localStorage for persistence across sessions
- Keep access token in sessionStorage (short-lived, OK to lose)
- Fix auth store initialize() to recover when access token is missing
  but refresh token exists in localStorage
- Remove separate mountThemeParams() call to fix ConcurrentCallError
  (mountMiniApp() handles it internally in SDK v3)
- Update token migration logic for new storage strategy
2026-02-08 16:06:51 +03:00
Fringg
060c9bef54 fix: enforce column maxWidth for proper shrinking on mobile + country dropdown positioning 2026-02-07 13:42:15 +03:00
Fringg
471e2c8c43 feat: add country filter and risk columns to traffic CSV export
- Add CountryFilter dropdown with flag emoji + node count per country
- Country filter merges with node filter for both table and CSV export
- Pass total/node GB/day thresholds to backend for risk columns in CSV
- CSV now includes Risk Level, Risk Ratio, Risk GB/day when thresholds set
2026-02-07 13:29:14 +03:00
Fringg
12663a59a7 fix: allow user column to shrink smaller on mobile
Reduce minSize from 80px to 40px so the user column can be compressed
further on narrow screens.
2026-02-07 13:17:08 +03:00
Fringg
da273d6776 fix: widen column resize touch target for mobile devices
Expand invisible touch area from 4px to 20px for comfortable finger
interaction on iPhone. Visual indicator stays thin (4px) inside the
wider hit zone. Use inline touchAction: none to prevent scroll conflict.
2026-02-07 13:11:01 +03:00
Fringg
e60b846eca fix: improve risk calculation display with actual GB/d values
- RiskBadge now shows real daily GB/d value + mini progress bar
- Node cells show daily rate subtitle when threshold is active
- Total column shows daily rate subtitle when threshold is active
- getCompositeRisk returns both ratio and dominant GB/d value
- formatGbPerDay helper for clean number formatting
2026-02-07 12:59:11 +03:00
Fringg
a6507b2cfe feat: add traffic abuse risk assessment with color gradation
Add threshold inputs (total GB/day, per-node GB/day) to admin traffic
usage page. When set, rows get background color gradation (green to red)
and node cells get text color (blue to red) based on threshold ratios.
Conditional Risk column shows composite risk badge with level indicator.
7 i18n keys added across all 4 locales (ru, en, zh, fa).
2026-02-07 12:41:34 +03:00
Fringg
90b38e3ef2 feat: add node/status filters and custom date range to traffic page
- Add NodeFilter component with flag emojis and checkbox dropdown
- Add StatusFilter component with colored status dots
- Add custom date range picker (calendar toggle, from/to date inputs)
- Wire all filters to backend params (nodes, statuses, start_date, end_date)
- CSV export passes all active filters and date range
- Add displayNodes memo for table column filtering
- Add i18n keys for nodes, statuses, dates in ru/en/zh/fa
2026-02-07 11:53:09 +03:00
Fringg
b5a0562615 Revert "Merge pull request #185 from BEDOLAGA-DEV/feat/traffic-filters-devices"
This reverts commit e824945b73, reversing
changes made to 81fcf54b15.
2026-02-07 11:29:41 +03:00
Fringg
0301fd8566 feat: add node/status filters, custom date range, connected devices to traffic page
- Add NodeFilter dropdown with flag emojis and checkbox selection
- Add StatusFilter dropdown with colored status dots
- Add DateRangePicker with From/To date inputs, toggle from period mode
- Devices column now shows N/M (connected/limit) with accent color
- Export CSV passes all active filters to backend
- New i18n keys for nodes, statuses, dates in ru/en/zh/fa
2026-02-07 11:20:17 +03:00
Fringg
471c37b7b3 fix: add client-side caching and smooth loading for traffic page
- Add 5-min in-memory cache in API layer keyed by request params
- Replace blocking spinner with animated progress bar during refresh
- Keep stale data visible while fetching (opacity dim)
- Prefetch all periods in background for instant switching
2026-02-07 09:47:02 +03:00
Fringg
cfb7ce72f2 feat: add tariff checkbox filter, column resizing to traffic page
- TariffFilter dropdown with checkboxes for filtering by tariff
- Column resizing via TanStack Table resize handles
- Add allTariffs locale key to all 4 languages
- Pass tariffs param to API
2026-02-07 09:30:23 +03:00
Fringg
a034a6068c feat: add admin traffic usage page with TanStack Table
Add AdminTrafficUsage page showing per-user traffic statistics by node
with period filtering (1/3/7/14/30d), server-side sorting, search,
pagination, and CSV export. Uses @tanstack/react-table with manual
sorting and dynamic node columns.
2026-02-07 09:04:55 +03:00
Fringg
8bd3c007bc feat: add promo group and promo offer management to AdminUserDetail
- Info tab: promo group card with inline dropdown to change/remove group
- Balance tab: active promo offer display with deactivate button
- Balance tab: send promo offer form (discount %, valid hours)
- Add deactivateDiscount API method to promocodesApi
- Add locale keys for ru/en/zh/fa
- Fix race condition in subscription create (stale state read)
- Fix unhandled promise in handleInlineConfirm
- Remove unused legacy adminUsers block from ru.json
2026-02-07 08:10:44 +03:00
Fringg
18a14d64ea feat: add Info page link to desktop top navigation
The Info button was only accessible via mobile hamburger menu.
Added it to the desktop header nav bar between Support and Profile.
2026-02-07 07:11:09 +03:00
Fringg
3e70008b81 feat: support Telegram HTML formatting in privacy/offer content
- Fix formatContent to handle mixed content (inline HTML + newlines)
- Only skip paragraph conversion for content with block-level HTML
- Add sanitizer support for <s>, <del>, <ins>, <tg-spoiler>
- Add prose styles for underline, strikethrough, and spoiler tags
- Light theme variants included
2026-02-07 07:02:24 +03:00
Fringg
944b2eca02 feat: add 1d and 3d period filters for node usage 2026-02-07 06:55:42 +03:00
Fringg
bc6985f522 feat: local period calculation and refresh button for node usage
- Load panel + node data once on tab open (not per period change)
- Compute 7/14/30 day totals locally from cached daily data
- Add refresh button to subscription section
- No API calls when switching periods
2026-02-07 06:50:50 +03:00
Fringg
80bad9d623 fix: add country flags to node usage display
- Add country_code to UserNodeUsageItem type
- Add getCountryFlag helper for country code to emoji mapping
- Show country flag next to node name in usage bars
2026-02-07 06:22:08 +03:00