Compare commits
7
Commits
412e5cf50d
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9131ba777d | ||
|
|
8c2db72029 | ||
|
|
357c2dff12 | ||
|
|
d9ac4e1f66 | ||
|
|
35d0e56f9f | ||
|
|
ebd5b7491e | ||
|
|
26328b1057 |
Binary file not shown.
Binary file not shown.
@@ -33,6 +33,9 @@ class Settings(BaseSettings):
|
||||
"http://127.0.0.1:5173",
|
||||
"http://localhost:8000",
|
||||
"http://127.0.0.1:8000",
|
||||
"https://localhost",
|
||||
"http://localhost",
|
||||
"capacitor://localhost",
|
||||
]
|
||||
|
||||
# Base de Datos SQL Server (videoman)
|
||||
|
||||
+3
-1
@@ -25,13 +25,15 @@ app = FastAPI(
|
||||
# Middleware de Compresión GZip (optimiza transferencia a tablets por Wi-Fi)
|
||||
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(
|
||||
CORSMiddleware,
|
||||
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_methods=["*"],
|
||||
allow_headers=["*"],
|
||||
allow_private_network=True,
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,16 @@
|
||||
package com.oemspot.onevercontrol;
|
||||
|
||||
import android.os.Bundle;
|
||||
import androidx.core.view.WindowCompat;
|
||||
import com.getcapacitor.BridgeActivity;
|
||||
|
||||
public class MainActivity extends BridgeActivity {}
|
||||
public class MainActivity extends BridgeActivity {
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
// Asegurar que la ventana respete limpiamente las barras del sistema (Status Bar y Navigation Bar)
|
||||
// evitando solapamientos y eliminando espacios vacíos redundantes
|
||||
WindowCompat.setDecorFitsSystemWindows(getWindow(), true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
# Specifies the JVM arguments used for the daemon process.
|
||||
# The setting is particularly useful for tweaking memory settings.
|
||||
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.
|
||||
# This option should only be used with decoupled projects. More details, visit
|
||||
|
||||
@@ -7,7 +7,16 @@ export function getBaseUrl(): string {
|
||||
// 1. URL personalizada en localStorage (útil para configurar IP de backend en tablet)
|
||||
const savedUrl = localStorage.getItem('on_ever_api_url');
|
||||
if (savedUrl && savedUrl.trim()) {
|
||||
const trimmed = savedUrl.trim();
|
||||
let trimmed = savedUrl.trim();
|
||||
// Si en una tablet Android (Capacitor) guardan solo "/api/v1" o una ruta relativa,
|
||||
// en la app nativa debe resolverse hacia la IP LAN del backend
|
||||
if (Capacitor.isNativePlatform() && trimmed.startsWith('/')) {
|
||||
return `http://192.168.0.100:8000${trimmed.endsWith('/') ? trimmed.slice(0, -1) : trimmed}`;
|
||||
}
|
||||
// Si ingresaron la IP sin protocolo (ej: "192.168.0.100:8000" o "192.168.0.100:8000/api/v1")
|
||||
if (!trimmed.startsWith('http://') && !trimmed.startsWith('https://') && !trimmed.startsWith('/')) {
|
||||
trimmed = `http://${trimmed}`;
|
||||
}
|
||||
return trimmed.endsWith('/') ? trimmed.slice(0, -1) : trimmed;
|
||||
}
|
||||
|
||||
|
||||
+161
-29
@@ -25,6 +25,8 @@ html, body {
|
||||
touch-action: manipulation;
|
||||
overscroll-behavior-y: contain;
|
||||
user-select: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#root {
|
||||
@@ -598,13 +600,30 @@ button:disabled, .btn:disabled, .touch-button:disabled {
|
||||
|
||||
.desktop-top-header {
|
||||
height: 48px;
|
||||
background-color: #070D1E;
|
||||
border-bottom: 1px solid #14203B;
|
||||
background-color: var(--bg-surface, #070D1E);
|
||||
border-bottom: 1px solid var(--border-subtle, #14203B);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 16px;
|
||||
padding: 0 12px;
|
||||
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 {
|
||||
@@ -630,6 +649,75 @@ button:disabled, .btn:disabled, .touch-button:disabled {
|
||||
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 {
|
||||
flex: 1;
|
||||
display: grid;
|
||||
@@ -797,47 +885,81 @@ 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 {
|
||||
grid-template-columns: 210px 1fr 195px !important;
|
||||
display: grid !important;
|
||||
grid-template-columns: 225px 1fr 220px !important;
|
||||
gap: 8px !important;
|
||||
padding: 6px 8px !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;
|
||||
padding-bottom: 6px !important;
|
||||
height: calc(100vh - 48px) !important;
|
||||
overflow-y: auto !important;
|
||||
}
|
||||
.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) */
|
||||
@media (max-width: 679px) {
|
||||
/* Modo Horizontal en pantallas medianas / compactas (1024px a 1180px) */
|
||||
@media (orientation: landscape) and (max-width: 1180px) and (min-width: 840px) {
|
||||
.desktop-cockpit-grid {
|
||||
grid-template-columns: 1fr !important;
|
||||
gap: 10px !important;
|
||||
padding: 8px 10px !important;
|
||||
padding-bottom: 64px !important;
|
||||
grid-template-columns: 215px 1fr 205px !important;
|
||||
gap: 6px !important;
|
||||
padding: 4px 6px !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) */
|
||||
.tablet-portrait-dock {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@media (max-width: 960px) {
|
||||
.tablet-portrait-dock {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
padding: 8px 12px;
|
||||
@@ -847,7 +969,6 @@ button:disabled, .btn:disabled, .touch-button:disabled {
|
||||
bottom: 0;
|
||||
z-index: 100;
|
||||
box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.35);
|
||||
}
|
||||
}
|
||||
|
||||
/* ==============================================================================
|
||||
@@ -909,3 +1030,14 @@ button:disabled, .btn:disabled, .touch-button:disabled {
|
||||
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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user