mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-30 02:23:47 +00:00
@@ -320,7 +320,7 @@
|
||||
"title": "Choose a plan to continue",
|
||||
"description": "Your trial period is ending soon. Select a plan to continue using VPN without restrictions."
|
||||
},
|
||||
"expired": {
|
||||
"expiredBanner": {
|
||||
"title": "Subscription expired",
|
||||
"selectTariff": "Your subscription has expired. Choose a plan below to restore access to VPN."
|
||||
},
|
||||
|
||||
@@ -342,7 +342,7 @@
|
||||
"title": "Выберите тариф для продолжения",
|
||||
"description": "Ваш пробный период скоро закончится. Выберите подходящий тариф, чтобы продолжить пользоваться VPN без ограничений."
|
||||
},
|
||||
"expired": {
|
||||
"expiredBanner": {
|
||||
"title": "Подписка истекла",
|
||||
"selectTariff": "Ваша подписка истекла. Выберите тариф ниже, чтобы возобновить доступ к VPN."
|
||||
},
|
||||
|
||||
@@ -181,7 +181,10 @@ export default function Subscription() {
|
||||
if (selectedPeriod?.traffic.selectable && (selectedPeriod.traffic.options?.length ?? 0) > 0) {
|
||||
result.push('traffic');
|
||||
}
|
||||
if (selectedPeriod && (selectedPeriod.servers.options?.length ?? 0) > 0) {
|
||||
if (
|
||||
selectedPeriod &&
|
||||
(selectedPeriod.servers.options?.filter((s) => s.is_available).length ?? 0) > 0
|
||||
) {
|
||||
result.push('servers');
|
||||
}
|
||||
if (selectedPeriod && selectedPeriod.devices.max > selectedPeriod.devices.min) {
|
||||
@@ -203,7 +206,12 @@ export default function Subscription() {
|
||||
classicOptions.periods[0];
|
||||
setSelectedPeriod(defaultPeriod);
|
||||
setSelectedTraffic(classicOptions.selection.traffic_value);
|
||||
setSelectedServers(classicOptions.selection.servers);
|
||||
const availableServerUuids = new Set(
|
||||
defaultPeriod.servers.options?.filter((s) => s.is_available).map((s) => s.uuid) ?? [],
|
||||
);
|
||||
setSelectedServers(
|
||||
classicOptions.selection.servers.filter((uuid) => availableServerUuids.has(uuid)),
|
||||
);
|
||||
setSelectedDevices(classicOptions.selection.devices);
|
||||
}
|
||||
}, [classicOptions, selectedPeriod]);
|
||||
@@ -1636,7 +1644,9 @@ export default function Subscription() {
|
||||
)}
|
||||
|
||||
<div className="max-h-64 space-y-2 overflow-y-auto">
|
||||
{countriesData.countries.map((country) => {
|
||||
{countriesData.countries
|
||||
.filter((country) => country.is_available || country.is_connected)
|
||||
.map((country) => {
|
||||
const isCurrentlyConnected = country.is_connected;
|
||||
const isSelected = selectedServersToUpdate.includes(country.uuid);
|
||||
const willBeAdded = !isCurrentlyConnected && isSelected;
|
||||
@@ -2001,10 +2011,10 @@ export default function Subscription() {
|
||||
</div>
|
||||
<div>
|
||||
<div className="font-medium text-error-300">
|
||||
{t('subscription.expired.title')}
|
||||
{t('subscription.expiredBanner.title')}
|
||||
</div>
|
||||
<div className="mt-1 text-sm text-dark-400">
|
||||
{t('subscription.expired.selectTariff')}
|
||||
{t('subscription.expiredBanner.selectTariff')}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -3108,7 +3118,14 @@ export default function Subscription() {
|
||||
setSelectedTraffic(period.traffic.current);
|
||||
}
|
||||
if (period.servers.selected) {
|
||||
setSelectedServers(period.servers.selected);
|
||||
const availUuids = new Set(
|
||||
period.servers.options
|
||||
?.filter((s) => s.is_available)
|
||||
.map((s) => s.uuid) ?? [],
|
||||
);
|
||||
setSelectedServers(
|
||||
period.servers.selected.filter((uuid) => availUuids.has(uuid)),
|
||||
);
|
||||
}
|
||||
if (period.devices.current) {
|
||||
setSelectedDevices(period.devices.current);
|
||||
@@ -3193,8 +3210,9 @@ export default function Subscription() {
|
||||
{currentStep === 'servers' && selectedPeriod?.servers.options && (
|
||||
<div className="grid grid-cols-2 gap-3 sm:grid-cols-3">
|
||||
{selectedPeriod.servers.options
|
||||
// Hide Trial server for users who already have trial subscription
|
||||
// Hide unavailable (disabled) servers and trial servers for existing trial users
|
||||
.filter((server) => {
|
||||
if (!server.is_available) return false;
|
||||
if (subscription?.is_trial && server.name.toLowerCase().includes('trial')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user