diff --git a/src/pages/EquipmentPage.tsx b/src/pages/EquipmentPage.tsx index 4eb58d4..8c58358 100644 --- a/src/pages/EquipmentPage.tsx +++ b/src/pages/EquipmentPage.tsx @@ -189,6 +189,10 @@ function DeviceForm({ wsOnline: boolean }) { const [type, setType] = useState<'kkt' | 'printer' | 'netup'>(initial?.type ?? 'printer') + const handleTypeChange = (t: 'kkt' | 'printer' | 'netup') => { + setType(t) + if (t === 'netup') setConnection('network') + } const [name, setName] = useState(initial?.name ?? '') const [connection, setConnection] = useState<'usb' | 'network' | 'com'>(initial?.connection ?? 'network') const [networkHost, setNetworkHost] = useState(initial?.networkHost ?? '') @@ -230,12 +234,12 @@ function DeviceForm({ return (
-
+
-
- - -
+ {type !== 'netup' && ( +
+ + +
+ )}
{/* KKT-specific: fiscal mode + DTO port */} @@ -305,33 +311,35 @@ function DeviceForm({ value={name} onChange={e => setName(e.target.value)} className="w-full input text-sm" - placeholder="Касса №1 / Принтер кухни" + placeholder={type === 'netup' ? 'NetUp сервер' : type === 'kkt' ? 'Касса №1' : 'Принтер кухни'} />
-
- -
- {([ - { id: 'usb', icon: , label: 'USB' }, - { id: 'network', icon: , label: 'Сеть (TCP)' }, - { id: 'com', icon: , label: 'COM-порт' }, - ] as const).map(c => ( - - ))} + {type !== 'netup' && ( +
+ +
+ {([ + { id: 'usb', icon: , label: 'USB' }, + { id: 'network', icon: , label: 'Сеть (TCP)' }, + { id: 'com', icon: , label: 'COM-порт' }, + ] as const).map(c => ( + + ))} +
-
+ )} {connection === 'network' && (
@@ -341,7 +349,7 @@ function DeviceForm({ value={networkHost} onChange={e => setNetworkHost(e.target.value)} className="w-full input text-sm font-mono" - placeholder="192.168.1.50" + placeholder={type === 'netup' ? '172.16.0.12' : '192.168.1.50'} />
@@ -350,7 +358,7 @@ function DeviceForm({ value={networkPort} onChange={e => setNetworkPort(e.target.value)} className="w-full input text-sm font-mono" - placeholder="9100" + placeholder={type === 'netup' ? '8880' : '9100'} />