feat(ui-camera): aplicar sistema de diseno OnEver y soporte universal de camaras en Android y Windows
This commit is contained in:
@@ -1,13 +1,17 @@
|
||||
// ==============================================================================
|
||||
// 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 { useAuth } from '../context/AuthContext';
|
||||
import { workstationApi, WorkstationListItem } from '../api/workstationApi';
|
||||
import { useTheme } from '../hooks/useTheme';
|
||||
|
||||
export const LoginView: React.FC = () => {
|
||||
const { login, workstation, setWorkstation } = useAuth();
|
||||
const { theme, toggleTheme } = useTheme();
|
||||
|
||||
const [username, setUsername] = useState<string>('guardia');
|
||||
const [password, setPassword] = useState<string>('');
|
||||
const [selectedWks, setSelectedWks] = useState<string>(workstation || 'CFT-DESK');
|
||||
@@ -17,11 +21,14 @@ export const LoginView: React.FC = () => {
|
||||
|
||||
useEffect(() => {
|
||||
// Carga de Workstations reales desde SQL Server
|
||||
workstationApi.getAvailableWorkstations()
|
||||
workstationApi
|
||||
.getAvailableWorkstations()
|
||||
.then((list) => {
|
||||
if (list && list.length > 0) {
|
||||
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) {
|
||||
setSelectedWks(currentMatch.name);
|
||||
} else {
|
||||
@@ -61,19 +68,39 @@ export const LoginView: React.FC = () => {
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
minHeight: '100%',
|
||||
backgroundColor: 'var(--bg-app)',
|
||||
backgroundColor: 'var(--bg-main)',
|
||||
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
|
||||
className="card"
|
||||
style={{
|
||||
width: '100%',
|
||||
maxWidth: '460px',
|
||||
boxShadow: 'var(--shadow-lg)',
|
||||
border: '1px solid var(--border-subtle)',
|
||||
borderRadius: 'var(--radius-lg)',
|
||||
padding: '2rem',
|
||||
backgroundColor: 'var(--bg-sidebar)',
|
||||
border: '1px solid var(--border)',
|
||||
borderRadius: '10px',
|
||||
padding: '2.25rem',
|
||||
}}
|
||||
>
|
||||
{/* Cabecera del Login */}
|
||||
@@ -82,8 +109,9 @@ export const LoginView: React.FC = () => {
|
||||
style={{
|
||||
width: '64px',
|
||||
height: '64px',
|
||||
borderRadius: '16px',
|
||||
backgroundColor: 'var(--accent-primary-alpha)',
|
||||
borderRadius: '12px',
|
||||
backgroundColor: 'var(--hover-bg)',
|
||||
border: '1px solid var(--border)',
|
||||
display: 'inline-flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
@@ -93,10 +121,18 @@ export const LoginView: React.FC = () => {
|
||||
>
|
||||
🛡️
|
||||
</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
|
||||
</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
|
||||
</p>
|
||||
</div>
|
||||
@@ -106,15 +142,18 @@ export const LoginView: React.FC = () => {
|
||||
<div
|
||||
style={{
|
||||
padding: '0.75rem 1rem',
|
||||
backgroundColor: 'var(--status-danger-bg)',
|
||||
color: 'var(--status-danger)',
|
||||
borderRadius: 'var(--radius-sm)',
|
||||
backgroundColor: 'var(--color-danger-bg)',
|
||||
color: 'var(--danger-hover)',
|
||||
borderRadius: '8px',
|
||||
marginBottom: '1.5rem',
|
||||
fontSize: '0.9rem',
|
||||
border: '1px solid var(--status-danger)',
|
||||
fontSize: '0.875rem',
|
||||
border: '1px solid var(--danger)',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
gap: '0.5rem',
|
||||
}}
|
||||
>
|
||||
⚠️ {errorMsg}
|
||||
<span>⚠️</span> {errorMsg}
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -126,7 +165,7 @@ export const LoginView: React.FC = () => {
|
||||
display: 'block',
|
||||
fontSize: '0.85rem',
|
||||
fontWeight: 600,
|
||||
color: 'var(--text-secondary)',
|
||||
color: 'var(--text-2)',
|
||||
marginBottom: '0.5rem',
|
||||
}}
|
||||
>
|
||||
@@ -157,7 +196,7 @@ export const LoginView: React.FC = () => {
|
||||
display: 'block',
|
||||
fontSize: '0.85rem',
|
||||
fontWeight: 600,
|
||||
color: 'var(--text-secondary)',
|
||||
color: 'var(--text-2)',
|
||||
marginBottom: '0.5rem',
|
||||
}}
|
||||
>
|
||||
@@ -183,7 +222,7 @@ export const LoginView: React.FC = () => {
|
||||
display: 'block',
|
||||
fontSize: '0.85rem',
|
||||
fontWeight: 600,
|
||||
color: 'var(--text-secondary)',
|
||||
color: 'var(--text-2)',
|
||||
marginBottom: '0.5rem',
|
||||
}}
|
||||
>
|
||||
@@ -207,9 +246,9 @@ export const LoginView: React.FC = () => {
|
||||
disabled={isLoading}
|
||||
style={{
|
||||
width: '100%',
|
||||
minHeight: '52px',
|
||||
fontSize: '1.05rem',
|
||||
fontWeight: 600,
|
||||
minHeight: '50px',
|
||||
fontSize: '1rem',
|
||||
fontWeight: 700,
|
||||
marginTop: '0.5rem',
|
||||
}}
|
||||
>
|
||||
@@ -217,8 +256,8 @@ export const LoginView: React.FC = () => {
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<div style={{ marginTop: '2rem', textAlign: 'center', fontSize: '0.75rem', color: 'var(--text-muted)' }}>
|
||||
OnEverControl Web v0.6.0-beta • Conectado a Microsoft SQL Server videoman
|
||||
<div style={{ marginTop: '2rem', textAlign: 'center', fontSize: '0.75rem', color: 'var(--text-3)' }}>
|
||||
OnEverControl Web v0.6.1-beta • Conectado a Microsoft SQL Server videoman
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user