feat(ui): redisenar pantalla de login con paridad visual 1:1 a desktop OneverAccess
This commit is contained in:
+454
-162
@@ -1,7 +1,7 @@
|
||||
// ==============================================================================
|
||||
// Vista de Inicio de Sesión de Operador / Guardia
|
||||
// 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)
|
||||
// Vista de Inicio de Sesión de Operador / Guardia (OnEverControl Web)
|
||||
// Paridad Visual 1:1 con la versión de escritorio de OneverAccess (login_window.py)
|
||||
// Sistema de Diseño OnEver con Ola Gradiente (Indigo/Blue), Pills inputs y Glassmorphism
|
||||
// ==============================================================================
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { useAuth } from '../context/AuthContext';
|
||||
@@ -15,11 +15,14 @@ export const LoginView: React.FC = () => {
|
||||
|
||||
const [username, setUsername] = useState<string>('guardia');
|
||||
const [password, setPassword] = useState<string>('');
|
||||
const [showPassword, setShowPassword] = useState<boolean>(false);
|
||||
const [selectedWks, setSelectedWks] = useState<string>(workstation || 'CFT-DESK');
|
||||
const [availableWorkstations, setAvailableWorkstations] = useState<WorkstationListItem[]>([]);
|
||||
const [isLoading, setIsLoading] = useState<boolean>(false);
|
||||
const [errorMsg, setErrorMsg] = useState<string | null>(null);
|
||||
|
||||
const isDark = theme === 'dark';
|
||||
|
||||
useEffect(() => {
|
||||
// Carga de Workstations reales desde SQL Server
|
||||
workstationApi
|
||||
@@ -56,12 +59,20 @@ export const LoginView: React.FC = () => {
|
||||
setWorkstation(selectedWks);
|
||||
await login(username.trim(), password, selectedWks);
|
||||
} catch (err: any) {
|
||||
setErrorMsg(err.message || 'Error al iniciar sesión. Verifique sus credenciales.');
|
||||
setErrorMsg(err.message || 'Credenciales inválidas. Verifique usuario o contraseña.');
|
||||
} finally {
|
||||
setIsLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
const toggleFullscreen = () => {
|
||||
if (!document.fullscreenElement) {
|
||||
document.documentElement.requestFullscreen().catch(() => {});
|
||||
} else {
|
||||
document.exitFullscreen().catch(() => {});
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
@@ -69,212 +80,493 @@ export const LoginView: React.FC = () => {
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
minHeight: '100%',
|
||||
backgroundColor: 'var(--bg-main)',
|
||||
backgroundColor: isDark ? '#090D16' : '#F1F5F9',
|
||||
backgroundImage: isDark
|
||||
? 'radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.15) 0%, transparent 60%)'
|
||||
: 'radial-gradient(circle at 50% 0%, rgba(14, 165, 233, 0.12) 0%, transparent 60%)',
|
||||
padding: '1.5rem',
|
||||
position: 'relative',
|
||||
userSelect: 'none',
|
||||
}}
|
||||
>
|
||||
{/* Botón flotante de alternancia de tema (Oscuro / Claro) */}
|
||||
<button
|
||||
type="button"
|
||||
onClick={toggleTheme}
|
||||
className="btn-outline"
|
||||
{/* Botones Flotantes de Utilidades (Tema y Pantalla Completa) */}
|
||||
<div
|
||||
style={{
|
||||
position: 'absolute',
|
||||
top: '1.25rem',
|
||||
right: '1.25rem',
|
||||
minHeight: '38px',
|
||||
padding: '0 0.85rem',
|
||||
fontSize: '0.85rem',
|
||||
display: 'flex',
|
||||
gap: '0.5rem',
|
||||
zIndex: 10,
|
||||
}}
|
||||
title="Cambiar tema OnEver (Oscuro / Claro)"
|
||||
>
|
||||
{theme === 'dark' ? '☀️ Modo Claro' : '🌙 Modo Oscuro'}
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
onClick={toggleTheme}
|
||||
style={{
|
||||
minHeight: '38px',
|
||||
padding: '0 0.85rem',
|
||||
fontSize: '0.85rem',
|
||||
backgroundColor: isDark ? 'rgba(30, 41, 59, 0.85)' : 'rgba(255, 255, 255, 0.9)',
|
||||
color: isDark ? '#F8FAFC' : '#0F172A',
|
||||
border: `1px solid ${isDark ? '#334155' : '#CBD5E1'}`,
|
||||
borderRadius: '19px',
|
||||
cursor: 'pointer',
|
||||
backdropFilter: 'blur(8px)',
|
||||
boxShadow: '0 4px 12px rgba(0,0,0,0.1)',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
gap: '0.4rem',
|
||||
fontWeight: 600,
|
||||
}}
|
||||
title="Cambiar tema OnEver (Oscuro / Claro)"
|
||||
>
|
||||
<span>{isDark ? '☀️' : '🌙'}</span>
|
||||
<span>{isDark ? 'Claro' : 'Oscuro'}</span>
|
||||
</button>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
onClick={toggleFullscreen}
|
||||
style={{
|
||||
minHeight: '38px',
|
||||
width: '38px',
|
||||
padding: 0,
|
||||
fontSize: '1rem',
|
||||
backgroundColor: isDark ? 'rgba(30, 41, 59, 0.85)' : 'rgba(255, 255, 255, 0.9)',
|
||||
color: isDark ? '#F8FAFC' : '#0F172A',
|
||||
border: `1px solid ${isDark ? '#334155' : '#CBD5E1'}`,
|
||||
borderRadius: '50%',
|
||||
cursor: 'pointer',
|
||||
backdropFilter: 'blur(8px)',
|
||||
boxShadow: '0 4px 12px rgba(0,0,0,0.1)',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
}}
|
||||
title="Pantalla Completa"
|
||||
>
|
||||
⛶
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{/* Tarjeta de Login (Paridad con LoginBackgroundFrame de OneverAccess Desktop) */}
|
||||
<div
|
||||
className="card"
|
||||
style={{
|
||||
width: '100%',
|
||||
maxWidth: '460px',
|
||||
boxShadow: 'var(--shadow-lg)',
|
||||
backgroundColor: 'var(--bg-sidebar)',
|
||||
border: '1px solid var(--border)',
|
||||
borderRadius: '10px',
|
||||
padding: '2.25rem',
|
||||
maxWidth: '440px',
|
||||
backgroundColor: isDark ? '#0F172A' : '#FFFFFF',
|
||||
borderRadius: '24px',
|
||||
border: `1px solid ${isDark ? '#1E293B' : '#E2E8F0'}`,
|
||||
boxShadow: isDark
|
||||
? '0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(99, 102, 241, 0.1)'
|
||||
: '0 25px 50px -12px rgba(15, 23, 42, 0.15), 0 0 0 1px rgba(14, 165, 233, 0.1)',
|
||||
position: 'relative',
|
||||
overflow: 'hidden',
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
}}
|
||||
>
|
||||
{/* Cabecera del Login */}
|
||||
<div style={{ textAlign: 'center', marginBottom: '1.75rem' }}>
|
||||
{/* Onda Decorativa Superior con Gradiente Curvo (Idéntica a LoginBackgroundFrame) */}
|
||||
<div
|
||||
style={{
|
||||
position: 'absolute',
|
||||
top: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
height: '165px',
|
||||
overflow: 'hidden',
|
||||
pointerEvents: 'none',
|
||||
zIndex: 1,
|
||||
}}
|
||||
>
|
||||
<svg
|
||||
viewBox="0 0 440 165"
|
||||
preserveAspectRatio="none"
|
||||
style={{ width: '100%', height: '100%', display: 'block' }}
|
||||
>
|
||||
<defs>
|
||||
<linearGradient id="loginWaveGrad" x1="0%" y1="0%" x2="100%" y2="100%">
|
||||
{isDark ? (
|
||||
<>
|
||||
<stop offset="0%" stopColor="#6366f1" /> {/* Indigo */}
|
||||
<stop offset="100%" stopColor="#3b82f6" /> {/* Blue */}
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<stop offset="0%" stopColor="#8b5cf6" /> {/* Purple */}
|
||||
<stop offset="100%" stopColor="#0ea5e9" /> {/* Light Blue */}
|
||||
</>
|
||||
)}
|
||||
</linearGradient>
|
||||
</defs>
|
||||
{/* Curva Bezier cúbica idéntica al painter.cubicTo de PyQt6 */}
|
||||
<path
|
||||
d="M 0 0 L 0 135 C 154 85, 286 160, 440 115 L 440 0 Z"
|
||||
fill="url(#loginWaveGrad)"
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
{/* Contenido Principal del Formulario */}
|
||||
<div
|
||||
style={{
|
||||
padding: '2.5rem 2.25rem 2rem',
|
||||
position: 'relative',
|
||||
zIndex: 2,
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
}}
|
||||
>
|
||||
{/* Logo Corporativo OneverAccess */}
|
||||
<div
|
||||
style={{
|
||||
display: 'inline-flex',
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
marginBottom: '1rem',
|
||||
marginBottom: '2.5rem',
|
||||
height: '110px',
|
||||
}}
|
||||
>
|
||||
<img
|
||||
src={theme === 'dark' ? '/logo_login_dark.png' : '/logo_login_light.png'}
|
||||
src={isDark ? '/logo_login_dark.png' : '/logo_login_light.png'}
|
||||
alt="OnEver Access"
|
||||
style={{ maxHeight: '52px', width: 'auto', objectFit: 'contain' }}
|
||||
style={{
|
||||
maxHeight: '85px',
|
||||
maxWidth: '280px',
|
||||
width: 'auto',
|
||||
objectFit: 'contain',
|
||||
filter: 'drop-shadow(0 4px 8px rgba(0,0,0,0.25))',
|
||||
}}
|
||||
onError={(e) => {
|
||||
(e.target as HTMLImageElement).src = '/logo_mini.png';
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<h1
|
||||
style={{
|
||||
fontSize: '1.65rem',
|
||||
fontWeight: 700,
|
||||
margin: '0 0 0.35rem 0',
|
||||
color: 'var(--text-1)',
|
||||
letterSpacing: '-0.02em',
|
||||
}}
|
||||
|
||||
{/* Formulario */}
|
||||
<form
|
||||
onSubmit={handleSubmit}
|
||||
style={{ display: 'flex', flexDirection: 'column', gap: '1rem' }}
|
||||
>
|
||||
OnEverControl
|
||||
</h1>
|
||||
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', gap: '0.5rem' }}>
|
||||
<span style={{ fontSize: '0.88rem', color: 'var(--text-2)' }}>
|
||||
Puesto de Control Web • Modo Garita
|
||||
</span>
|
||||
<span
|
||||
{/* Puesto de Control / Workstation (Pill Shape) */}
|
||||
<div>
|
||||
<label
|
||||
style={{
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
gap: '0.4rem',
|
||||
fontSize: '0.75rem',
|
||||
fontWeight: 700,
|
||||
color: isDark ? '#94A3B8' : '#64748B',
|
||||
marginBottom: '0.4rem',
|
||||
letterSpacing: '0.05em',
|
||||
textTransform: 'uppercase',
|
||||
paddingLeft: '0.75rem',
|
||||
}}
|
||||
>
|
||||
<span>🖥️</span> Puesto de Control (Workstation)
|
||||
</label>
|
||||
<select
|
||||
value={selectedWks}
|
||||
onChange={(e) => setSelectedWks(e.target.value)}
|
||||
style={{
|
||||
width: '100%',
|
||||
height: '46px',
|
||||
borderRadius: '23px',
|
||||
backgroundColor: isDark ? '#1E293B' : '#F8FAFC',
|
||||
border: `1px solid ${isDark ? '#374151' : '#CBD5E1'}`,
|
||||
color: isDark ? '#F8FAFC' : '#0F172A',
|
||||
padding: '0 20px',
|
||||
fontSize: '0.9rem',
|
||||
fontWeight: 600,
|
||||
outline: 'none',
|
||||
cursor: 'pointer',
|
||||
appearance: 'auto',
|
||||
}}
|
||||
>
|
||||
{availableWorkstations.length > 0 ? (
|
||||
availableWorkstations.map((w) => (
|
||||
<option key={w.id} value={w.name}>
|
||||
{w.name} (ID {w.id})
|
||||
</option>
|
||||
))
|
||||
) : (
|
||||
<option value="CFT-DESK">CFT-DESK (ID 100001)</option>
|
||||
)}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
{/* Campo Usuario (Pill Shape) */}
|
||||
<div>
|
||||
<label
|
||||
style={{
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
gap: '0.4rem',
|
||||
fontSize: '0.75rem',
|
||||
fontWeight: 700,
|
||||
color: isDark ? '#94A3B8' : '#64748B',
|
||||
marginBottom: '0.4rem',
|
||||
letterSpacing: '0.05em',
|
||||
textTransform: 'uppercase',
|
||||
paddingLeft: '0.75rem',
|
||||
}}
|
||||
>
|
||||
<span>👤</span> Usuario
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
value={username}
|
||||
onChange={(e) => setUsername(e.target.value)}
|
||||
placeholder="Username"
|
||||
autoCapitalize="none"
|
||||
autoCorrect="off"
|
||||
required
|
||||
style={{
|
||||
width: '100%',
|
||||
height: '46px',
|
||||
borderRadius: '23px',
|
||||
backgroundColor: isDark ? '#1E293B' : '#F8FAFC',
|
||||
border: `1px solid ${isDark ? '#374151' : '#CBD5E1'}`,
|
||||
color: isDark ? '#F8FAFC' : '#0F172A',
|
||||
padding: '0 20px',
|
||||
fontSize: '0.925rem',
|
||||
fontWeight: 500,
|
||||
outline: 'none',
|
||||
transition: 'border-color 0.2s, box-shadow 0.2s',
|
||||
}}
|
||||
onFocus={(e) => {
|
||||
e.currentTarget.style.borderColor = '#2563EB';
|
||||
e.currentTarget.style.boxShadow = '0 0 0 3px rgba(37, 99, 235, 0.2)';
|
||||
}}
|
||||
onBlur={(e) => {
|
||||
e.currentTarget.style.borderColor = isDark ? '#374151' : '#CBD5E1';
|
||||
e.currentTarget.style.boxShadow = 'none';
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Campo Contraseña con Botón de Ojo (Pill Shape) */}
|
||||
<div>
|
||||
<label
|
||||
style={{
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
gap: '0.4rem',
|
||||
fontSize: '0.75rem',
|
||||
fontWeight: 700,
|
||||
color: isDark ? '#94A3B8' : '#64748B',
|
||||
marginBottom: '0.4rem',
|
||||
letterSpacing: '0.05em',
|
||||
textTransform: 'uppercase',
|
||||
paddingLeft: '0.75rem',
|
||||
}}
|
||||
>
|
||||
<span>🔒</span> Contraseña
|
||||
</label>
|
||||
<div
|
||||
style={{
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
height: '46px',
|
||||
borderRadius: '23px',
|
||||
backgroundColor: isDark ? '#1E293B' : '#F8FAFC',
|
||||
border: `1px solid ${isDark ? '#374151' : '#CBD5E1'}`,
|
||||
overflow: 'hidden',
|
||||
transition: 'border-color 0.2s, box-shadow 0.2s',
|
||||
}}
|
||||
id="passwordContainer"
|
||||
>
|
||||
<input
|
||||
type={showPassword ? 'text' : 'password'}
|
||||
value={password}
|
||||
onChange={(e) => setPassword(e.target.value)}
|
||||
placeholder="Password"
|
||||
required
|
||||
style={{
|
||||
flex: 1,
|
||||
height: '100%',
|
||||
border: 'none',
|
||||
backgroundColor: 'transparent',
|
||||
color: isDark ? '#F8FAFC' : '#0F172A',
|
||||
padding: '0 0 0 20px',
|
||||
fontSize: '0.925rem',
|
||||
fontWeight: 500,
|
||||
outline: 'none',
|
||||
}}
|
||||
onFocus={() => {
|
||||
const el = document.getElementById('passwordContainer');
|
||||
if (el) {
|
||||
el.style.borderColor = '#2563EB';
|
||||
el.style.boxShadow = '0 0 0 3px rgba(37, 99, 235, 0.2)';
|
||||
}
|
||||
}}
|
||||
onBlur={() => {
|
||||
const el = document.getElementById('passwordContainer');
|
||||
if (el) {
|
||||
el.style.borderColor = isDark ? '#374151' : '#CBD5E1';
|
||||
el.style.boxShadow = 'none';
|
||||
}
|
||||
}}
|
||||
/>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setShowPassword(!showPassword)}
|
||||
style={{
|
||||
height: '100%',
|
||||
width: '46px',
|
||||
border: 'none',
|
||||
backgroundColor: 'transparent',
|
||||
color: isDark ? '#94A3B8' : '#64748B',
|
||||
fontSize: '1.1rem',
|
||||
cursor: 'pointer',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
paddingRight: '6px',
|
||||
transition: 'color 0.15s',
|
||||
}}
|
||||
title={showPassword ? 'Ocultar contraseña' : 'Ver contraseña'}
|
||||
>
|
||||
{showPassword ? '👁️' : '🔒'}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Mensaje de Error (si ocurre) */}
|
||||
{errorMsg && (
|
||||
<div
|
||||
style={{
|
||||
padding: '0.55rem 0.85rem',
|
||||
backgroundColor: 'rgba(239, 68, 68, 0.12)',
|
||||
border: '1px solid #EF4444',
|
||||
borderRadius: '12px',
|
||||
color: '#EF4444',
|
||||
fontSize: '0.825rem',
|
||||
fontWeight: 600,
|
||||
textAlign: 'center',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
gap: '0.4rem',
|
||||
}}
|
||||
>
|
||||
<span>⚠️</span> {errorMsg}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Botón Ingresar / Login (Pill Shape estilo OnEver Desktop) */}
|
||||
<button
|
||||
type="submit"
|
||||
disabled={isLoading}
|
||||
style={{
|
||||
fontSize: '0.68rem',
|
||||
padding: '0.15rem 0.45rem',
|
||||
borderRadius: '4px',
|
||||
backgroundColor: 'var(--hover-bg)',
|
||||
border: '1px solid var(--border)',
|
||||
color: 'var(--accent)',
|
||||
fontWeight: 600,
|
||||
width: '100%',
|
||||
height: '46px',
|
||||
borderRadius: '23px',
|
||||
backgroundColor: isDark ? 'transparent' : '#2563EB',
|
||||
color: isDark ? '#38BDF8' : '#FFFFFF',
|
||||
border: isDark ? '2px solid #38BDF8' : '2px solid #2563EB',
|
||||
fontSize: '0.95rem',
|
||||
fontWeight: 700,
|
||||
letterSpacing: '0.02em',
|
||||
cursor: isLoading ? 'not-allowed' : 'pointer',
|
||||
marginTop: '0.5rem',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
gap: '0.5rem',
|
||||
transition: 'all 0.2s ease',
|
||||
boxShadow: isDark ? '0 4px 15px rgba(56, 189, 248, 0.15)' : '0 4px 15px rgba(37, 99, 235, 0.25)',
|
||||
}}
|
||||
onMouseEnter={(e) => {
|
||||
if (!isLoading) {
|
||||
e.currentTarget.style.backgroundColor = isDark ? '#38BDF8' : '#1D4ED8';
|
||||
e.currentTarget.style.color = '#FFFFFF';
|
||||
e.currentTarget.style.boxShadow = isDark
|
||||
? '0 6px 20px rgba(56, 189, 248, 0.35)'
|
||||
: '0 6px 20px rgba(37, 99, 235, 0.35)';
|
||||
}
|
||||
}}
|
||||
onMouseLeave={(e) => {
|
||||
if (!isLoading) {
|
||||
e.currentTarget.style.backgroundColor = isDark ? 'transparent' : '#2563EB';
|
||||
e.currentTarget.style.color = isDark ? '#38BDF8' : '#FFFFFF';
|
||||
e.currentTarget.style.boxShadow = isDark
|
||||
? '0 4px 15px rgba(56, 189, 248, 0.15)'
|
||||
: '0 4px 15px rgba(37, 99, 235, 0.25)';
|
||||
}
|
||||
}}
|
||||
>
|
||||
{APP_BUILD}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
{isLoading ? (
|
||||
<>
|
||||
<span>⏳</span> Validando credenciales...
|
||||
</>
|
||||
) : (
|
||||
'Login'
|
||||
)}
|
||||
</button>
|
||||
</form>
|
||||
|
||||
{/* Alerta de Error */}
|
||||
{errorMsg && (
|
||||
{/* Pie Informativo y Estado de Conexión */}
|
||||
<div
|
||||
style={{
|
||||
padding: '0.75rem 1rem',
|
||||
backgroundColor: 'var(--color-danger-bg)',
|
||||
color: 'var(--danger-hover)',
|
||||
borderRadius: '8px',
|
||||
marginBottom: '1.5rem',
|
||||
fontSize: '0.875rem',
|
||||
border: '1px solid var(--danger)',
|
||||
marginTop: '1.75rem',
|
||||
textAlign: 'center',
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
alignItems: 'center',
|
||||
gap: '0.5rem',
|
||||
gap: '0.4rem',
|
||||
}}
|
||||
>
|
||||
<span>⚠️</span> {errorMsg}
|
||||
</div>
|
||||
)}
|
||||
|
||||
<form onSubmit={handleSubmit} style={{ display: 'flex', flexDirection: 'column', gap: '1.25rem' }}>
|
||||
{/* Selector de Workstation Real desde SQL Server */}
|
||||
<div>
|
||||
<label
|
||||
<div
|
||||
style={{
|
||||
display: 'block',
|
||||
fontSize: '0.85rem',
|
||||
fontWeight: 600,
|
||||
color: 'var(--text-2)',
|
||||
marginBottom: '0.5rem',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
gap: '0.45rem',
|
||||
fontSize: '0.75rem',
|
||||
color: isDark ? '#94A3B8' : '#64748B',
|
||||
fontWeight: 500,
|
||||
}}
|
||||
>
|
||||
Puesto de Control / Workstation:
|
||||
</label>
|
||||
<select
|
||||
className="input-touch"
|
||||
value={selectedWks}
|
||||
onChange={(e) => setSelectedWks(e.target.value)}
|
||||
style={{ width: '100%' }}
|
||||
>
|
||||
{availableWorkstations.length > 0 ? (
|
||||
availableWorkstations.map((w) => (
|
||||
<option key={w.id} value={w.name}>
|
||||
{w.name} (ID {w.id})
|
||||
</option>
|
||||
))
|
||||
) : (
|
||||
<option value="CFT-DESK">CFT-DESK (ID 100001)</option>
|
||||
)}
|
||||
</select>
|
||||
</div>
|
||||
<img
|
||||
src="/logo_os.png"
|
||||
alt=""
|
||||
style={{ width: '14px', height: '14px', objectFit: 'contain' }}
|
||||
onError={(e) => {
|
||||
(e.target as HTMLElement).style.display = 'none';
|
||||
}}
|
||||
/>
|
||||
<span>OnEver Access · Control Web {APP_VERSION}</span>
|
||||
<span
|
||||
style={{
|
||||
fontSize: '0.65rem',
|
||||
padding: '0.1rem 0.35rem',
|
||||
borderRadius: '4px',
|
||||
backgroundColor: isDark ? '#1E293B' : '#E2E8F0',
|
||||
color: isDark ? '#38BDF8' : '#0284C7',
|
||||
fontWeight: 600,
|
||||
}}
|
||||
>
|
||||
{APP_BUILD}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
{/* Campo Usuario */}
|
||||
<div>
|
||||
<label
|
||||
<div
|
||||
style={{
|
||||
display: 'block',
|
||||
fontSize: '0.85rem',
|
||||
fontWeight: 600,
|
||||
color: 'var(--text-2)',
|
||||
marginBottom: '0.5rem',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
gap: '0.35rem',
|
||||
fontSize: '0.725rem',
|
||||
color: isDark ? '#64748B' : '#94A3B8',
|
||||
}}
|
||||
>
|
||||
Usuario:
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
className="input-touch"
|
||||
value={username}
|
||||
onChange={(e) => setUsername(e.target.value)}
|
||||
placeholder="Ej: guardia, supervisor"
|
||||
autoCapitalize="none"
|
||||
autoCorrect="off"
|
||||
required
|
||||
style={{ width: '100%' }}
|
||||
/>
|
||||
<span style={{ color: '#10B981', fontSize: '0.65rem' }}>●</span>
|
||||
<span>Conectado a Microsoft SQL Server (Transaccional)</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Campo Contraseña */}
|
||||
<div>
|
||||
<label
|
||||
style={{
|
||||
display: 'block',
|
||||
fontSize: '0.85rem',
|
||||
fontWeight: 600,
|
||||
color: 'var(--text-2)',
|
||||
marginBottom: '0.5rem',
|
||||
}}
|
||||
>
|
||||
Contraseña:
|
||||
</label>
|
||||
<input
|
||||
type="password"
|
||||
className="input-touch"
|
||||
value={password}
|
||||
onChange={(e) => setPassword(e.target.value)}
|
||||
placeholder="••••••••"
|
||||
required
|
||||
style={{ width: '100%' }}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Botón de Ingreso Táctil */}
|
||||
<button
|
||||
type="submit"
|
||||
className="btn btn-primary"
|
||||
disabled={isLoading}
|
||||
style={{
|
||||
width: '100%',
|
||||
minHeight: '50px',
|
||||
fontSize: '1rem',
|
||||
fontWeight: 700,
|
||||
marginTop: '0.5rem',
|
||||
}}
|
||||
>
|
||||
{isLoading ? 'Iniciando Sesión...' : 'Iniciar Turno'}
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<div style={{ marginTop: '2rem', textAlign: 'center', fontSize: '0.75rem', color: 'var(--text-3)' }}>
|
||||
OnEver Access · Control Web {APP_VERSION} ({APP_BUILD}) • Conectado a Microsoft SQL Server
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user