diff --git a/src/pages/AdminTariffs.tsx b/src/pages/AdminTariffs.tsx index ed96bec..8cbf8a6 100644 --- a/src/pages/AdminTariffs.tsx +++ b/src/pages/AdminTariffs.tsx @@ -75,6 +75,7 @@ function TariffModal({ tariff, servers, onSave, onClose, isLoading }: TariffModa const [trafficLimitGb, setTrafficLimitGb] = useState(tariff?.traffic_limit_gb || 0) const [deviceLimit, setDeviceLimit] = useState(tariff?.device_limit || 1) const [devicePriceKopeks, setDevicePriceKopeks] = useState(tariff?.device_price_kopeks || 0) + const [maxDeviceLimit, setMaxDeviceLimit] = useState(tariff?.max_device_limit || 0) const [tierLevel, setTierLevel] = useState(tariff?.tier_level || 1) const [periodPrices, setPeriodPrices] = useState( tariff?.period_prices || DEFAULT_PERIODS.map(d => ({ days: d, price_kopeks: 0 })) @@ -119,6 +120,7 @@ function TariffModal({ tariff, servers, onSave, onClose, isLoading }: TariffModa traffic_limit_gb: trafficLimitGb, device_limit: deviceLimit, device_price_kopeks: devicePriceKopeks > 0 ? devicePriceKopeks : undefined, + max_device_limit: maxDeviceLimit > 0 ? maxDeviceLimit : undefined, tier_level: tierLevel, period_prices: periodPrices.filter(p => p.price_kopeks > 0), allowed_squads: selectedSquads, @@ -442,19 +444,32 @@ function TariffModal({ tariff, servers, onSave, onClose, isLoading }: TariffModa {/* Цена за доп. устройство */}

Докупка устройств

-
- Цена за устройство (30 дней): - setDevicePriceKopeks(Math.max(0, parseFloat(e.target.value) || 0) * 100)} - className="w-24 px-3 py-2 bg-dark-600 border border-dark-500 rounded-lg text-dark-100 focus:outline-none focus:border-accent-500" - min={0} - step={1} - /> - +
+
+ Цена за устройство (30 дней): + setDevicePriceKopeks(Math.max(0, parseFloat(e.target.value) || 0) * 100)} + className="w-24 px-3 py-2 bg-dark-600 border border-dark-500 rounded-lg text-dark-100 focus:outline-none focus:border-accent-500" + min={0} + step={1} + /> + +
+

0 = докупка недоступна

+
+ Макс. устройств на тарифе: + setMaxDeviceLimit(Math.max(0, parseInt(e.target.value) || 0))} + className="w-24 px-3 py-2 bg-dark-600 border border-dark-500 rounded-lg text-dark-100 focus:outline-none focus:border-accent-500" + min={0} + /> +
+

0 = без ограничений

-

0 = докупка недоступна

{/* Произвольное количество дней */}