feat: configurable DTO login/password per KKT device
- Equipment page: add login/password fields in KKT fiscal mode form - Stored in device config JSON (dto_user, dto_pass) - Backend passes credentials to agent in test_device command - Agent uses per-device credentials for all ATOL DTO API calls Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -201,6 +201,8 @@ function DeviceForm({
|
||||
const [purpose, setPurpose] = useState(initial?.purpose ?? 'receipt')
|
||||
const [fiscalMode, setFiscalMode] = useState(initial?.fiscalMode !== false)
|
||||
const [dtoPort, setDtoPort] = useState(String(initial?.dtoPort ?? 16732))
|
||||
const [dtoUser, setDtoUser] = useState(String(initial?.config?.dto_user ?? '30'))
|
||||
const [dtoPass, setDtoPass] = useState(String(initial?.config?.dto_pass ?? '30'))
|
||||
const [saving, setSaving] = useState(false)
|
||||
const [availablePorts, setAvailablePorts] = useState<{ port: string; description?: string }[] | null>(null)
|
||||
const [portsLoading, setPortsLoading] = useState(false)
|
||||
@@ -228,6 +230,7 @@ function DeviceForm({
|
||||
purpose: purpose as WorkstationDevice['purpose'],
|
||||
fiscalMode: type === 'kkt' ? fiscalMode : undefined,
|
||||
dtoPort: type === 'kkt' && fiscalMode ? Number(dtoPort) : undefined,
|
||||
config: type === 'kkt' && fiscalMode ? { dto_user: dtoUser, dto_pass: dtoPass } : undefined,
|
||||
})
|
||||
setSaving(false)
|
||||
}
|
||||
@@ -291,15 +294,38 @@ function DeviceForm({
|
||||
</div>
|
||||
</div>
|
||||
{fiscalMode && (
|
||||
<div>
|
||||
<label className="block text-xs font-medium text-slate-500 mb-1">Порт АТОЛ ДТО</label>
|
||||
<input
|
||||
value={dtoPort}
|
||||
onChange={e => setDtoPort(e.target.value)}
|
||||
className="w-32 input text-sm font-mono"
|
||||
placeholder="16732"
|
||||
/>
|
||||
<p className="text-xs text-slate-400 mt-1">Порт АТОЛ ДТО 10 (по умолчанию 16732). Для нескольких касс — разные порты.</p>
|
||||
<div className="space-y-3">
|
||||
<div>
|
||||
<label className="block text-xs font-medium text-slate-500 mb-1">Порт АТОЛ ДТО</label>
|
||||
<input
|
||||
value={dtoPort}
|
||||
onChange={e => setDtoPort(e.target.value)}
|
||||
className="w-32 input text-sm font-mono"
|
||||
placeholder="16732"
|
||||
/>
|
||||
<p className="text-xs text-slate-400 mt-1">По умолчанию 16732. Для нескольких касс — разные порты.</p>
|
||||
</div>
|
||||
<div className="grid grid-cols-2 gap-3">
|
||||
<div>
|
||||
<label className="block text-xs font-medium text-slate-500 mb-1">Логин ДТО</label>
|
||||
<input
|
||||
value={dtoUser}
|
||||
onChange={e => setDtoUser(e.target.value)}
|
||||
className="w-full input text-sm"
|
||||
placeholder="30"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<label className="block text-xs font-medium text-slate-500 mb-1">Пароль ДТО</label>
|
||||
<input
|
||||
type="password"
|
||||
value={dtoPass}
|
||||
onChange={e => setDtoPass(e.target.value)}
|
||||
className="w-full input text-sm"
|
||||
placeholder="30"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user