10 changed files with 979 additions and 807 deletions
Binary file not shown.
Binary file not shown.
+3
View File
@@ -33,6 +33,9 @@ class Settings(BaseSettings):
"http://127.0.0.1:5173", "http://127.0.0.1:5173",
"http://localhost:8000", "http://localhost:8000",
"http://127.0.0.1:8000", "http://127.0.0.1:8000",
"https://localhost",
"http://localhost",
"capacitor://localhost",
] ]
# Base de Datos SQL Server (videoman) # Base de Datos SQL Server (videoman)
+3 -1
View File
@@ -25,13 +25,15 @@ app = FastAPI(
# Middleware de Compresión GZip (optimiza transferencia a tablets por Wi-Fi) # Middleware de Compresión GZip (optimiza transferencia a tablets por Wi-Fi)
app.add_middleware(GZipMiddleware, minimum_size=1000) app.add_middleware(GZipMiddleware, minimum_size=1000)
# Middleware de CORS # Middleware de CORS con soporte para Capacitor (Android/iOS), LAN, PNA y Web
app.add_middleware( app.add_middleware(
CORSMiddleware, CORSMiddleware,
allow_origins=settings.ALLOWED_ORIGINS, allow_origins=settings.ALLOWED_ORIGINS,
allow_origin_regex=r"^(https?|capacitor)://(localhost|127\.0\.0\.1|192\.168\.\d+\.\d+|172\.\d+\.\d+\.\d+|10\.\d+\.\d+\.\d+)(:\d+)?$",
allow_credentials=True, allow_credentials=True,
allow_methods=["*"], allow_methods=["*"],
allow_headers=["*"], allow_headers=["*"],
allow_private_network=True,
) )
@@ -1,5 +1,24 @@
package com.oemspot.onevercontrol; package com.oemspot.onevercontrol;
import android.os.Bundle;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;
import com.getcapacitor.BridgeActivity; import com.getcapacitor.BridgeActivity;
public class MainActivity extends BridgeActivity {} public class MainActivity extends BridgeActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Prevenir que la barra de estado superior y la barra de navegación inferior del sistema tapen la app
ViewCompat.setOnApplyWindowInsetsListener(findViewById(android.R.id.content), (view, insets) -> {
int top = insets.getInsets(WindowInsetsCompat.Type.systemBars()).top;
int bottom = insets.getInsets(WindowInsetsCompat.Type.systemBars()).bottom;
int left = insets.getInsets(WindowInsetsCompat.Type.systemBars()).left;
int right = insets.getInsets(WindowInsetsCompat.Type.systemBars()).right;
view.setPadding(left, top, right, bottom);
return insets;
});
}
}
@@ -12,6 +12,7 @@
<style name="AppTheme.NoActionBar" parent="Theme.AppCompat.DayNight.NoActionBar"> <style name="AppTheme.NoActionBar" parent="Theme.AppCompat.DayNight.NoActionBar">
<item name="windowActionBar">false</item> <item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item> <item name="windowNoTitle">true</item>
<item name="android:fitsSystemWindows">true</item>
<item name="android:background">@null</item> <item name="android:background">@null</item>
</style> </style>
+1
View File
@@ -10,6 +10,7 @@
# Specifies the JVM arguments used for the daemon process. # Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings. # The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m org.gradle.jvmargs=-Xmx1536m
org.gradle.java.home=C:/Program Files/Eclipse Adoptium/jdk-21.0.2.13-hotspot
# When configured, Gradle will run in incubating parallel mode. # When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit # This option should only be used with decoupled projects. More details, visit
+174 -44
View File
@@ -25,6 +25,12 @@ html, body {
touch-action: manipulation; touch-action: manipulation;
overscroll-behavior-y: contain; overscroll-behavior-y: contain;
user-select: none; user-select: none;
/* Safe Area Insets para prevenir solapamiento con la barra de estado y de navegación de Android */
padding-top: env(safe-area-inset-top, 0px);
padding-bottom: env(safe-area-inset-bottom, 0px);
padding-left: env(safe-area-inset-left, 0px);
padding-right: env(safe-area-inset-right, 0px);
} }
#root { #root {
@@ -598,13 +604,30 @@ button:disabled, .btn:disabled, .touch-button:disabled {
.desktop-top-header { .desktop-top-header {
height: 48px; height: 48px;
background-color: #070D1E; background-color: var(--bg-surface, #070D1E);
border-bottom: 1px solid #14203B; border-bottom: 1px solid var(--border-subtle, #14203B);
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
padding: 0 16px; padding: 0 12px;
flex-shrink: 0; flex-shrink: 0;
overflow-x: auto;
scrollbar-width: none;
}
.desktop-top-header::-webkit-scrollbar {
display: none;
}
@media (max-width: 900px) {
.desktop-top-header {
padding: 0 8px;
gap: 4px;
}
.desktop-tab-btn {
padding: 0 10px;
font-size: 12px;
}
} }
.desktop-tab-btn { .desktop-tab-btn {
@@ -630,6 +653,75 @@ button:disabled, .btn:disabled, .touch-button:disabled {
border-bottom: 3px solid #2563EB; border-bottom: 3px solid #2563EB;
} }
.desktop-menu-hamburger-btn {
background: var(--input-bg);
border: 1px solid var(--border);
border-radius: 8px;
color: var(--text-1);
padding: 6px 12px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.15s ease;
user-select: none;
}
.desktop-menu-hamburger-btn:hover {
background: var(--hover-bg, rgba(255, 255, 255, 0.08));
border-color: var(--brand-primary, #3B82F6);
}
/* ==============================================================================
NUEVO FLUJO COCKPIT UNIFICADO (OPTIMIZADO TABLETS Y ESCRITORIO)
Orden exacto: DATOS PERSONA -> UBICACION/DESTINO & OBSERVACIONES ->
DOCUMENTACION Y POLIZAS -> LECTOR & CAMARAS -> HISTORIAL
============================================================================== */
.cockpit-flow-container {
flex: 1;
display: flex;
flex-direction: column;
gap: 8px;
padding: 8px 12px;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
background-color: var(--bg-main, #0B1120);
}
.cockpit-dual-row {
display: grid;
grid-template-columns: 1.15fr 1fr;
gap: 8px;
}
@media (max-width: 680px) {
.cockpit-dual-row {
grid-template-columns: 1fr;
}
}
.cockpit-bottom-dock {
display: flex;
align-items: center;
gap: 8px;
padding: 8px 14px;
padding-bottom: max(10px, env(safe-area-inset-bottom, 0px));
background-color: var(--bg-surface, #070D1E);
border-top: 1px solid var(--border-strong, #1E293B);
position: sticky;
bottom: 0;
z-index: 100;
box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.35);
flex-shrink: 0;
}
@keyframes slideInRight {
from {
transform: translateX(100%);
}
to {
transform: translateX(0);
}
}
.desktop-cockpit-grid { .desktop-cockpit-grid {
flex: 1; flex: 1;
display: grid; display: grid;
@@ -797,63 +889,90 @@ button:disabled, .btn:disabled, .touch-button:disabled {
} }
/* ============================================================================== /* ==============================================================================
RESPONSIVIDAD Y ERGONOMÍA PARA TABLETS SAMSUNG GALAXY TAB A11 (1340x800) RESPONSIVIDAD Y ERGONOMÍA PARA TABLETS SAMSUNG GALAXY TAB (16:10 - 1280x800 / 1340x800)
============================================================================== */ ============================================================================== */
@media (max-width: 1180px) and (min-width: 961px) {
/* Modo Horizontal (Landscape) en Tablets y Escritorios (ancho >= 768px y orientacion landscape) */
@media (orientation: landscape) and (min-width: 768px) {
.desktop-cockpit-grid { .desktop-cockpit-grid {
grid-template-columns: 210px 1fr 195px !important; display: grid !important;
grid-template-columns: 225px 1fr 220px !important;
gap: 8px !important; gap: 8px !important;
padding: 6px 8px !important; padding: 6px 8px !important;
} padding-bottom: 6px !important;
} height: calc(100vh - 48px) !important;
overflow-y: auto !important;
/* Modo Vertical (Portrait) en Tablets (Samsung Galaxy Tab 800x1340) -> 2 Columnas */
@media (max-width: 960px) and (min-width: 680px) {
.desktop-cockpit-grid {
grid-template-columns: 270px 1fr !important;
gap: 8px !important;
padding: 8px 10px !important;
padding-bottom: 64px !important;
} }
.desktop-column-actions { .desktop-column-actions {
grid-column: span 2; display: flex !important;
grid-column: auto !important;
}
.tablet-portrait-dock {
display: none !important;
}
.desktop-card-action-buttons,
.desktop-card-hardware-buttons {
display: flex !important;
} }
} }
/* Modo Smartphone o Pantalla Muy Estrecha (<680px) */ /* Modo Horizontal en pantallas medianas / compactas (1024px a 1180px) */
@media (max-width: 679px) { @media (orientation: landscape) and (max-width: 1180px) and (min-width: 840px) {
.desktop-cockpit-grid { .desktop-cockpit-grid {
grid-template-columns: 1fr !important; grid-template-columns: 215px 1fr 205px !important;
gap: 10px !important; gap: 6px !important;
padding: 8px 10px !important; padding: 4px 6px !important;
padding-bottom: 64px !important; }
}
/* Modo Vertical (Portrait) en Tablets Samsung Galaxy Tab (ancho CSS 500px a 960px) -> 2 Columnas */
@media (orientation: portrait) and (min-width: 500px), (max-width: 960px) and (orientation: portrait) {
.desktop-cockpit-grid {
display: grid !important;
grid-template-columns: 245px 1fr !important;
gap: 8px !important;
padding: 6px 8px !important;
padding-bottom: 70px !important;
overflow-y: auto !important;
}
.desktop-column-actions {
display: none !important; /* Sus acciones están ancladas en tablet-portrait-dock */
}
.tablet-portrait-dock {
display: flex !important;
}
}
/* Modo Celular o Pantalla Ultra Angosta (<500px) */
@media (max-width: 499px) {
.desktop-cockpit-grid {
display: flex !important;
flex-direction: column !important;
gap: 8px !important;
padding: 6px 8px !important;
padding-bottom: 70px !important;
overflow-y: auto !important;
}
.desktop-column-actions {
display: none !important;
}
.tablet-portrait-dock {
display: flex !important;
} }
} }
/* Dock de Acciones Rápidas para Modo Vertical (Portrait) */ /* Dock de Acciones Rápidas para Modo Vertical (Portrait) */
.tablet-portrait-dock { .tablet-portrait-dock {
display: none; display: none;
} align-items: center;
gap: 8px;
@media (max-width: 960px) { padding: 8px 12px;
.tablet-portrait-dock { background-color: var(--bg-surface);
display: flex; border-top: 1px solid var(--border-strong);
align-items: center; position: sticky;
gap: 8px; bottom: 0;
padding: 8px 12px; z-index: 100;
background-color: var(--bg-surface); box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.35);
border-top: 1px solid var(--border-strong);
position: sticky;
bottom: 0;
z-index: 100;
box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.35);
}
/* Evitar repetición de botones en la tarjeta de acciones cuando el dock fijo está activo */
.desktop-card-action-buttons,
.desktop-card-hardware-buttons {
display: none !important;
}
} }
/* ============================================================================== /* ==============================================================================
@@ -915,3 +1034,14 @@ button:disabled, .btn:disabled, .touch-button:disabled {
border: 1px dashed #94A3B8; border: 1px dashed #94A3B8;
} }
[data-theme="light"] .cockpit-flow-container {
background-color: #F1F5F9;
}
[data-theme="light"] .cockpit-bottom-dock {
background-color: #FFFFFF;
border-top: 1px solid #CBD5E1;
box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
}
File diff suppressed because it is too large Load Diff
+19
View File
@@ -0,0 +1,19 @@
@echo off
title OnEverControl Backend (FastAPI)
color 0B
echo ===================================================
echo Iniciando Servidor Backend - OnEverControl
echo ===================================================
echo.
cd /d "%~dp0backend"
echo [OK] Directorio: %CD%
echo [INFO] Servidor escuchando en: http://0.0.0.0:8000
echo [INFO] IP Local de red (Tablet): http://192.168.0.100:8000
echo [INFO] Swagger API Docs: http://localhost:8000/docs
echo.
echo Presione Ctrl+C para detener el servidor.
echo ===================================================
echo.
venv\Scripts\uvicorn.exe app.main:app --host 0.0.0.0 --port 8000 --reload
pause