feat(ui-camera): aplicar sistema de diseno OnEver y soporte universal de camaras en Android y Windows
This commit is contained in:
@@ -5,6 +5,8 @@
|
|||||||
# Entorno local y secretos
|
# Entorno local y secretos
|
||||||
.env
|
.env
|
||||||
*.env.local
|
*.env.local
|
||||||
|
backend/certs/
|
||||||
|
certs/
|
||||||
|
|
||||||
# Python
|
# Python
|
||||||
__pycache__/
|
__pycache__/
|
||||||
|
|||||||
+10
-3
@@ -14,9 +14,16 @@ Todas las modificaciones, adiciones y decisiones de arquitectura notables de est
|
|||||||
- **Pestaña de Historial de Movimientos Reales (`mvthist`):**
|
- **Pestaña de Historial de Movimientos Reales (`mvthist`):**
|
||||||
- Nuevo endpoint `/api/v1/access/movements/recent` para consultar las últimas transacciones registradas en SQL Server.
|
- Nuevo endpoint `/api/v1/access/movements/recent` para consultar las últimas transacciones registradas en SQL Server.
|
||||||
- Implementación en `ControlPostView.tsx` de selector de pestañas entre "🟢 En Predio (Activos)" y "📜 Historial Movimientos BD".
|
- Implementación en `ControlPostView.tsx` de selector de pestañas entre "🟢 En Predio (Activos)" y "📜 Historial Movimientos BD".
|
||||||
- **Visualización sin Mocks de Tickets Activos (`tck`):**
|
- **Adopción Total del Sistema de Diseño Oficial (`styles/design_system.py`):**
|
||||||
- Ajuste en `AccessRepository.listar_tickets_activos` con `LEFT JOIN` a integrantes y desduplicación por `TicketID`.
|
- Implementación en `tokens.css` y `base.css` de la paleta oficial OnEver: `--bg-main` (`#0F172A`), `--bg-sidebar` (`#020617`), `--input-bg` (`#1E293B`), `--blue-base` (`#2563EB`), `--blue-hover` (`#3B82F6`), `--success` (`#10B981`), `--danger` (`#EF4444`) y `--border` (`#374151`).
|
||||||
- Botón de refresco manual "🔄 Actualizar" en la barra de control para sincronización inmediata.
|
- Bordes redondeados estandarizados a `10px` en tarjetas, entradas, botones y selectores.
|
||||||
|
- Soporte de temas Claro/Oscuro dinámicos mediante hook `useTheme` y conmutador táctil `☀️ / 🌙`.
|
||||||
|
- Tipografía profesional `'Segoe UI', 'Roboto', sans-serif` con estilos de títulos, scrollbars modernas y badges de estado.
|
||||||
|
- **Acceso Robusto y Universal a Cámaras en Android y Windows:**
|
||||||
|
- Integración de biblioteca industrial `@zxing/library` para decodificación universal de códigos PDF417 de DNI tarjeta y QR digital en cualquier navegador.
|
||||||
|
- Fallback de captura fotográfica nativa (`capture="environment"`) que abre directamente la cámara de Samsung Galaxy / Windows sin requerir streaming continuo WebRTC ni HTTPS en red local.
|
||||||
|
- Fallback automático de restricciones de video (`{ video: true }`) para webcams de escritorio Windows que rechazan `facingMode: environment`.
|
||||||
|
- Despliegue dual de backend en HTTP (`:8000`) y HTTPS con certificado SSL (`:8443`) para habilitar Secure Context en tablets.
|
||||||
|
|
||||||
## [v0.6.0-beta] - 2026-10-13 (Fase 6: Despliegue Piloto y Convivencia Híbrida)
|
## [v0.6.0-beta] - 2026-10-13 (Fase 6: Despliegue Piloto y Convivencia Híbrida)
|
||||||
|
|
||||||
|
|||||||
Generated
+34
-2
@@ -1,13 +1,14 @@
|
|||||||
{
|
{
|
||||||
"name": "onevercontrol-frontend",
|
"name": "onevercontrol-frontend",
|
||||||
"version": "0.1.0-alpha",
|
"version": "0.6.1-beta",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "onevercontrol-frontend",
|
"name": "onevercontrol-frontend",
|
||||||
"version": "0.1.0-alpha",
|
"version": "0.6.1-beta",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@zxing/library": "^0.23.0",
|
||||||
"react": "^18.3.1",
|
"react": "^18.3.1",
|
||||||
"react-dom": "^18.3.1"
|
"react-dom": "^18.3.1"
|
||||||
},
|
},
|
||||||
@@ -1219,6 +1220,28 @@
|
|||||||
"vite": "^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0"
|
"vite": "^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@zxing/library": {
|
||||||
|
"version": "0.23.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@zxing/library/-/library-0.23.0.tgz",
|
||||||
|
"integrity": "sha512-6fkkoFwP8CHxl6ugnPsj74PLJgX2iRv5zczGAyt5OBzQgxFhuhF0NCEc4t4OvSr8xAv2MRLlI0Iu9ZGDZQ2urA==",
|
||||||
|
"license": "Apache-2.0",
|
||||||
|
"dependencies": {
|
||||||
|
"ts-custom-error": "^3.3.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 24.0.0"
|
||||||
|
},
|
||||||
|
"optionalDependencies": {
|
||||||
|
"@zxing/text-encoding": "~0.9.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@zxing/text-encoding": {
|
||||||
|
"version": "0.9.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@zxing/text-encoding/-/text-encoding-0.9.0.tgz",
|
||||||
|
"integrity": "sha512-U/4aVJ2mxI0aDNI8Uq0wEhMgY+u4CNtEb0om3+y3+niDAsoTCOB33UF0sxpzqzdqXLqmvc+vZyAt4O8pPdfkwA==",
|
||||||
|
"license": "(Unlicense OR Apache-2.0)",
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
"node_modules/baseline-browser-mapping": {
|
"node_modules/baseline-browser-mapping": {
|
||||||
"version": "2.11.28",
|
"version": "2.11.28",
|
||||||
"resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.28.tgz",
|
"resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.28.tgz",
|
||||||
@@ -1638,6 +1661,15 @@
|
|||||||
"node": ">=0.10.0"
|
"node": ">=0.10.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/ts-custom-error": {
|
||||||
|
"version": "3.3.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/ts-custom-error/-/ts-custom-error-3.3.1.tgz",
|
||||||
|
"integrity": "sha512-5OX1tzOjxWEgsr/YEUWSuPrQ00deKLh6D7OTWcvNHm12/7QPyRh8SYpyWvA4IZv8H/+GQWQEh/kwo95Q9OVW1A==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=14.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/typescript": {
|
"node_modules/typescript": {
|
||||||
"version": "5.9.3",
|
"version": "5.9.3",
|
||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
"preview": "vite preview"
|
"preview": "vite preview"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@zxing/library": "^0.23.0",
|
||||||
"react": "^18.3.1",
|
"react": "^18.3.1",
|
||||||
"react-dom": "^18.3.1"
|
"react-dom": "^18.3.1"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
// ==============================================================================
|
// ==============================================================================
|
||||||
// Modal de Escaneo Óptico con Cámara de Tablet (BarcodeDetector / PDF417 / QR)
|
// Modal de Escaneo Óptico con Cámara para Tablets (Android) y Windows
|
||||||
// Optimizado para tablets Samsung Galaxy Tab A9/A11 (4GB RAM) con liberación inmediata de hardware
|
// Soporte de Video en Vivo (WebRTC) + ZXing Library (PDF417 / QR) + Captura de Foto Nativa
|
||||||
|
// Cumple con el sistema de diseño OnEver (C:\Workspace\OemspotPySYS\styles\design_system.py)
|
||||||
// ==============================================================================
|
// ==============================================================================
|
||||||
import React, { useEffect, useRef, useState, useCallback } from 'react';
|
import React, { useEffect, useRef, useState, useCallback } from 'react';
|
||||||
|
import { BrowserMultiFormatReader, BarcodeFormat, DecodeHintType } from '@zxing/library';
|
||||||
import { accessApi } from '../../api/accessApi';
|
import { accessApi } from '../../api/accessApi';
|
||||||
import { DNIParsedResult } from '../../types';
|
import { DNIParsedResult } from '../../types';
|
||||||
|
|
||||||
@@ -19,23 +21,57 @@ export const CameraScannerModal: React.FC<CameraScannerModalProps> = ({
|
|||||||
}) => {
|
}) => {
|
||||||
const videoRef = useRef<HTMLVideoElement | null>(null);
|
const videoRef = useRef<HTMLVideoElement | null>(null);
|
||||||
const streamRef = useRef<MediaStream | null>(null);
|
const streamRef = useRef<MediaStream | null>(null);
|
||||||
const intervalRef = useRef<number | null>(null);
|
const zxingReaderRef = useRef<BrowserMultiFormatReader | null>(null);
|
||||||
|
const fileInputRef = useRef<HTMLInputElement | null>(null);
|
||||||
|
|
||||||
const [hasCamera, setHasCamera] = useState<boolean>(true);
|
const [hasCamera, setHasCamera] = useState<boolean>(true);
|
||||||
|
const [insecureContextWarning, setInsecureContextWarning] = useState<boolean>(false);
|
||||||
const [errorMsg, setErrorMsg] = useState<string | null>(null);
|
const [errorMsg, setErrorMsg] = useState<string | null>(null);
|
||||||
const [isProcessing, setIsProcessing] = useState<boolean>(false);
|
const [isProcessing, setIsProcessing] = useState<boolean>(false);
|
||||||
const [torchEnabled, setTorchEnabled] = useState<boolean>(false);
|
const [torchEnabled, setTorchEnabled] = useState<boolean>(false);
|
||||||
const [supportsTorch, setSupportsTorch] = useState<boolean>(false);
|
const [supportsTorch, setSupportsTorch] = useState<boolean>(false);
|
||||||
const [manualText, setManualText] = useState<string>('');
|
const [manualText, setManualText] = useState<string>('');
|
||||||
|
const [availableDevices, setAvailableDevices] = useState<MediaDeviceInfo[]>([]);
|
||||||
|
const [selectedDeviceId, setSelectedDeviceId] = useState<string>('');
|
||||||
|
|
||||||
|
// Inicializar lector ZXing configurado para DNI Argentino (PDF417 + QR + Code128)
|
||||||
|
useEffect(() => {
|
||||||
|
const hints = new Map();
|
||||||
|
hints.set(DecodeHintType.POSSIBLE_FORMATS, [
|
||||||
|
BarcodeFormat.PDF_417,
|
||||||
|
BarcodeFormat.QR_CODE,
|
||||||
|
BarcodeFormat.CODE_128,
|
||||||
|
]);
|
||||||
|
hints.set(DecodeHintType.TRY_HARDER, true);
|
||||||
|
|
||||||
|
zxingReaderRef.current = new BrowserMultiFormatReader(hints, 250);
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
if (zxingReaderRef.current) {
|
||||||
|
try {
|
||||||
|
zxingReaderRef.current.reset();
|
||||||
|
} catch {
|
||||||
|
// Cleanup
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}, []);
|
||||||
|
|
||||||
const stopCamera = useCallback(() => {
|
const stopCamera = useCallback(() => {
|
||||||
if (intervalRef.current) {
|
if (zxingReaderRef.current) {
|
||||||
clearInterval(intervalRef.current);
|
try {
|
||||||
intervalRef.current = null;
|
zxingReaderRef.current.reset();
|
||||||
|
} catch {
|
||||||
|
// Ignorar
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (streamRef.current) {
|
if (streamRef.current) {
|
||||||
streamRef.current.getTracks().forEach((track) => {
|
streamRef.current.getTracks().forEach((track) => {
|
||||||
|
try {
|
||||||
track.stop();
|
track.stop();
|
||||||
|
} catch {
|
||||||
|
// Ignorar
|
||||||
|
}
|
||||||
});
|
});
|
||||||
streamRef.current = null;
|
streamRef.current = null;
|
||||||
}
|
}
|
||||||
@@ -48,6 +84,7 @@ export const CameraScannerModal: React.FC<CameraScannerModalProps> = ({
|
|||||||
async (rawText: string) => {
|
async (rawText: string) => {
|
||||||
if (isProcessing || !rawText) return;
|
if (isProcessing || !rawText) return;
|
||||||
setIsProcessing(true);
|
setIsProcessing(true);
|
||||||
|
setErrorMsg(null);
|
||||||
try {
|
try {
|
||||||
const res = await accessApi.parseDni(rawText);
|
const res = await accessApi.parseDni(rawText);
|
||||||
if (res.valido) {
|
if (res.valido) {
|
||||||
@@ -55,7 +92,7 @@ export const CameraScannerModal: React.FC<CameraScannerModalProps> = ({
|
|||||||
onScanSuccess(res);
|
onScanSuccess(res);
|
||||||
onClose();
|
onClose();
|
||||||
} else {
|
} else {
|
||||||
setErrorMsg('Código detectado pero no corresponde a un DNI argentino válido.');
|
setErrorMsg(`Código detectado pero no es un DNI argentino válido (${rawText.slice(0, 30)}...).`);
|
||||||
}
|
}
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
setErrorMsg(err.message || 'Error al interpretar el código escaneado.');
|
setErrorMsg(err.message || 'Error al interpretar el código escaneado.');
|
||||||
@@ -66,21 +103,68 @@ export const CameraScannerModal: React.FC<CameraScannerModalProps> = ({
|
|||||||
[isProcessing, stopCamera, onScanSuccess, onClose]
|
[isProcessing, stopCamera, onScanSuccess, onClose]
|
||||||
);
|
);
|
||||||
|
|
||||||
const startCamera = useCallback(async () => {
|
const startCamera = useCallback(async (deviceIdToUse?: string) => {
|
||||||
setErrorMsg(null);
|
setErrorMsg(null);
|
||||||
setHasCamera(true);
|
setHasCamera(true);
|
||||||
|
|
||||||
|
// Verificar si el navegador permite acceso a mediaDevices
|
||||||
|
const isSecure = window.isSecureContext || window.location.hostname === 'localhost' || window.location.hostname === '127.0.0.1';
|
||||||
|
if (!navigator.mediaDevices || !navigator.mediaDevices.getUserMedia) {
|
||||||
|
setHasCamera(false);
|
||||||
|
if (!isSecure) {
|
||||||
|
setInsecureContextWarning(true);
|
||||||
|
setErrorMsg(
|
||||||
|
'El navegador bloqueó la cámara porque la conexión es HTTP sobre red local. Utilice el botón "📷 Tomar Foto con Cámara" para escanear sin restricciones de seguridad.'
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
setErrorMsg('Dispositivo de video no soportado o bloqueado por el sistema operativo.');
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const constraints: MediaStreamConstraints = {
|
// 1. Obtener lista de cámaras disponibles si es posible
|
||||||
video: {
|
try {
|
||||||
facingMode: { ideal: 'environment' }, // Cámara trasera de la tablet
|
const devices = await navigator.mediaDevices.enumerateDevices();
|
||||||
|
const videoDevices = devices.filter((d) => d.kind === 'videoinput');
|
||||||
|
setAvailableDevices(videoDevices);
|
||||||
|
} catch {
|
||||||
|
// En algunos navegadores enumerateDevices requiere haber abierto stream previo
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. Definir constraints (con fallback para Windows laptop vs Android tablet)
|
||||||
|
let stream: MediaStream | null = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
// Intento 1: Cámara trasera de tablet / dispositivo específico
|
||||||
|
const videoConstraints: MediaTrackConstraints = deviceIdToUse
|
||||||
|
? { deviceId: { exact: deviceIdToUse } }
|
||||||
|
: {
|
||||||
|
facingMode: { ideal: 'environment' },
|
||||||
width: { ideal: 1280 },
|
width: { ideal: 1280 },
|
||||||
height: { ideal: 720 },
|
height: { ideal: 720 },
|
||||||
},
|
|
||||||
audio: false,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const stream = await navigator.mediaDevices.getUserMedia(constraints);
|
stream = await navigator.mediaDevices.getUserMedia({
|
||||||
|
video: videoConstraints,
|
||||||
|
audio: false,
|
||||||
|
});
|
||||||
|
} catch {
|
||||||
|
// Intento 2: Fallback simple para webcam de PC Windows o cámara estándar
|
||||||
|
try {
|
||||||
|
stream = await navigator.mediaDevices.getUserMedia({
|
||||||
|
video: true,
|
||||||
|
audio: false,
|
||||||
|
});
|
||||||
|
} catch (innerErr: any) {
|
||||||
|
throw innerErr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!stream) {
|
||||||
|
throw new Error('No se pudo inicializar el flujo de video.');
|
||||||
|
}
|
||||||
|
|
||||||
streamRef.current = stream;
|
streamRef.current = stream;
|
||||||
|
|
||||||
if (videoRef.current) {
|
if (videoRef.current) {
|
||||||
@@ -95,37 +179,83 @@ export const CameraScannerModal: React.FC<CameraScannerModalProps> = ({
|
|||||||
setSupportsTorch(true);
|
setSupportsTorch(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Inicializar detección si BarcodeDetector está disponible
|
// Iniciar decodificación continua con ZXing sobre el elemento video
|
||||||
if ('BarcodeDetector' in window) {
|
if (zxingReaderRef.current && videoRef.current) {
|
||||||
const BarcodeDetectorClass = (window as any).BarcodeDetector;
|
zxingReaderRef.current.decodeFromVideoElementContinuously(
|
||||||
const detector = new BarcodeDetectorClass({
|
videoRef.current,
|
||||||
formats: ['pdf417', 'qr_code', 'code_128'],
|
(result: any) => {
|
||||||
});
|
if (result) {
|
||||||
|
const text = result.getText?.() || result.text;
|
||||||
intervalRef.current = window.setInterval(async () => {
|
if (text) {
|
||||||
if (!videoRef.current || isProcessing) return;
|
handleDecodedString(text);
|
||||||
try {
|
|
||||||
const barcodes = await detector.detect(videoRef.current);
|
|
||||||
if (barcodes.length > 0) {
|
|
||||||
const rawVal = barcodes[0].rawValue;
|
|
||||||
if (rawVal) {
|
|
||||||
handleDecodedString(rawVal);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch {
|
|
||||||
// Ignorar errores de frame no listo
|
|
||||||
}
|
}
|
||||||
}, 300); // Muestreo cada 300ms optimizado para 4GB RAM
|
);
|
||||||
}
|
}
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
setHasCamera(false);
|
setHasCamera(false);
|
||||||
setErrorMsg('No se pudo acceder a la cámara de la tablet. Permiso denegado o dispositivo no disponible.');
|
const name = err.name || '';
|
||||||
|
if (name === 'NotAllowedError' || name === 'PermissionDeniedError') {
|
||||||
|
setErrorMsg('Permiso de cámara denegado. Habilite el acceso en la barra del navegador.');
|
||||||
|
} else if (name === 'NotFoundError' || name === 'DevicesNotFoundError') {
|
||||||
|
setErrorMsg('No se detectó ninguna cámara conectada al dispositivo.');
|
||||||
|
} else if (name === 'NotReadableError') {
|
||||||
|
setErrorMsg('La cámara está siendo usada por otra aplicación en Windows.');
|
||||||
|
} else {
|
||||||
|
setErrorMsg(`No se pudo iniciar la cámara: ${err.message || 'Error desconocido'}`);
|
||||||
}
|
}
|
||||||
}, [handleDecodedString, isProcessing]);
|
}
|
||||||
|
}, [handleDecodedString]);
|
||||||
|
|
||||||
|
// Manejador de captura de foto nativa (funciona sin HTTPS en tablets Android)
|
||||||
|
const handlePhotoCaptured = async (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
|
const file = e.target.files?.[0];
|
||||||
|
if (!file) return;
|
||||||
|
|
||||||
|
setIsProcessing(true);
|
||||||
|
setErrorMsg(null);
|
||||||
|
|
||||||
|
try {
|
||||||
|
const reader = new FileReader();
|
||||||
|
reader.onload = async (event) => {
|
||||||
|
const dataUrl = event.target?.result as string;
|
||||||
|
if (!dataUrl) {
|
||||||
|
setIsProcessing(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Crear imagen temporal para decodificar con ZXing
|
||||||
|
const img = new Image();
|
||||||
|
img.src = dataUrl;
|
||||||
|
img.onload = async () => {
|
||||||
|
try {
|
||||||
|
if (zxingReaderRef.current) {
|
||||||
|
const result = await zxingReaderRef.current.decodeFromImageElement(img);
|
||||||
|
if (result && result.getText()) {
|
||||||
|
handleDecodedString(result.getText());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
// ZXing no pudo decodificar directo; intentar OCR / backend fallback
|
||||||
|
}
|
||||||
|
|
||||||
|
// Si el código no fue legible directo de la foto, avisar al usuario
|
||||||
|
setErrorMsg('No se pudo detectar el código de barras en la foto. Intente con mejor iluminación o acerque el código.');
|
||||||
|
setIsProcessing(false);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
reader.readAsDataURL(file);
|
||||||
|
} catch (err: any) {
|
||||||
|
setErrorMsg('Error al procesar la imagen capturada.');
|
||||||
|
setIsProcessing(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (isOpen) {
|
if (isOpen) {
|
||||||
startCamera();
|
startCamera(selectedDeviceId || undefined);
|
||||||
} else {
|
} else {
|
||||||
stopCamera();
|
stopCamera();
|
||||||
}
|
}
|
||||||
@@ -133,7 +263,7 @@ export const CameraScannerModal: React.FC<CameraScannerModalProps> = ({
|
|||||||
return () => {
|
return () => {
|
||||||
stopCamera();
|
stopCamera();
|
||||||
};
|
};
|
||||||
}, [isOpen, startCamera, stopCamera]);
|
}, [isOpen, startCamera, stopCamera, selectedDeviceId]);
|
||||||
|
|
||||||
const toggleTorch = async () => {
|
const toggleTorch = async () => {
|
||||||
if (!streamRef.current) return;
|
if (!streamRef.current) return;
|
||||||
@@ -166,7 +296,8 @@ export const CameraScannerModal: React.FC<CameraScannerModalProps> = ({
|
|||||||
left: 0,
|
left: 0,
|
||||||
right: 0,
|
right: 0,
|
||||||
bottom: 0,
|
bottom: 0,
|
||||||
backgroundColor: 'rgba(0, 0, 0, 0.85)',
|
backgroundColor: 'rgba(2, 6, 23, 0.85)',
|
||||||
|
backdropFilter: 'blur(4px)',
|
||||||
zIndex: 9999,
|
zIndex: 9999,
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
flexDirection: 'column',
|
flexDirection: 'column',
|
||||||
@@ -176,16 +307,17 @@ export const CameraScannerModal: React.FC<CameraScannerModalProps> = ({
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
|
className="card"
|
||||||
style={{
|
style={{
|
||||||
width: '100%',
|
width: '100%',
|
||||||
maxWidth: '640px',
|
maxWidth: '620px',
|
||||||
backgroundColor: 'var(--bg-surface)',
|
backgroundColor: 'var(--bg-sidebar)',
|
||||||
borderRadius: 'var(--radius-lg)',
|
borderRadius: '10px',
|
||||||
overflow: 'hidden',
|
overflow: 'hidden',
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
flexDirection: 'column',
|
flexDirection: 'column',
|
||||||
boxShadow: 'var(--shadow-lg)',
|
boxShadow: 'var(--shadow-lg)',
|
||||||
border: '1px solid var(--border-subtle)',
|
border: '1px solid var(--border)',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{/* Cabecera del Escáner */}
|
{/* Cabecera del Escáner */}
|
||||||
@@ -195,30 +327,35 @@ export const CameraScannerModal: React.FC<CameraScannerModalProps> = ({
|
|||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
justifyContent: 'space-between',
|
justifyContent: 'space-between',
|
||||||
padding: '1rem 1.25rem',
|
padding: '1rem 1.25rem',
|
||||||
borderBottom: '1px solid var(--border-subtle)',
|
borderBottom: '1px solid var(--divider)',
|
||||||
backgroundColor: 'var(--bg-card)',
|
backgroundColor: 'var(--bg-sidebar)',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div style={{ display: 'flex', alignItems: 'center', gap: '0.5rem' }}>
|
<div style={{ display: 'flex', alignItems: 'center', gap: '0.65rem' }}>
|
||||||
<span style={{ fontSize: '1.25rem' }}>📷</span>
|
<span style={{ fontSize: '1.3rem' }}>📷</span>
|
||||||
<h2 style={{ fontSize: '1.1rem', fontWeight: 600, margin: 0, color: 'var(--text-primary)' }}>
|
<div>
|
||||||
Escanear DNI Argentino (Cámara Tablet)
|
<h2 style={{ fontSize: '1.05rem', fontWeight: 700, margin: 0, color: 'var(--text-1)' }}>
|
||||||
|
Escanear DNI Argentino (Cámara / PDF417)
|
||||||
</h2>
|
</h2>
|
||||||
|
<span style={{ fontSize: '0.75rem', color: 'var(--text-3)' }}>
|
||||||
|
Soporta DNI tarjeta, PDF417, QR digital y fotos nativas
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
stopCamera();
|
stopCamera();
|
||||||
onClose();
|
onClose();
|
||||||
}}
|
}}
|
||||||
|
className="btn-outline"
|
||||||
style={{
|
style={{
|
||||||
background: 'transparent',
|
padding: '0.35rem 0.65rem',
|
||||||
|
minHeight: '36px',
|
||||||
border: 'none',
|
border: 'none',
|
||||||
fontSize: '1.5rem',
|
fontSize: '1.25rem',
|
||||||
color: 'var(--text-muted)',
|
color: 'var(--text-2)',
|
||||||
cursor: 'pointer',
|
|
||||||
padding: '0.25rem 0.5rem',
|
|
||||||
}}
|
}}
|
||||||
title="Cerrar"
|
title="Cerrar modal"
|
||||||
>
|
>
|
||||||
✕
|
✕
|
||||||
</button>
|
</button>
|
||||||
@@ -229,7 +366,7 @@ export const CameraScannerModal: React.FC<CameraScannerModalProps> = ({
|
|||||||
style={{
|
style={{
|
||||||
position: 'relative',
|
position: 'relative',
|
||||||
width: '100%',
|
width: '100%',
|
||||||
height: '320px',
|
height: '310px',
|
||||||
backgroundColor: '#000',
|
backgroundColor: '#000',
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
@@ -253,11 +390,11 @@ export const CameraScannerModal: React.FC<CameraScannerModalProps> = ({
|
|||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
width: '80%',
|
width: '82%',
|
||||||
height: '65%',
|
height: '62%',
|
||||||
border: '2px dashed var(--accent-primary)',
|
border: '2px dashed var(--blue-base)',
|
||||||
borderRadius: '12px',
|
borderRadius: '10px',
|
||||||
boxShadow: '0 0 0 9999px rgba(0, 0, 0, 0.45)',
|
boxShadow: '0 0 0 9999px rgba(2, 6, 23, 0.5)',
|
||||||
pointerEvents: 'none',
|
pointerEvents: 'none',
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
@@ -266,21 +403,27 @@ export const CameraScannerModal: React.FC<CameraScannerModalProps> = ({
|
|||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
style={{
|
style={{
|
||||||
backgroundColor: 'rgba(0, 0, 0, 0.7)',
|
backgroundColor: 'rgba(15, 23, 42, 0.85)',
|
||||||
color: '#fff',
|
color: 'var(--text-1)',
|
||||||
padding: '0.25rem 0.75rem',
|
padding: '0.3rem 0.85rem',
|
||||||
borderRadius: '4px',
|
borderRadius: '6px',
|
||||||
fontSize: '0.8rem',
|
fontSize: '0.8rem',
|
||||||
|
border: '1px solid var(--border)',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Ubique el código de barras PDF417 o QR aquí
|
Ubique el código PDF417 o QR aquí
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<div style={{ padding: '2rem', textAlign: 'center', color: 'var(--text-muted)' }}>
|
<div style={{ padding: '2rem', textAlign: 'center', color: 'var(--text-2)', maxWidth: '480px' }}>
|
||||||
<p>📷 Cámara no disponible en este dispositivo o sin permisos.</p>
|
<div style={{ fontSize: '2.5rem', marginBottom: '0.75rem' }}>📷</div>
|
||||||
<p style={{ fontSize: '0.85rem' }}>Puede ingresar el código manualmente abajo.</p>
|
<p style={{ fontWeight: 600, color: 'var(--text-1)' }}>Cámara en vivo no inicializada</p>
|
||||||
|
<p style={{ fontSize: '0.825rem', marginTop: '0.5rem', color: 'var(--text-3)' }}>
|
||||||
|
{insecureContextWarning
|
||||||
|
? 'En red local sin HTTPS, el navegador restringe el streaming continuo. Puede usar la opción de Foto Nativa debajo que opera directamente sin restricciones.'
|
||||||
|
: 'Puede tomar una foto directa o ingresar el código manualmente abajo.'}
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
@@ -292,16 +435,17 @@ export const CameraScannerModal: React.FC<CameraScannerModalProps> = ({
|
|||||||
left: 0,
|
left: 0,
|
||||||
right: 0,
|
right: 0,
|
||||||
bottom: 0,
|
bottom: 0,
|
||||||
backgroundColor: 'rgba(0,0,0,0.6)',
|
backgroundColor: 'rgba(2, 6, 23, 0.8)',
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
color: '#fff',
|
color: 'var(--text-1)',
|
||||||
fontSize: '1rem',
|
fontSize: '1rem',
|
||||||
fontWeight: 600,
|
fontWeight: 600,
|
||||||
|
gap: '0.5rem',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
⏳ Interpretando datos de identidad...
|
<span>⏳</span> Procesando datos de identidad...
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
@@ -310,30 +454,74 @@ export const CameraScannerModal: React.FC<CameraScannerModalProps> = ({
|
|||||||
{errorMsg && (
|
{errorMsg && (
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
padding: '0.75rem 1rem',
|
padding: '0.65rem 1rem',
|
||||||
backgroundColor: 'var(--status-danger-bg)',
|
backgroundColor: 'var(--color-danger-bg)',
|
||||||
color: 'var(--status-danger)',
|
color: 'var(--danger-hover)',
|
||||||
fontSize: '0.85rem',
|
fontSize: '0.825rem',
|
||||||
borderBottom: '1px solid var(--border-subtle)',
|
borderBottom: '1px solid var(--border)',
|
||||||
|
display: 'flex',
|
||||||
|
alignItems: 'center',
|
||||||
|
gap: '0.5rem',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
⚠️ {errorMsg}
|
<span>⚠️</span> {errorMsg}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Barra de Acciones y Controles Táctiles */}
|
{/* Barra de Acciones y Controles Táctiles */}
|
||||||
<div style={{ padding: '1rem', display: 'flex', flexDirection: 'column', gap: '0.75rem' }}>
|
<div style={{ padding: '1rem', display: 'flex', flexDirection: 'column', gap: '0.75rem', backgroundColor: 'var(--bg-sidebar)' }}>
|
||||||
<div style={{ display: 'flex', gap: '0.5rem', justifyContent: 'space-between' }}>
|
{/* Selector de cámara si hay múltiples dispositivos */}
|
||||||
|
{availableDevices.length > 1 && (
|
||||||
|
<div style={{ display: 'flex', alignItems: 'center', gap: '0.5rem' }}>
|
||||||
|
<span style={{ fontSize: '0.75rem', color: 'var(--text-2)', fontWeight: 600 }}>CÁMARA:</span>
|
||||||
|
<select
|
||||||
|
className="input-touch"
|
||||||
|
value={selectedDeviceId}
|
||||||
|
onChange={(e) => setSelectedDeviceId(e.target.value)}
|
||||||
|
style={{ minHeight: '36px', fontSize: '0.85rem' }}
|
||||||
|
>
|
||||||
|
<option value="">(Automática / Trasera)</option>
|
||||||
|
{availableDevices.map((d) => (
|
||||||
|
<option key={d.deviceId} value={d.deviceId}>
|
||||||
|
{d.label || `Cámara ${d.deviceId.slice(0, 6)}...`}
|
||||||
|
</option>
|
||||||
|
))}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* Botones principales: Foto Nativa (Universal) + Linterna */}
|
||||||
|
<div style={{ display: 'flex', gap: '0.65rem' }}>
|
||||||
|
<input
|
||||||
|
type="file"
|
||||||
|
ref={fileInputRef}
|
||||||
|
accept="image/*"
|
||||||
|
capture="environment"
|
||||||
|
onChange={handlePhotoCaptured}
|
||||||
|
style={{ display: 'none' }}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="btn btn-primary"
|
||||||
|
onClick={() => fileInputRef.current?.click()}
|
||||||
|
style={{ flex: 1, minHeight: '44px' }}
|
||||||
|
title="Abre la cámara nativa de Android / Windows para fotografiar el DNI"
|
||||||
|
>
|
||||||
|
📸 Capturar Foto de DNI
|
||||||
|
</button>
|
||||||
|
|
||||||
{supportsTorch && (
|
{supportsTorch && (
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="btn btn-secondary"
|
className="btn btn-secondary"
|
||||||
onClick={toggleTorch}
|
onClick={toggleTorch}
|
||||||
style={{ flex: 1, minHeight: '48px' }}
|
style={{ minHeight: '44px', padding: '0 0.85rem' }}
|
||||||
>
|
>
|
||||||
{torchEnabled ? '🔦 Apagar Linterna' : '💡 Encender Linterna'}
|
{torchEnabled ? '🔦 Apagar' : '💡 Linterna'}
|
||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="btn btn-secondary"
|
className="btn btn-secondary"
|
||||||
@@ -341,29 +529,29 @@ export const CameraScannerModal: React.FC<CameraScannerModalProps> = ({
|
|||||||
stopCamera();
|
stopCamera();
|
||||||
onClose();
|
onClose();
|
||||||
}}
|
}}
|
||||||
style={{ flex: 1, minHeight: '48px' }}
|
style={{ minHeight: '44px', padding: '0 1rem' }}
|
||||||
>
|
>
|
||||||
Cancelar
|
Cancelar
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Formulario alternativo de carga manual de texto crudo */}
|
{/* Formulario alternativo de carga manual de texto o número */}
|
||||||
<form onSubmit={handleManualSubmit} style={{ display: 'flex', gap: '0.5rem', marginTop: '0.5rem' }}>
|
<form onSubmit={handleManualSubmit} style={{ display: 'flex', gap: '0.5rem', marginTop: '0.25rem' }}>
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
className="input-touch"
|
className="input-touch"
|
||||||
placeholder="Pegar o escribir código DNI o número..."
|
placeholder="Pegar código PDF417, QR o número de DNI..."
|
||||||
value={manualText}
|
value={manualText}
|
||||||
onChange={(e) => setManualText(e.target.value)}
|
onChange={(e) => setManualText(e.target.value)}
|
||||||
style={{ flex: 1, fontSize: '0.9rem' }}
|
style={{ flex: 1, fontSize: '0.875rem', minHeight: '42px' }}
|
||||||
/>
|
/>
|
||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
className="btn btn-primary"
|
className="btn btn-primary"
|
||||||
disabled={!manualText.trim() || isProcessing}
|
disabled={!manualText.trim() || isProcessing}
|
||||||
style={{ minHeight: '48px', padding: '0 1rem' }}
|
style={{ minHeight: '42px', padding: '0 1.15rem' }}
|
||||||
>
|
>
|
||||||
Procesar
|
Interpretar
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
import { useState, useEffect } from 'react';
|
||||||
|
|
||||||
|
export type ThemeMode = 'dark' | 'light';
|
||||||
|
|
||||||
|
export const useTheme = () => {
|
||||||
|
const [theme, setThemeState] = useState<ThemeMode>(() => {
|
||||||
|
const saved = localStorage.getItem('onever_theme');
|
||||||
|
if (saved === 'dark' || saved === 'light') return saved;
|
||||||
|
return 'dark'; // Dark mode por defecto en puestos de control
|
||||||
|
});
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
document.documentElement.setAttribute('data-theme', theme);
|
||||||
|
localStorage.setItem('onever_theme', theme);
|
||||||
|
}, [theme]);
|
||||||
|
|
||||||
|
const toggleTheme = () => {
|
||||||
|
setThemeState((prev) => (prev === 'dark' ? 'light' : 'dark'));
|
||||||
|
};
|
||||||
|
|
||||||
|
const setTheme = (newTheme: ThemeMode) => {
|
||||||
|
setThemeState(newTheme);
|
||||||
|
};
|
||||||
|
|
||||||
|
return { theme, toggleTheme, setTheme };
|
||||||
|
};
|
||||||
+215
-46
@@ -1,5 +1,7 @@
|
|||||||
/* ==============================================================================
|
/* ==============================================================================
|
||||||
Reset Base y Layout Táctil (100dvh) para Tablets
|
OnEver Design System - Hoja de Estilos Base y Componentes
|
||||||
|
Inspirado en C:\Workspace\OemspotPySYS\styles\design_system.py
|
||||||
|
Optimizado para Tablets Samsung Galaxy Tab A9/A11 y Escritorio Windows
|
||||||
============================================================================== */
|
============================================================================== */
|
||||||
|
|
||||||
*, *::before, *::after {
|
*, *::before, *::after {
|
||||||
@@ -13,16 +15,14 @@ html, body {
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
height: 100dvh;
|
height: 100dvh;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
background-color: var(--bg-app);
|
background-color: var(--bg-main);
|
||||||
color: var(--text-primary);
|
color: var(--text-1);
|
||||||
font-family: var(--font-family);
|
font-family: var(--font-family);
|
||||||
font-size: 16px;
|
font-size: 14px;
|
||||||
-webkit-font-smoothing: antialiased;
|
-webkit-font-smoothing: antialiased;
|
||||||
-moz-osx-font-smoothing: grayscale;
|
-moz-osx-font-smoothing: grayscale;
|
||||||
|
|
||||||
/* Prevenir zoom accidental en tablets */
|
|
||||||
touch-action: manipulation;
|
touch-action: manipulation;
|
||||||
/* Prevenir recarga por arrastre en Chrome Android */
|
|
||||||
overscroll-behavior-y: contain;
|
overscroll-behavior-y: contain;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
}
|
}
|
||||||
@@ -35,81 +35,250 @@ html, body {
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Clases de utilidad táctil */
|
/* ==============================================================================
|
||||||
.touch-target {
|
TIPOGRAFÍA Y TÍTULOS
|
||||||
min-height: var(--touch-min-size);
|
============================================================================== */
|
||||||
min-width: var(--touch-min-size);
|
h1, h2, h3, h4, .section-title {
|
||||||
|
color: var(--text-1);
|
||||||
|
font-family: var(--font-family);
|
||||||
|
font-weight: 700;
|
||||||
|
letter-spacing: -0.01em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section-title {
|
||||||
|
font-size: 1.25rem;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.telemetry-value {
|
||||||
|
color: var(--success);
|
||||||
|
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ==============================================================================
|
||||||
|
INPUTS Y COMBOS (Estilo OnEver: border-radius 10px, background #1E293B)
|
||||||
|
============================================================================== */
|
||||||
|
input, select, textarea, .input-touch {
|
||||||
|
background-color: var(--input-bg);
|
||||||
|
border: 1px solid var(--border);
|
||||||
|
color: var(--text-1);
|
||||||
|
padding: 8px 12px;
|
||||||
|
border-radius: 10px;
|
||||||
|
min-height: 44px;
|
||||||
|
font-family: var(--font-family);
|
||||||
|
font-size: 0.95rem;
|
||||||
|
transition: border-color 0.15s ease, box-shadow 0.15s ease;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
input:focus, select:focus, textarea:focus, .input-touch:focus {
|
||||||
|
border-color: var(--blue-base);
|
||||||
|
outline: none;
|
||||||
|
box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
|
||||||
|
}
|
||||||
|
|
||||||
|
input:read-only, textarea:read-only {
|
||||||
|
background-color: var(--hover-bg);
|
||||||
|
color: var(--text-3);
|
||||||
|
border: 1px dashed var(--border);
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
input::placeholder, textarea::placeholder {
|
||||||
|
color: var(--text-3);
|
||||||
|
}
|
||||||
|
|
||||||
|
select {
|
||||||
|
cursor: pointer;
|
||||||
|
appearance: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ==============================================================================
|
||||||
|
BOTONES (Estilo OnEver: #2563EB, border-radius 10px, hover #3B82F6)
|
||||||
|
============================================================================== */
|
||||||
|
button, .btn, .touch-button {
|
||||||
|
background-color: var(--blue-base);
|
||||||
|
color: var(--btn-text);
|
||||||
|
border-radius: 10px;
|
||||||
|
padding: 8px 16px;
|
||||||
|
font-weight: 600;
|
||||||
|
font-family: var(--font-family);
|
||||||
|
font-size: 0.95rem;
|
||||||
|
border: none;
|
||||||
|
cursor: pointer;
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
gap: 0.5rem;
|
||||||
|
transition: background-color 0.15s ease, transform 0.05s ease, border-color 0.15s ease;
|
||||||
.touch-button {
|
min-height: 44px;
|
||||||
min-height: var(--touch-button-height);
|
|
||||||
padding: 0 1.25rem;
|
|
||||||
border-radius: var(--touch-radius);
|
|
||||||
font-size: var(--font-size-base);
|
|
||||||
font-weight: 600;
|
|
||||||
border: 1px solid transparent;
|
|
||||||
cursor: pointer;
|
|
||||||
transition: background-color 0.15s ease, transform 0.05s ease;
|
|
||||||
touch-action: manipulation;
|
touch-action: manipulation;
|
||||||
}
|
}
|
||||||
|
|
||||||
.touch-button:active {
|
button:hover, .btn:hover, .touch-button:hover {
|
||||||
|
background-color: var(--blue-hover);
|
||||||
|
}
|
||||||
|
|
||||||
|
button:active, .btn:active, .touch-button:active {
|
||||||
transform: scale(0.98);
|
transform: scale(0.98);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
button:disabled, .btn:disabled, .touch-button:disabled {
|
||||||
|
opacity: 0.5;
|
||||||
|
cursor: not-allowed;
|
||||||
|
transform: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Variantes de Botones */
|
||||||
.btn-primary {
|
.btn-primary {
|
||||||
background-color: var(--color-primary);
|
background-color: var(--blue-base);
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-primary:hover {
|
.btn-primary:hover {
|
||||||
background-color: var(--color-primary-hover);
|
background-color: var(--blue-hover);
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-secondary {
|
.btn-danger, button[class*="danger"] {
|
||||||
background-color: var(--bg-surface-highlight);
|
background-color: var(--danger);
|
||||||
color: var(--text-primary);
|
color: var(--btn-text);
|
||||||
border-color: var(--border-strong);
|
}
|
||||||
|
.btn-danger:hover, button[class*="danger"]:hover {
|
||||||
|
background-color: var(--danger-hover);
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-danger {
|
.btn-secondary, .btn-outline, button[class*="outline"] {
|
||||||
background-color: var(--color-danger);
|
background-color: transparent;
|
||||||
|
border: 1px solid var(--border);
|
||||||
|
color: var(--text-2);
|
||||||
|
}
|
||||||
|
.btn-secondary:hover, .btn-outline:hover, button[class*="outline"]:hover {
|
||||||
|
background-color: var(--hover-bg);
|
||||||
|
color: var(--text-1);
|
||||||
|
border-color: var(--border);
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-success, button[class*="on-status"] {
|
||||||
|
border: 1px solid var(--success);
|
||||||
|
color: var(--success);
|
||||||
|
background-color: var(--bg-sidebar);
|
||||||
|
}
|
||||||
|
.btn-success:hover, button[class*="on-status"]:hover {
|
||||||
|
background-color: var(--success);
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-success {
|
/* ==============================================================================
|
||||||
background-color: var(--color-success);
|
TARJETAS, PANELES Y HARDWARE CARDS (border 1px, radius 10px)
|
||||||
color: #ffffff;
|
============================================================================== */
|
||||||
|
.card, .hardware-card, .right-panel {
|
||||||
|
background-color: var(--bg-sidebar);
|
||||||
|
border: 1px solid var(--border);
|
||||||
|
border-radius: 10px;
|
||||||
|
box-shadow: var(--shadow-sm);
|
||||||
|
transition: border-color 0.15s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Indicadores y Badges */
|
.card:hover, .hardware-card:hover {
|
||||||
|
border-color: var(--border);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ==============================================================================
|
||||||
|
PESTAÑAS ESTILO ONEVER
|
||||||
|
============================================================================== */
|
||||||
|
.tab-list {
|
||||||
|
display: flex;
|
||||||
|
gap: 0.5rem;
|
||||||
|
border-bottom: 1px solid var(--border);
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tab-btn {
|
||||||
|
background: transparent;
|
||||||
|
color: var(--text-3);
|
||||||
|
padding: 9px 16px;
|
||||||
|
font-weight: 600;
|
||||||
|
border-radius: 0;
|
||||||
|
border-bottom: 2px solid transparent;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: color 0.15s ease, border-color 0.15s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tab-btn:hover {
|
||||||
|
background: transparent;
|
||||||
|
color: var(--text-2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.tab-btn.active, .tab-btn[aria-selected="true"] {
|
||||||
|
background: transparent;
|
||||||
|
color: var(--blue-base);
|
||||||
|
border-bottom: 2px solid var(--blue-base);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ==============================================================================
|
||||||
|
BADGES E INDICADORES
|
||||||
|
============================================================================== */
|
||||||
.badge {
|
.badge {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 0.375rem;
|
gap: 0.35rem;
|
||||||
padding: 0.25rem 0.625rem;
|
padding: 0.25rem 0.65rem;
|
||||||
border-radius: 9999px;
|
border-radius: 9999px;
|
||||||
font-size: var(--font-size-xs);
|
font-size: 0.8rem;
|
||||||
font-weight: 600;
|
font-weight: 700;
|
||||||
|
letter-spacing: 0.02em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.badge-success {
|
.badge-success {
|
||||||
background-color: var(--color-success-bg);
|
background-color: var(--color-success-bg);
|
||||||
color: var(--color-success);
|
color: var(--success);
|
||||||
border: 1px solid var(--color-success);
|
border: 1px solid var(--success);
|
||||||
}
|
}
|
||||||
|
|
||||||
.badge-danger {
|
.badge-danger {
|
||||||
background-color: var(--color-danger-bg);
|
background-color: var(--color-danger-bg);
|
||||||
color: var(--color-danger);
|
color: var(--danger);
|
||||||
border: 1px solid var(--color-danger);
|
border: 1px solid var(--danger);
|
||||||
}
|
}
|
||||||
|
|
||||||
.badge-info {
|
.badge-info {
|
||||||
background-color: rgba(56, 189, 248, 0.15);
|
background-color: var(--status-info-bg);
|
||||||
color: var(--color-info);
|
color: var(--status-info);
|
||||||
border: 1px solid var(--color-info);
|
border: 1px solid var(--status-info);
|
||||||
|
}
|
||||||
|
|
||||||
|
.badge-warning {
|
||||||
|
background-color: var(--status-warning-bg);
|
||||||
|
color: var(--warning);
|
||||||
|
border: 1px solid var(--warning);
|
||||||
|
}
|
||||||
|
|
||||||
|
.badge-neutral {
|
||||||
|
background-color: var(--hover-bg);
|
||||||
|
color: var(--text-2);
|
||||||
|
border: 1px solid var(--border);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ==============================================================================
|
||||||
|
BARRA DE SCROLL MODERNA (Estilo OnEver: #0F172A / #374151)
|
||||||
|
============================================================================== */
|
||||||
|
::-webkit-scrollbar {
|
||||||
|
width: 8px;
|
||||||
|
height: 8px;
|
||||||
|
background: var(--bg-main);
|
||||||
|
}
|
||||||
|
|
||||||
|
::-webkit-scrollbar-track {
|
||||||
|
background: var(--bg-main);
|
||||||
|
}
|
||||||
|
|
||||||
|
::-webkit-scrollbar-thumb {
|
||||||
|
background: var(--border);
|
||||||
|
border-radius: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
::-webkit-scrollbar-thumb:hover {
|
||||||
|
background: var(--text-3);
|
||||||
}
|
}
|
||||||
|
|||||||
+117
-48
@@ -1,73 +1,142 @@
|
|||||||
/* ==============================================================================
|
/* ==============================================================================
|
||||||
OnEver Design Tokens (Tokens Semánticos de Diseño)
|
OnEver Design System - Tokens de Diseño Oficiales
|
||||||
Optimizado para Garitas y Tablets de 4GB RAM (Samsung Tab A9 / A11)
|
Fiel réplica de styles/design_system.py (OnEverDesignSystem)
|
||||||
|
Paleta Dark / Light, Tipografía 'Segoe UI' / 'Roboto', Bordes 10px
|
||||||
============================================================================== */
|
============================================================================== */
|
||||||
|
|
||||||
:root {
|
:root {
|
||||||
/* Paleta Dark Mode (Por defecto en garitas de seguridad) */
|
/* --- PALETA DARK (Por defecto) --- */
|
||||||
--bg-app: #0b0f19;
|
--bg-main: #0F172A;
|
||||||
--bg-surface: #121826;
|
--bg-sidebar: #020617;
|
||||||
--bg-surface-elevated: #1a2235;
|
--text-1: #E0E6ED;
|
||||||
--bg-surface-highlight: #232e48;
|
--text-2: #9CA3AF;
|
||||||
|
--text-3: #6B7280;
|
||||||
|
--border: #374151;
|
||||||
|
--divider: #1F2937;
|
||||||
|
--blue-base: #2563EB;
|
||||||
|
--blue-hover: #3B82F6;
|
||||||
|
--success: #10B981;
|
||||||
|
--danger: #EF4444;
|
||||||
|
--danger-hover: #F87171;
|
||||||
|
--warning: #F59E0B;
|
||||||
|
--selection-bg: #2563EB;
|
||||||
|
--selection-text: #FFFFFF;
|
||||||
|
--hover-bg: #23283E;
|
||||||
|
--input-bg: #1E293B;
|
||||||
|
--btn-text: #FFFFFF;
|
||||||
|
--sidebar-icon: #FFFFFF;
|
||||||
|
|
||||||
--border-subtle: #232d42;
|
/* Aliases Semánticos de Compatibilidad */
|
||||||
--border-strong: #334155;
|
--bg-app: var(--bg-main);
|
||||||
|
--bg-surface: var(--bg-sidebar);
|
||||||
|
--bg-surface-elevated: var(--input-bg);
|
||||||
|
--bg-surface-highlight: var(--hover-bg);
|
||||||
|
|
||||||
--text-primary: #f8fafc;
|
--border-subtle: var(--divider);
|
||||||
--text-secondary: #94a3b8;
|
--border-strong: var(--border);
|
||||||
--text-muted: #64748b;
|
|
||||||
|
|
||||||
/* Estados y Semántica */
|
--text-primary: var(--text-1);
|
||||||
--color-primary: #0284c7;
|
--text-secondary: var(--text-2);
|
||||||
--color-primary-hover: #0369a1;
|
--text-muted: var(--text-3);
|
||||||
--color-success: #10b981;
|
|
||||||
|
--brand-primary: var(--blue-base);
|
||||||
|
--color-primary: var(--blue-base);
|
||||||
|
--color-primary-hover: var(--blue-hover);
|
||||||
|
|
||||||
|
--color-success: var(--success);
|
||||||
|
--status-success: var(--success);
|
||||||
--color-success-bg: rgba(16, 185, 129, 0.15);
|
--color-success-bg: rgba(16, 185, 129, 0.15);
|
||||||
--color-danger: #ef4444;
|
|
||||||
--color-danger-bg: rgba(239, 68, 68, 0.15);
|
|
||||||
--color-warning: #f59e0b;
|
|
||||||
--color-warning-bg: rgba(245, 158, 11, 0.15);
|
|
||||||
--color-info: #38bdf8;
|
|
||||||
|
|
||||||
/* Touch Targets y Ergonomía Táctil */
|
--color-danger: var(--danger);
|
||||||
|
--status-danger: var(--danger);
|
||||||
|
--color-danger-bg: rgba(239, 68, 68, 0.15);
|
||||||
|
|
||||||
|
--color-warning: var(--warning);
|
||||||
|
--status-warning: var(--warning);
|
||||||
|
--status-warning-bg: rgba(245, 158, 11, 0.15);
|
||||||
|
|
||||||
|
--color-info: #38BDF8;
|
||||||
|
--status-info: #38BDF8;
|
||||||
|
--status-info-bg: rgba(56, 189, 248, 0.15);
|
||||||
|
|
||||||
|
/* Touch Targets y Ergonomía */
|
||||||
--touch-min-size: 48px;
|
--touch-min-size: 48px;
|
||||||
--touch-button-height: 52px;
|
--touch-button-height: 48px;
|
||||||
--touch-input-height: 50px;
|
--touch-input-height: 44px;
|
||||||
--touch-radius: 8px;
|
--touch-radius: 10px;
|
||||||
|
--radius-md: 10px;
|
||||||
|
--radius-lg: 12px;
|
||||||
|
|
||||||
/* Tipografía */
|
/* Tipografía */
|
||||||
--font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
--font-family: 'Segoe UI', 'Roboto', system-ui, -apple-system, sans-serif;
|
||||||
--font-size-xs: 0.75rem;
|
--font-size-xs: 0.75rem;
|
||||||
--font-size-sm: 0.875rem;
|
--font-size-sm: 0.875rem;
|
||||||
--font-size-base: 1rem;
|
--font-size-base: 0.9375rem;
|
||||||
--font-size-lg: 1.125rem;
|
--font-size-lg: 1.125rem;
|
||||||
--font-size-xl: 1.25rem;
|
--font-size-xl: 1.25rem;
|
||||||
--font-size-2xl: 1.5rem;
|
--font-size-2xl: 1.5rem;
|
||||||
|
|
||||||
/* Sombras y elevación */
|
/* Sombras */
|
||||||
--shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
|
--shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
|
||||||
--shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
|
--shadow-md: 0 4px 8px -1px rgba(0, 0, 0, 0.45);
|
||||||
|
--shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Modo Claro Opcional (Para puestos al sol directo) */
|
/* --- PALETA LIGHT (OnEverDesignSystem Light) --- */
|
||||||
[data-theme="light"] {
|
[data-theme="light"] {
|
||||||
--bg-app: #f1f5f9;
|
--bg-main: #FFFFFF;
|
||||||
--bg-surface: #ffffff;
|
--bg-sidebar: #F4F5F6;
|
||||||
--bg-surface-elevated: #f8fafc;
|
--text-1: #212327;
|
||||||
--bg-surface-highlight: #e2e8f0;
|
--text-2: #50565E;
|
||||||
|
--text-3: #808893;
|
||||||
|
--border: #DEE0E3;
|
||||||
|
--divider: #EFEFF0;
|
||||||
|
--blue-base: #006FFF;
|
||||||
|
--blue-hover: #338BFF;
|
||||||
|
--success: #38CC65;
|
||||||
|
--danger: #F0383B;
|
||||||
|
--danger-hover: #FF7B80;
|
||||||
|
--warning: #F5A524;
|
||||||
|
--selection-bg: #EBEFFF;
|
||||||
|
--selection-text: #006FFF;
|
||||||
|
--hover-bg: #F3F4F6;
|
||||||
|
--input-bg: #FFFFFF;
|
||||||
|
--btn-text: #FFFFFF;
|
||||||
|
--sidebar-icon: #374151;
|
||||||
|
|
||||||
--border-subtle: #cbd5e1;
|
--bg-app: var(--bg-main);
|
||||||
--border-strong: #94a3b8;
|
--bg-surface: var(--bg-sidebar);
|
||||||
|
--bg-surface-elevated: var(--input-bg);
|
||||||
|
--bg-surface-highlight: var(--hover-bg);
|
||||||
|
|
||||||
--text-primary: #0f172a;
|
--border-subtle: var(--divider);
|
||||||
--text-secondary: #475569;
|
--border-strong: var(--border);
|
||||||
--text-muted: #64748b;
|
|
||||||
|
|
||||||
--color-primary: #0284c7;
|
--text-primary: var(--text-1);
|
||||||
--color-primary-hover: #0369a1;
|
--text-secondary: var(--text-2);
|
||||||
--color-success: #059669;
|
--text-muted: var(--text-3);
|
||||||
--color-success-bg: rgba(5, 150, 105, 0.1);
|
|
||||||
--color-danger: #dc2626;
|
--brand-primary: var(--blue-base);
|
||||||
--color-danger-bg: rgba(220, 38, 38, 0.1);
|
--color-primary: var(--blue-base);
|
||||||
--color-warning: #d97706;
|
--color-primary-hover: var(--blue-hover);
|
||||||
--color-warning-bg: rgba(217, 119, 6, 0.1);
|
|
||||||
|
--color-success: var(--success);
|
||||||
|
--status-success: var(--success);
|
||||||
|
--color-success-bg: rgba(56, 204, 101, 0.15);
|
||||||
|
|
||||||
|
--color-danger: var(--danger);
|
||||||
|
--status-danger: var(--danger);
|
||||||
|
--color-danger-bg: rgba(240, 56, 59, 0.15);
|
||||||
|
|
||||||
|
--color-warning: var(--warning);
|
||||||
|
--status-warning: var(--warning);
|
||||||
|
--status-warning-bg: rgba(245, 165, 36, 0.15);
|
||||||
|
|
||||||
|
--color-info: #0284C7;
|
||||||
|
--status-info: #0284C7;
|
||||||
|
--status-info-bg: rgba(2, 132, 199, 0.15);
|
||||||
|
|
||||||
|
--shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
|
||||||
|
--shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
|
||||||
|
--shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.12);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import { workstationApi } from '../api/workstationApi';
|
|||||||
import { accessApi } from '../api/accessApi';
|
import { accessApi } from '../api/accessApi';
|
||||||
import { hardwareApi } from '../api/hardwareApi';
|
import { hardwareApi } from '../api/hardwareApi';
|
||||||
import { useWebSocket } from '../hooks/useWebSocket';
|
import { useWebSocket } from '../hooks/useWebSocket';
|
||||||
|
import { useTheme } from '../hooks/useTheme';
|
||||||
import { CameraScannerModal } from '../components/scanner/CameraScannerModal';
|
import { CameraScannerModal } from '../components/scanner/CameraScannerModal';
|
||||||
import {
|
import {
|
||||||
WorkstationConfig,
|
WorkstationConfig,
|
||||||
@@ -19,6 +20,7 @@ import {
|
|||||||
|
|
||||||
export const ControlPostView: React.FC = () => {
|
export const ControlPostView: React.FC = () => {
|
||||||
const { user, workstation, logout } = useAuth();
|
const { user, workstation, logout } = useAuth();
|
||||||
|
const { theme, toggleTheme } = useTheme();
|
||||||
|
|
||||||
// Configuración de Estación y Módulos
|
// Configuración de Estación y Módulos
|
||||||
const [config, setConfig] = useState<WorkstationConfig | null>(null);
|
const [config, setConfig] = useState<WorkstationConfig | null>(null);
|
||||||
@@ -348,6 +350,16 @@ export const ControlPostView: React.FC = () => {
|
|||||||
👤 Operador: <strong>{user?.username}</strong>
|
👤 Operador: <strong>{user?.username}</strong>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="btn btn-secondary"
|
||||||
|
onClick={toggleTheme}
|
||||||
|
style={{ minHeight: '38px', padding: '0 0.75rem', fontSize: '0.85rem' }}
|
||||||
|
title="Cambiar tema OnEver (Oscuro / Claro)"
|
||||||
|
>
|
||||||
|
{theme === 'dark' ? '☀️' : '🌙'}
|
||||||
|
</button>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="btn btn-secondary"
|
className="btn btn-secondary"
|
||||||
|
|||||||
@@ -1,13 +1,17 @@
|
|||||||
// ==============================================================================
|
// ==============================================================================
|
||||||
// Vista de Inicio de Sesión de Operador / Guardia
|
// Vista de Inicio de Sesión de Operador / Guardia
|
||||||
// Optimizado para uso táctil en tablets Samsung Galaxy Tab (Touch-First)
|
// Sistema de Diseño OnEver (C:\Workspace\OemspotPySYS\styles\design_system.py)
|
||||||
|
// Optimizado para uso táctil en tablets Samsung Galaxy Tab y Windows (Touch-First)
|
||||||
// ==============================================================================
|
// ==============================================================================
|
||||||
import React, { useState, useEffect } from 'react';
|
import React, { useState, useEffect } from 'react';
|
||||||
import { useAuth } from '../context/AuthContext';
|
import { useAuth } from '../context/AuthContext';
|
||||||
import { workstationApi, WorkstationListItem } from '../api/workstationApi';
|
import { workstationApi, WorkstationListItem } from '../api/workstationApi';
|
||||||
|
import { useTheme } from '../hooks/useTheme';
|
||||||
|
|
||||||
export const LoginView: React.FC = () => {
|
export const LoginView: React.FC = () => {
|
||||||
const { login, workstation, setWorkstation } = useAuth();
|
const { login, workstation, setWorkstation } = useAuth();
|
||||||
|
const { theme, toggleTheme } = useTheme();
|
||||||
|
|
||||||
const [username, setUsername] = useState<string>('guardia');
|
const [username, setUsername] = useState<string>('guardia');
|
||||||
const [password, setPassword] = useState<string>('');
|
const [password, setPassword] = useState<string>('');
|
||||||
const [selectedWks, setSelectedWks] = useState<string>(workstation || 'CFT-DESK');
|
const [selectedWks, setSelectedWks] = useState<string>(workstation || 'CFT-DESK');
|
||||||
@@ -17,11 +21,14 @@ export const LoginView: React.FC = () => {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// Carga de Workstations reales desde SQL Server
|
// Carga de Workstations reales desde SQL Server
|
||||||
workstationApi.getAvailableWorkstations()
|
workstationApi
|
||||||
|
.getAvailableWorkstations()
|
||||||
.then((list) => {
|
.then((list) => {
|
||||||
if (list && list.length > 0) {
|
if (list && list.length > 0) {
|
||||||
setAvailableWorkstations(list);
|
setAvailableWorkstations(list);
|
||||||
const currentMatch = list.find((w) => w.name.toUpperCase() === (workstation || 'CFT-DESK').toUpperCase());
|
const currentMatch = list.find(
|
||||||
|
(w) => w.name.toUpperCase() === (workstation || 'CFT-DESK').toUpperCase()
|
||||||
|
);
|
||||||
if (currentMatch) {
|
if (currentMatch) {
|
||||||
setSelectedWks(currentMatch.name);
|
setSelectedWks(currentMatch.name);
|
||||||
} else {
|
} else {
|
||||||
@@ -61,19 +68,39 @@ export const LoginView: React.FC = () => {
|
|||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
minHeight: '100%',
|
minHeight: '100%',
|
||||||
backgroundColor: 'var(--bg-app)',
|
backgroundColor: 'var(--bg-main)',
|
||||||
padding: '1.5rem',
|
padding: '1.5rem',
|
||||||
|
position: 'relative',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
{/* Botón flotante de alternancia de tema (Oscuro / Claro) */}
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
onClick={toggleTheme}
|
||||||
|
className="btn-outline"
|
||||||
|
style={{
|
||||||
|
position: 'absolute',
|
||||||
|
top: '1.25rem',
|
||||||
|
right: '1.25rem',
|
||||||
|
minHeight: '38px',
|
||||||
|
padding: '0 0.85rem',
|
||||||
|
fontSize: '0.85rem',
|
||||||
|
}}
|
||||||
|
title="Cambiar tema OnEver (Oscuro / Claro)"
|
||||||
|
>
|
||||||
|
{theme === 'dark' ? '☀️ Modo Claro' : '🌙 Modo Oscuro'}
|
||||||
|
</button>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
className="card"
|
className="card"
|
||||||
style={{
|
style={{
|
||||||
width: '100%',
|
width: '100%',
|
||||||
maxWidth: '460px',
|
maxWidth: '460px',
|
||||||
boxShadow: 'var(--shadow-lg)',
|
boxShadow: 'var(--shadow-lg)',
|
||||||
border: '1px solid var(--border-subtle)',
|
backgroundColor: 'var(--bg-sidebar)',
|
||||||
borderRadius: 'var(--radius-lg)',
|
border: '1px solid var(--border)',
|
||||||
padding: '2rem',
|
borderRadius: '10px',
|
||||||
|
padding: '2.25rem',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{/* Cabecera del Login */}
|
{/* Cabecera del Login */}
|
||||||
@@ -82,8 +109,9 @@ export const LoginView: React.FC = () => {
|
|||||||
style={{
|
style={{
|
||||||
width: '64px',
|
width: '64px',
|
||||||
height: '64px',
|
height: '64px',
|
||||||
borderRadius: '16px',
|
borderRadius: '12px',
|
||||||
backgroundColor: 'var(--accent-primary-alpha)',
|
backgroundColor: 'var(--hover-bg)',
|
||||||
|
border: '1px solid var(--border)',
|
||||||
display: 'inline-flex',
|
display: 'inline-flex',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
@@ -93,10 +121,18 @@ export const LoginView: React.FC = () => {
|
|||||||
>
|
>
|
||||||
🛡️
|
🛡️
|
||||||
</div>
|
</div>
|
||||||
<h1 style={{ fontSize: '1.6rem', fontWeight: 700, margin: '0 0 0.5rem 0', color: 'var(--text-primary)' }}>
|
<h1
|
||||||
|
style={{
|
||||||
|
fontSize: '1.65rem',
|
||||||
|
fontWeight: 700,
|
||||||
|
margin: '0 0 0.4rem 0',
|
||||||
|
color: 'var(--text-1)',
|
||||||
|
letterSpacing: '-0.02em',
|
||||||
|
}}
|
||||||
|
>
|
||||||
OnEverControl
|
OnEverControl
|
||||||
</h1>
|
</h1>
|
||||||
<p style={{ margin: 0, fontSize: '0.9rem', color: 'var(--text-muted)' }}>
|
<p style={{ margin: 0, fontSize: '0.9rem', color: 'var(--text-2)' }}>
|
||||||
Puesto de Control Web • Modo Cliente Garita
|
Puesto de Control Web • Modo Cliente Garita
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
@@ -106,15 +142,18 @@ export const LoginView: React.FC = () => {
|
|||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
padding: '0.75rem 1rem',
|
padding: '0.75rem 1rem',
|
||||||
backgroundColor: 'var(--status-danger-bg)',
|
backgroundColor: 'var(--color-danger-bg)',
|
||||||
color: 'var(--status-danger)',
|
color: 'var(--danger-hover)',
|
||||||
borderRadius: 'var(--radius-sm)',
|
borderRadius: '8px',
|
||||||
marginBottom: '1.5rem',
|
marginBottom: '1.5rem',
|
||||||
fontSize: '0.9rem',
|
fontSize: '0.875rem',
|
||||||
border: '1px solid var(--status-danger)',
|
border: '1px solid var(--danger)',
|
||||||
|
display: 'flex',
|
||||||
|
alignItems: 'center',
|
||||||
|
gap: '0.5rem',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
⚠️ {errorMsg}
|
<span>⚠️</span> {errorMsg}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
@@ -126,7 +165,7 @@ export const LoginView: React.FC = () => {
|
|||||||
display: 'block',
|
display: 'block',
|
||||||
fontSize: '0.85rem',
|
fontSize: '0.85rem',
|
||||||
fontWeight: 600,
|
fontWeight: 600,
|
||||||
color: 'var(--text-secondary)',
|
color: 'var(--text-2)',
|
||||||
marginBottom: '0.5rem',
|
marginBottom: '0.5rem',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -157,7 +196,7 @@ export const LoginView: React.FC = () => {
|
|||||||
display: 'block',
|
display: 'block',
|
||||||
fontSize: '0.85rem',
|
fontSize: '0.85rem',
|
||||||
fontWeight: 600,
|
fontWeight: 600,
|
||||||
color: 'var(--text-secondary)',
|
color: 'var(--text-2)',
|
||||||
marginBottom: '0.5rem',
|
marginBottom: '0.5rem',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -183,7 +222,7 @@ export const LoginView: React.FC = () => {
|
|||||||
display: 'block',
|
display: 'block',
|
||||||
fontSize: '0.85rem',
|
fontSize: '0.85rem',
|
||||||
fontWeight: 600,
|
fontWeight: 600,
|
||||||
color: 'var(--text-secondary)',
|
color: 'var(--text-2)',
|
||||||
marginBottom: '0.5rem',
|
marginBottom: '0.5rem',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -207,9 +246,9 @@ export const LoginView: React.FC = () => {
|
|||||||
disabled={isLoading}
|
disabled={isLoading}
|
||||||
style={{
|
style={{
|
||||||
width: '100%',
|
width: '100%',
|
||||||
minHeight: '52px',
|
minHeight: '50px',
|
||||||
fontSize: '1.05rem',
|
fontSize: '1rem',
|
||||||
fontWeight: 600,
|
fontWeight: 700,
|
||||||
marginTop: '0.5rem',
|
marginTop: '0.5rem',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -217,8 +256,8 @@ export const LoginView: React.FC = () => {
|
|||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<div style={{ marginTop: '2rem', textAlign: 'center', fontSize: '0.75rem', color: 'var(--text-muted)' }}>
|
<div style={{ marginTop: '2rem', textAlign: 'center', fontSize: '0.75rem', color: 'var(--text-3)' }}>
|
||||||
OnEverControl Web v0.6.0-beta • Conectado a Microsoft SQL Server videoman
|
OnEverControl Web v0.6.1-beta • Conectado a Microsoft SQL Server videoman
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user