diff --git a/backend/src/routes/workstations.ts b/backend/src/routes/workstations.ts index c1ca6e4..97f911f 100644 --- a/backend/src/routes/workstations.ts +++ b/backend/src/routes/workstations.ts @@ -322,6 +322,7 @@ const workstationRoutes: FastifyPluginAsync = async (fastify) => { dto_user: device.config?.dto_user, dto_pass: device.config?.dto_pass, dto_device_id: device.config?.dto_device_id, + config: device.config, }, }) as { ok: boolean; error?: string; message?: string } return result diff --git a/src/pages/EquipmentPage.tsx b/src/pages/EquipmentPage.tsx index d8989c9..f0ca200 100644 --- a/src/pages/EquipmentPage.tsx +++ b/src/pages/EquipmentPage.tsx @@ -237,6 +237,8 @@ function DeviceForm({ const [availablePrinters, setAvailablePrinters] = useState<{ name: string; isDefault: boolean }[] | null>(null) const [printersLoading, setPrintersLoading] = useState(false) const [windowsPrinter, setWindowsPrinter] = useState(String((initial?.config as any)?.windowsPrinter ?? (initial?.config as any)?.windows_printer ?? '')) + const [encoding, setEncoding] = useState<'utf8' | 'cp866'>((initial?.config as any)?.encoding ?? 'utf8') + const [paperWidth, setPaperWidth] = useState(String((initial?.config as any)?.paper_width ?? 576)) const loadPorts = () => { if (!wsOnline) return @@ -290,6 +292,10 @@ function DeviceForm({ if (type === 'printer' && connection === 'windows' && windowsPrinter.trim()) { configData.windows_printer = windowsPrinter.trim() } + if (type === 'printer' && connection === 'network') { + configData.encoding = encoding + configData.paper_width = Number(paperWidth) || 576 + } await onSave({ type, @@ -451,25 +457,52 @@ function DeviceForm({ )} {connection === 'network' && ( -
-
- - setNetworkHost(e.target.value)} - className="w-full input text-sm font-mono" - placeholder={type === 'netup' ? '172.16.0.12' : '192.168.1.50'} - /> -
-
- - setNetworkPort(e.target.value)} - className="w-full input text-sm font-mono" - placeholder={type === 'netup' ? '8880' : '9100'} - /> +
+
+
+ + setNetworkHost(e.target.value)} + className="w-full input text-sm font-mono" + placeholder={type === 'netup' ? '172.16.0.12' : '192.168.1.50'} + /> +
+
+ + setNetworkPort(e.target.value)} + className="w-full input text-sm font-mono" + placeholder={type === 'netup' ? '8880' : '9100'} + /> +
+ {type === 'printer' && ( +
+
+ + +
+
+ + setPaperWidth(e.target.value)} + className="w-full input text-sm font-mono" + placeholder="576" + /> +

58мм=384, 80мм=576

+
+
+ )}
)} @@ -766,7 +799,7 @@ function WorkstationCard({ Подключить агента - ) : ( + ) : !ws.isOnline ? ( - )} + ) : null}