From 086ec64c33330d06c9c8ec77659a12086ac55d38 Mon Sep 17 00:00:00 2001 From: July230 Date: Fri, 4 Jul 2025 18:36:00 -0600 Subject: [PATCH 01/24] Mostrar loader cuando se hace login --- .../framework/utils/scripts/iniciarSesion.js | 9 +++++--- .../framework/utils/scripts/pantallaCarga.js | 21 ++++++++++++++++++- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/harvester-app/src/framework/utils/scripts/iniciarSesion.js b/harvester-app/src/framework/utils/scripts/iniciarSesion.js index 9f5bbd9f..6dca1e74 100644 --- a/harvester-app/src/framework/utils/scripts/iniciarSesion.js +++ b/harvester-app/src/framework/utils/scripts/iniciarSesion.js @@ -90,14 +90,17 @@ async function manejarInicioSesion() { // Reiniciar verificación periódica después del login exitoso await ipcRenderer.invoke('reiniciar-verificacion-periodica'); - const rutaInicio = `${rutaBase}src/framework/vistas/paginas/inicio/inicio.ejs`; + // Guardar bandera para saber que vienes de login + localStorage.setItem('cargando-desde-login', 'true'); + + // Redirigir a pantallaCarga.ejs en vez de inicio.ejs directamente + const rutaPantallaCarga = `${rutaBase}src/framework/vistas/paginas/pantallaCarga.ejs`; try { - const vista = await ipcRenderer.invoke('precargar-ejs', rutaInicio,{Seccion: 'Inicio', Icono: 'Casa', permisos: listaPermisos}); + const vista = await ipcRenderer.invoke('precargar-ejs', rutaPantallaCarga, { rutaBase, permisos: listaPermisos }); window.location.href = vista; } catch (err) { return ('Error al cargar vista:', err); } - } else { mostrarAlerta('Verifica tus datos', respuesta.mensaje, 'warning'); } diff --git a/harvester-app/src/framework/utils/scripts/pantallaCarga.js b/harvester-app/src/framework/utils/scripts/pantallaCarga.js index 81d351a4..8482b5f0 100644 --- a/harvester-app/src/framework/utils/scripts/pantallaCarga.js +++ b/harvester-app/src/framework/utils/scripts/pantallaCarga.js @@ -1,4 +1,3 @@ - const { verificarToken } = require(`${rutaBase}/src/backend/servicios/verificarToken`); // Importar la función verificarToken const { verificarPermisos } = require(`${rutaBase}/src/backend/servicios/verificarPermisos`); // Importar la función verificarPermisos const { ipcRenderer } = require('electron'); @@ -8,6 +7,26 @@ const { ipcRenderer } = require('electron'); * Verifica la validez del token almacenado y redirige según corresponda. */ document.addEventListener('DOMContentLoaded', async () => { + // Detectar si viene de login + const desdeLogin = localStorage.getItem('cargando-desde-login') === 'true'; + + if (desdeLogin) { + // Solo mostrar loader y redirigir sin verificar token/permiso + setTimeout(async () => { + localStorage.removeItem('cargando-desde-login'); + const permisos = JSON.parse(localStorage.getItem('permisos') || '[]'); + const rutaInicio = `${rutaBase}src/framework/vistas/paginas/inicio/inicio.ejs`; + try { + localStorage.setItem('seccion-activa', 'inicio'); + const vista = await ipcRenderer.invoke('precargar-ejs', rutaInicio, { Seccion : 'Inicio', Icono : 'Casa', permisos}); + window.location.href = vista; + } catch (err) { + return ('Error al cargar vista:', err); + } + }, 2000); + return; + } + const token = obtenerToken(); // Llamamos a la función para obtener el token al cargar la página try { From 2dfb3b3835db5d7fa21842f20e960510ed4bc822 Mon Sep 17 00:00:00 2001 From: July230 Date: Fri, 4 Jul 2025 18:40:45 -0600 Subject: [PATCH 02/24] Mover logica dentro del try --- .../framework/utils/scripts/pantallaCarga.js | 64 +++++++++---------- 1 file changed, 31 insertions(+), 33 deletions(-) diff --git a/harvester-app/src/framework/utils/scripts/pantallaCarga.js b/harvester-app/src/framework/utils/scripts/pantallaCarga.js index 8482b5f0..b6e78bed 100644 --- a/harvester-app/src/framework/utils/scripts/pantallaCarga.js +++ b/harvester-app/src/framework/utils/scripts/pantallaCarga.js @@ -1,5 +1,5 @@ -const { verificarToken } = require(`${rutaBase}/src/backend/servicios/verificarToken`); // Importar la función verificarToken -const { verificarPermisos } = require(`${rutaBase}/src/backend/servicios/verificarPermisos`); // Importar la función verificarPermisos +const { verificarToken } = require(`${rutaBase}/src/backend/servicios/verificarToken`); +const { verificarPermisos } = require(`${rutaBase}/src/backend/servicios/verificarPermisos`); const { ipcRenderer } = require('electron'); /** @@ -7,29 +7,31 @@ const { ipcRenderer } = require('electron'); * Verifica la validez del token almacenado y redirige según corresponda. */ document.addEventListener('DOMContentLoaded', async () => { - // Detectar si viene de login - const desdeLogin = localStorage.getItem('cargando-desde-login') === 'true'; + try { + const desdeLogin = localStorage.getItem('cargando-desde-login') === 'true'; - if (desdeLogin) { - // Solo mostrar loader y redirigir sin verificar token/permiso - setTimeout(async () => { - localStorage.removeItem('cargando-desde-login'); - const permisos = JSON.parse(localStorage.getItem('permisos') || '[]'); - const rutaInicio = `${rutaBase}src/framework/vistas/paginas/inicio/inicio.ejs`; - try { - localStorage.setItem('seccion-activa', 'inicio'); - const vista = await ipcRenderer.invoke('precargar-ejs', rutaInicio, { Seccion : 'Inicio', Icono : 'Casa', permisos}); - window.location.href = vista; - } catch (err) { - return ('Error al cargar vista:', err); - } - }, 2000); - return; - } + if (desdeLogin) { + // Solo mostrar loader y redirigir sin verificar token/permiso + setTimeout(async () => { + localStorage.removeItem('cargando-desde-login'); + const permisos = JSON.parse(localStorage.getItem('permisos') || '[]'); + const rutaInicio = `${rutaBase}src/framework/vistas/paginas/inicio/inicio.ejs`; + try { + localStorage.setItem('seccion-activa', 'inicio'); + const vista = await ipcRenderer.invoke('precargar-ejs', rutaInicio, { Seccion : 'Inicio', Icono : 'Casa', permisos}); + window.location.href = vista; + } catch (err) { + // Si ocurre un error al cargar inicio, redirigir a iniciarSesion + const rutaIniciarSesion = `${rutaBase}src/framework/vistas/paginas/iniciarSesion.ejs`; + const vista = await ipcRenderer.invoke('precargar-ejs', rutaIniciarSesion); + window.location.href = vista; + } + }, 2000); + return; + } - const token = obtenerToken(); // Llamamos a la función para obtener el token al cargar la página + const token = obtenerToken(); // Llamamos a la función para obtener el token al cargar la página - try { // Verificar si el token es válido const tokenValido = await verificarToken(token); @@ -47,27 +49,23 @@ document.addEventListener('DOMContentLoaded', async () => { const vista = await ipcRenderer.invoke('precargar-ejs', rutaInicio, { Seccion : 'Inicio', Icono : 'Casa', permisos}); window.location.href = vista; } catch (err) { - return ('Error al cargar vista:', err); + const rutaIniciarSesion = `${rutaBase}src/framework/vistas/paginas/iniciarSesion.ejs`; + const vista = await ipcRenderer.invoke('precargar-ejs', rutaIniciarSesion); + window.location.href = vista; } } else { const rutaIniciarSesion = `${rutaBase}src/framework/vistas/paginas/iniciarSesion.ejs`; - try { - const vista = await ipcRenderer.invoke('precargar-ejs', rutaIniciarSesion); - window.location.href = vista; - } catch (err) { - return ('Error al cargar vista:', err); - } + const vista = await ipcRenderer.invoke('precargar-ejs', rutaIniciarSesion); + window.location.href = vista; } } catch { - // En caso de error, mostrar la pantalla de carga y luego redirigir a inicio de sesión + // Si ocurre cualquier error, redirigir a iniciarSesion const rutaIniciarSesion = `${rutaBase}src/framework/vistas/paginas/iniciarSesion.ejs`; try { const vista = await ipcRenderer.invoke('precargar-ejs', rutaIniciarSesion); window.location.href = vista; - } catch (err) { - return ('Error al cargar vista:', err); - } + } catch {} } }); From 10288ae4734d8d1a7384a636d0ec2987654ada35 Mon Sep 17 00:00:00 2001 From: July230 Date: Mon, 7 Jul 2025 13:00:45 -0600 Subject: [PATCH 03/24] Corregir errores de eslint --- .../src/framework/utils/scripts/pantallaCarga.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/harvester-app/src/framework/utils/scripts/pantallaCarga.js b/harvester-app/src/framework/utils/scripts/pantallaCarga.js index b6e78bed..5fc04b0e 100644 --- a/harvester-app/src/framework/utils/scripts/pantallaCarga.js +++ b/harvester-app/src/framework/utils/scripts/pantallaCarga.js @@ -20,7 +20,7 @@ document.addEventListener('DOMContentLoaded', async () => { localStorage.setItem('seccion-activa', 'inicio'); const vista = await ipcRenderer.invoke('precargar-ejs', rutaInicio, { Seccion : 'Inicio', Icono : 'Casa', permisos}); window.location.href = vista; - } catch (err) { + } catch { // Si ocurre un error al cargar inicio, redirigir a iniciarSesion const rutaIniciarSesion = `${rutaBase}src/framework/vistas/paginas/iniciarSesion.ejs`; const vista = await ipcRenderer.invoke('precargar-ejs', rutaIniciarSesion); @@ -62,10 +62,8 @@ document.addEventListener('DOMContentLoaded', async () => { } catch { // Si ocurre cualquier error, redirigir a iniciarSesion const rutaIniciarSesion = `${rutaBase}src/framework/vistas/paginas/iniciarSesion.ejs`; - try { - const vista = await ipcRenderer.invoke('precargar-ejs', rutaIniciarSesion); - window.location.href = vista; - } catch {} + const vista = await ipcRenderer.invoke('precargar-ejs', rutaIniciarSesion); + window.location.href = vista; } }); From d015de4e1c3c63c09138b6c32e8c6a8a84f3ff84 Mon Sep 17 00:00:00 2001 From: July230 Date: Mon, 7 Jul 2025 13:05:26 -0600 Subject: [PATCH 04/24] Corregir error eslint --- harvester-app/src/framework/utils/scripts/pantallaCarga.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/harvester-app/src/framework/utils/scripts/pantallaCarga.js b/harvester-app/src/framework/utils/scripts/pantallaCarga.js index 5fc04b0e..a0847e92 100644 --- a/harvester-app/src/framework/utils/scripts/pantallaCarga.js +++ b/harvester-app/src/framework/utils/scripts/pantallaCarga.js @@ -48,7 +48,7 @@ document.addEventListener('DOMContentLoaded', async () => { localStorage.setItem('seccion-activa', 'inicio'); const vista = await ipcRenderer.invoke('precargar-ejs', rutaInicio, { Seccion : 'Inicio', Icono : 'Casa', permisos}); window.location.href = vista; - } catch (err) { + } catch { const rutaIniciarSesion = `${rutaBase}src/framework/vistas/paginas/iniciarSesion.ejs`; const vista = await ipcRenderer.invoke('precargar-ejs', rutaIniciarSesion); window.location.href = vista; From fc9598424ed682443bbdf093db3469f54949dfb7 Mon Sep 17 00:00:00 2001 From: Diego Date: Thu, 10 Jul 2025 21:08:16 -0600 Subject: [PATCH 05/24] avance en UI --- .../css/paginas/formulas/moduloFormulas.css | 3 +- .../paginas/plantillas/moduloPlantillas.css | 766 ------------------ .../css/paginas/plantillas/plantillas.css | 27 + .../utils/scripts/paginas/plantillas/json.js | 22 + .../paginas/analisis/generarReporte.ejs | 25 + harvester-app/src/main.js | 2 +- 6 files changed, 77 insertions(+), 768 deletions(-) delete mode 100644 harvester-app/src/framework/utils/css/paginas/plantillas/moduloPlantillas.css create mode 100644 harvester-app/src/framework/utils/css/paginas/plantillas/plantillas.css create mode 100644 harvester-app/src/framework/utils/scripts/paginas/plantillas/json.js diff --git a/harvester-app/src/framework/utils/css/paginas/formulas/moduloFormulas.css b/harvester-app/src/framework/utils/css/paginas/formulas/moduloFormulas.css index e86a75b7..d8d482de 100644 --- a/harvester-app/src/framework/utils/css/paginas/formulas/moduloFormulas.css +++ b/harvester-app/src/framework/utils/css/paginas/formulas/moduloFormulas.css @@ -1,5 +1,6 @@ .ventana-principal { - width: 100% + width: 100%; + height: 100%; } diff --git a/harvester-app/src/framework/utils/css/paginas/plantillas/moduloPlantillas.css b/harvester-app/src/framework/utils/css/paginas/plantillas/moduloPlantillas.css deleted file mode 100644 index 48ccceca..00000000 --- a/harvester-app/src/framework/utils/css/paginas/plantillas/moduloPlantillas.css +++ /dev/null @@ -1,766 +0,0 @@ -.frame-plantillas, -.frame-plantillas * { - box-sizing: border-box; -} -.frame-plantillas { - display: flex; - flex-direction: row; - gap: 125px; - align-items: center; - justify-content: center; - flex-wrap: wrap; - align-content: flex-start; - flex-shrink: 0; - position: relative; -} -.plantilla { - background: var(--box-light, #ffffff); - border-radius: 8px; - border-style: solid; - border-color: rgba(0, 0, 0, 0.2); - border-width: 4px; - padding: 10px; - display: flex; - flex-direction: column; - align-items: flex-end; - justify-content: space-between; - flex-shrink: 0; - width: 369px; - height: 517px; - position: relative; -} -.boton-opciones { - display: flex; - align-items: center; - justify-content: flex-end; - flex-shrink: 0; - position: relative; - border: none; - background: transparent; - border-radius: 8px; - cursor: pointer; - font-size: 18px; - color: #6d6c6c; - width: 100%; - transition: background 0.2s; -} - -.more-horizontal { - display: flex; - align-items: center; - gap: 10px; - padding: 10px; - border: none; - background: blue; - border-radius: 8px; - cursor: pointer; - font-size: 18px; - color: #969696; - width: 100%; - transition: background 0.2s; - flex-shrink: 0; - width: 38px; - height: 38px; - position: relative; -} -.nombre-plantilla { - display: flex; - flex-direction: column; - gap: 10px; - align-items: center; - justify-content: center; - align-self: stretch; - flex-shrink: 0; - position: relative; - overflow: hidden; -} -.nombre-de-plantilla { - color: var(#000000); - text-align: center; - font-family: "SegoeUi-Regular", sans-serif; - font-size: 24px; - line-height: 112%; - letter-spacing: -0.02em; - font-weight: 400; - position: relative; - display: flex; - align-items: center; - justify-content: center; -} - -scroll-container { - display: block; - width: 100%; - height: 100%; - overflow-y: scroll; - scroll-behavior: smooth; - padding: px; -} - - -.ejemplo-preview, -.ejemplo-preview * { - box-sizing: border-box; - scroll-behavior: auto; -} -.ejemplo-preview { - background: var(--blanco, #ffffff); - border-radius: 8px; - border-style: solid; - padding: 10px; - display: flex; - flex-direction: column; - gap: 25px; - align-items: center; - justify-content: flex-start; - position: relative; -} -.titlulo-ejemplo { - color: var(--texto-light, #000000); - text-align: center; - font-family: "Inter-Regular", sans-serif; - font-size: 24px; - line-height: 100%; - font-weight: 400; - position: relative; - align-self: stretch; - display: flex; - align-items: center; - justify-content: center; -} -.primer-texto { - color: var(--texto-light, #000000); - text-align: left; - font-family: "Inter-Regular", sans-serif; - font-size: 18px; - line-height: 100%; - font-weight: 400; - position: relative; - align-self: stretch; -} -.preview-grafica { - background: var(--iconos-claro, #6d6c6c); - border-radius: 8px; - display: flex; - flex-direction: row; - gap: 10px; - align-items: center; - justify-content: center; - align-self: stretch; - flex-shrink: 0; - height: 400px; - position: relative; -} -.bar-chart { - flex-shrink: 0; - width: 25px; - height: 25px; - position: relative; - overflow: visible; -} -.sengundo-texto { - color: var(--texto-light, #000000); - text-align: left; - font-family: "Inter-Regular", sans-serif; - font-size: 18px; - line-height: 100%; - font-weight: 400; - position: relative; - align-self: stretch; -} - -.frame-btn-Editar, -.frame-btn-Editar * { - box-sizing: border-box; -} -.frame-btn-Editar { - padding: 5px; - display: flex; - flex-direction: row; - gap: 0px; - align-items: center; - justify-content: center; - flex-shrink: 0; - height: 25.75px; - position: relative; - border: none; - background: transparent; -} - -.frame-btn-Editar:hover, .cancelar:hover{ - background: rgb(175, 174, 174); -} -.eliminar:hover{ - background: #700303; -} - -.boton-modificar { - display: flex; - flex-direction: row; - align-items: center; - justify-content: space-between; - flex-shrink: 0; - width: 112.5px; - position: relative; -} -.edit-2 { - flex-shrink: 0; - width: 24px; - height: 24px; - position: relative; - overflow: visible; -} -.modificar { - color: var(--texto-light, #000000); - text-align: center; - font-family: "SegoeUi-Regular", sans-serif; - font-size: 20px; - line-height: 112%; - letter-spacing: -0.02em; - font-weight: 400; - position: relative; - width: 81px; - height: 17px; - display: flex; - align-items: center; - justify-content: center; -} - - -/* The container
- needed to position the dropdown content */ -.dropdown { - position: relative; - display: inline-block; -} - -/* Dropdown Content (Hidden by Default) */ -.dropdown-content { - display: none; - position: absolute; - background-color: #f1f1f1; - box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); - z-index: 1; -} - -/* Links inside the dropdown */ -.dropdown-content.frame-modificar { - color: black; - padding: 12px 16px; - text-decoration: none; - display: block; -} - -/* Change color of dropdown links on hover */ -.dropdown-content .frame-modificar:hover {background-color: #ddd;} - -/* Show the dropdown menu on hover */ -.dropdown.active .dropdown-content {display: block;} - -/* Change the background color of the dropdown button when the dropdown content is shown */ -.dropdown.active .dropbtn {background-color: #3e8e41;} - -#modalBorrar::backdrop{ - background-color: rgba(0, 0, 0, 0.55); -} -#modalBorrar{ - padding: 0px; -} - -dialog.modal-borrar { - position: fixed; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - border: none; - border-radius: 8px; - padding: 2rem; - box-shadow: 0 0 10px rgba(0, 0, 0, 0.3); - - background-color: white; - z-index: 999; -} - - -.borrar-plantilla { - background: var(--box-light, #ffffff); - padding: 25px; - display: flex; - flex-direction: column; - gap: 19px; - align-items: center; - justify-content: center; - flex-shrink: 0; - width: 410px; - position: relative; -} -.titulo { - display: flex; - flex-direction: row; - gap: 0px; - align-items: center; - justify-content: center; - flex-shrink: 0; - position: relative; -} -.eliminar-la-plantila { - color: var(--texto-light, #000000); - text-align: left; - font-family: "SegoeUi-Regular", sans-serif; - font-size: 32px; - line-height: 100%; - font-weight: 400; - position: relative; -} -.texto { - display: flex; - flex-direction: row; - row-gap: 11px; - align-items: center; - justify-content: space-between; - flex-wrap: wrap; - align-content: center; - flex-shrink: 0; - width: 383px; - max-width: 409px; - position: relative; -} -.eliminartexto { - color: var(--texto-light, #000000); - text-align: center; - font-family: "SegoeUi-Regular", sans-serif; - font-size: 20px; - line-height: 100%; - font-weight: 400; - position: relative; - width: 383px; -} -.botones { - padding: 10px; - display: flex; - flex-direction: row; - gap: 20px; - align-items: center; - justify-content: center; - flex-shrink: 0; - position: relative; -} -.eliminar { - background: var(--primario, #a61930); - border-radius: 8px; - border-style: solid; - border-color: rgba(255, 255, 255, 0.2); - border-width: 2px; - padding: 10px; - display: flex; - flex-direction: row; - gap: 10px; - align-items: center; - justify-content: center; - flex-shrink: 0; - position: relative; -} -.texto2 { - color: var(--texto-dark, #ffffff); - text-align: center; - font-family: "SegoeUi-Regular", sans-serif; - font-size: 24px; - line-height: 112%; - font-weight: 400; - position: relative; - display: flex; - align-items: center; - justify-content: center; -} -.cancelar { - background: var(--box-light, #ffffff); - border-radius: 8px; - border-style: solid; - border-color: #262b40; - border-width: 2px; - padding: 10px; - display: flex; - flex-direction: row; - gap: 0px; - align-items: center; - justify-content: center; - flex-shrink: 0; - position: relative; -} -.cancelar2 { - color: var(--texto-light, #000000); - text-align: center; - font-family: "SegoeUi-Regular", sans-serif; - font-size: 24px; - line-height: 112%; - letter-spacing: -0.02em; - font-weight: 400; - position: relative; - display: flex; - align-items: center; - justify-content: center; -} - -.menu-opciones, -.menu-opciones * { - box-sizing: border-box; -} -.menu-opciones { - border-radius: 8px; - display: flex; - flex-direction: row; - gap: 10px; - align-items: center; - justify-content: center; - align-self: stretch; - flex-shrink: 0; - max-height: 127px; - position: relative; -} - -.divisorPlantilla { - align-self: stretch; - display: flex; - flex-direction: row; - align-items: center; - justify-content: center; - padding-top: 10px; - padding-bottom: 10px; -} -.nombre-de-plantilla { - color: var(--texto-light, #000000); - text-align: center; - font-family: "SegoeUi-Regular", sans-serif; - font-size: 24px; - line-height: 112%; - letter-spacing: -0.02em; - font-weight: 400; - position: relative; - width: 235px; - max-width: 235px; - display: flex; - align-items: center; - justify-content: flex-start; - text-overflow: ellipsis; - overflow: hidden; - white-space: nowrap; -} -.maximize-2 { - flex-shrink: 0; - width: 24px; - height: 24px; - position: relative; - overflow: visible; -} -.edit-2 { - flex-shrink: 0; - width: 24px; - height: 24px; - position: relative; - overflow: visible; -} -.trash { - flex-shrink: 0; - width: 27.5px; - height: 27.5px; - position: relative; - overflow: visible; -} - -button { - border: none; - background: transparent; - border-radius: 8px; - cursor: pointer; -} -button:hover{ - background: rgba(0, 0, 0, 0.25); - border-radius: 8px; -} - -.error-sin-plantillas, -.error-sin-plantillas * { - box-sizing: border-box; -} -.error-sin-plantillas { - color: #000000; - text-align: center; - font-family: var(--hero-font-family, "SegoeUi-Regular", sans-serif); - font-size: var(--hero-font-size, 52px); - line-height: var(--hero-line-height, 120%); - letter-spacing: var(--hero-letter-spacing, -0.02em); - font-weight: var(--hero-font-weight, 400); - position: relative; - display: flex; - align-items: center; - justify-content: center; -} - -.previsualizador-maximizado, -.previsualizador-maximizado * { - box-sizing: border-box; -} -.previsualizador-maximizado { - display: flex; - flex-direction: column; - gap: 51px; - align-items: flex-start; - justify-content: flex-start; - flex-shrink: 0; - height: 939px; - position: relative; -} -.maximizado-nombre-plantilla { - border-radius: 8px; - display: flex; - flex-direction: row; - gap: 10px; - align-items: center; - justify-content: center; - align-self: stretch; - flex-shrink: 0; - max-height: 127px; - position: relative; -} -.nombre-plantilla { - color: var(--texto-light, #000000); - text-align: center; - font-family: var(--hero-font-family, "SegoeUi-Regular", sans-serif); - font-size: var(--hero-font-size, 52px); - line-height: var(--hero-line-height, 120%); - letter-spacing: var(--hero-letter-spacing, -0.02em); - font-weight: var(--hero-font-weight, 400); - position: relative; - flex: 1; - display: flex; - align-items: center; - justify-content: center; - text-overflow: ellipsis; - overflow: hidden; - white-space: nowrap; -} -.seccion-preview-grafica-preview { - border-radius: 8px; - border-style: solid; - border-color: #000000; - border-width: 2px; - padding: 25px; - display: flex; - flex-direction: column; - gap: 25px; - align-items: center; - justify-content: flex-start; - flex: 1; - position: relative; -} -.preview-gr-fica-preview { - color: #000000; - text-align: left; - font-family: var(--titulo-font-family, "SegoeUi-Regular", sans-serif); - font-size: var(--titulo-font-size, 32px); - line-height: var(--titulo-line-height, 120%); - letter-spacing: var(--titulo-letter-spacing, -0.02em); - font-weight: var(--titulo-font-weight, 400); - position: relative; -} -.primer-texto-prewview { - color: var(--texto-light, #000000); - text-align: left; - font-family: var(--parrafo-font-family, "SegoeUi-Regular", sans-serif); - font-size: var(--parrafo-font-size, 18px); - line-height: var(--parrafo-line-height, 120%); - letter-spacing: var(--parrafo-letter-spacing, -0.02em); - font-weight: var(--parrafo-font-weight, 400); - position: relative; - align-self: stretch; -} -.preview-grafica-preview { - background: #9e9e9e; - border-radius: 8px; - display: flex; - flex-direction: row; - gap: 10px; - align-items: center; - justify-content: center; - flex-shrink: 0; - width: 750px; - height: 396px; - position: relative; -} -.bar-chart { - flex-shrink: 0; - width: 55px; - height: 55px; - position: relative; - overflow: visible; -} -.primer-texto-preview { - color: var(--texto-light, #000000); - text-align: left; - font-family: var(--parrafo-font-family, "SegoeUi-Regular", sans-serif); - font-size: var(--parrafo-font-size, 18px); - line-height: var(--parrafo-line-height, 120%); - letter-spacing: var(--parrafo-letter-spacing, -0.02em); - font-weight: var(--parrafo-font-weight, 400); - position: relative; - align-self: stretch; -} -.botones-fondo { - display: flex; - flex-direction: row; - align-items: center; - justify-content: space-between; - align-self: stretch; - flex-shrink: 0; - position: relative; -} -.botones-ediar-eliminar { - display: flex; - flex-direction: row; - gap: 25px; - align-items: center; - justify-content: flex-start; - flex-shrink: 0; - position: relative; -} -.btn-editar { - border-radius: 8px; - border-style: solid; - border-color: var(--negro, #000000); - border-width: 2px; - padding: 10px; - display: flex; - flex-direction: row; - gap: 10px; - align-items: center; - justify-content: flex-start; - flex-shrink: 0; - min-width: 150px; - position: relative; -} -.editar-maximizado { - flex-shrink: 0; - width: 24px; - height: 24px; - position: relative; - overflow: visible; -} -.editar-maximizaddo { - color: #000000; - text-align: center; - font-family: var(--encabezado-font-family, "SegoeUi-Regular", sans-serif); - font-size: var(--encabezado-font-size, 24px); - line-height: var(--encabezado-line-height, 120%); - letter-spacing: var(--encabezado-letter-spacing, -0.02em); - font-weight: var(--encabezado-font-weight, 400); - position: relative; - flex: 1; - display: flex; - align-items: center; - justify-content: center; -} -.btn-eliminar { - background: var(--primario, #a61930); - border-radius: 8px; - border-style: solid; - border-color: var(--bordeblanco, rgba(255, 255, 255, 0.2)); - border-width: 1px; - padding: 10px; - display: flex; - flex-direction: row; - gap: 10px; - align-items: center; - justify-content: flex-start; - flex-shrink: 0; - min-width: 150px; - position: relative; -} -.eliminar-maximizado { - flex-shrink: 0; - width: 27.5px; - height: 27.5px; - position: relative; - overflow: visible; -} -.eliminar-maximizado2 { - color: var(--blanco, #ffffff); - text-align: center; - font-family: var(--encabezado-font-family, "SegoeUi-Regular", sans-serif); - font-size: var(--encabezado-font-size, 24px); - line-height: var(--encabezado-line-height, 120%); - letter-spacing: var(--encabezado-letter-spacing, -0.02em); - font-weight: var(--encabezado-font-weight, 400); - position: relative; - width: 82px; - display: flex; - align-items: center; - justify-content: center; -} -.botones-usar-cancelar { - display: flex; - flex-direction: row; - gap: 25px; - align-items: flex-start; - justify-content: center; - flex-shrink: 0; - position: relative; -} -.btn-usar { - background: var(--secundario, #a61930); - border-radius: 8px; - border-style: solid; - border-color: rgba(255, 255, 255, 0.2); - border-width: 2px; - padding: 10px; - display: flex; - flex-direction: row; - gap: 10px; - align-items: center; - justify-content: center; - flex-shrink: 0; - min-width: 150px; - position: relative; -} -.uasr-maximizado { - color: var(--texto-dark, #ffffff); - text-align: center; - font-family: var(--encabezado-font-family, "SegoeUi-Regular", sans-serif); - font-size: var(--encabezado-font-size, 24px); - line-height: var(--encabezado-line-height, 120%); - letter-spacing: var(--encabezado-letter-spacing, -0.02em); - font-weight: var(--encabezado-font-weight, 400); - position: relative; - flex: 1; - display: flex; - align-items: center; - justify-content: center; -} -.btn-cancelar { - background: var(--box-light, #ffffff); - border-radius: 8px; - border-style: solid; - border-color: #262b40; - border-width: 2px; - padding: 10px; - display: flex; - flex-direction: row; - gap: 0px; - align-items: center; - justify-content: center; - flex-shrink: 0; - min-width: 150px; - position: relative; -} -.cancelar-maximizado { - color: var(--texto-light, #000000); - text-align: center; - font-family: var(--encabezado-font-family, "SegoeUi-Regular", sans-serif); - font-size: var(--encabezado-font-size, 24px); - line-height: var(--encabezado-line-height, 120%); - letter-spacing: var(--encabezado-letter-spacing, -0.02em); - font-weight: var(--encabezado-font-weight, 400); - position: relative; - flex: 1; - display: flex; - align-items: center; - justify-content: center; -} diff --git a/harvester-app/src/framework/utils/css/paginas/plantillas/plantillas.css b/harvester-app/src/framework/utils/css/paginas/plantillas/plantillas.css new file mode 100644 index 00000000..1a446f9e --- /dev/null +++ b/harvester-app/src/framework/utils/css/paginas/plantillas/plantillas.css @@ -0,0 +1,27 @@ +.frame-plantillas{ + display: flex; + flex-direction: row; + justify-content: flex-start; + align-content: baseline; + width: 100%; + height: 100em; +} + +.frame-plantillas-izquierda { + display: flex; + flex-direction: row; + justify-content: flex-start; + width: 100%; + height: 3em; + padding: 0.5em; +} + +.frame-plantillas-derecha { + display: flex; + flex-direction: row; + justify-content: flex-end; + width: 100%; + height: 3em; + padding: 0.5em; +} + diff --git a/harvester-app/src/framework/utils/scripts/paginas/plantillas/json.js b/harvester-app/src/framework/utils/scripts/paginas/plantillas/json.js new file mode 100644 index 00000000..29097629 --- /dev/null +++ b/harvester-app/src/framework/utils/scripts/paginas/plantillas/json.js @@ -0,0 +1,22 @@ + + +{ + componentes : [ + { + componente : "texto", + tipo : "titulo", + contenido : "Reporte trimestral de CASE 110 A", + alineamiento : "izquierda", + }, + { + componente : "grafica", + nombre : "Litros de gasolina consumidos", + tipo : "linea", + tractor : "CASE 110 A (TEC)", + parametro : '', + filtro : 'Filtro encendido', + formula : 'Exceso de Gasolina' + + } + ] +} \ No newline at end of file diff --git a/harvester-app/src/framework/vistas/paginas/analisis/generarReporte.ejs b/harvester-app/src/framework/vistas/paginas/analisis/generarReporte.ejs index c928715d..9e352dc6 100644 --- a/harvester-app/src/framework/vistas/paginas/analisis/generarReporte.ejs +++ b/harvester-app/src/framework/vistas/paginas/analisis/generarReporte.ejs @@ -2,7 +2,32 @@ + +
+
+ + + +
+
+ + +
+
+ +
diff --git a/harvester-app/src/main.js b/harvester-app/src/main.js index 88b09503..6f4bcd66 100644 --- a/harvester-app/src/main.js +++ b/harvester-app/src/main.js @@ -27,7 +27,7 @@ const createWindow = async () => { webPreferences: { nodeIntegration: true, contextIsolation: false, - devTools: false, + devTools: true, }, }); From 03d6ef378208b808f02f29c5642407b1d71d7da3 Mon Sep 17 00:00:00 2001 From: Diego Date: Mon, 14 Jul 2025 10:41:32 -0600 Subject: [PATCH 06/24] interfaz --- .../css/paginas/plantillas/plantillas.css | 34 +++++++++++++++++-- .../paginas/analisis/generarReporte.ejs | 10 +++--- 2 files changed, 36 insertions(+), 8 deletions(-) diff --git a/harvester-app/src/framework/utils/css/paginas/plantillas/plantillas.css b/harvester-app/src/framework/utils/css/paginas/plantillas/plantillas.css index 1a446f9e..5254ffe7 100644 --- a/harvester-app/src/framework/utils/css/paginas/plantillas/plantillas.css +++ b/harvester-app/src/framework/utils/css/paginas/plantillas/plantillas.css @@ -4,7 +4,11 @@ justify-content: flex-start; align-content: baseline; width: 100%; - height: 100em; + height: 100%; + border-radius: 0.33em; + background-color: #ededed; + margin-bottom: 1em; + padding: 0.5em; } .frame-plantillas-izquierda { @@ -13,7 +17,7 @@ justify-content: flex-start; width: 100%; height: 3em; - padding: 0.5em; + } .frame-plantillas-derecha { @@ -22,6 +26,30 @@ justify-content: flex-end; width: 100%; height: 3em; - padding: 0.5em; + /* padding: 0.5em; */ +} + +.boton-principal, .selector-plantilla, .input-nombre-plantilla { + border-radius: 0.33em; + border: none; + padding: 0.5em 1em; + margin: 0.5em; + background-color: #ffffff; } +.boton-principal:hover { + background-color: #f9f9f9; +} + +.boton-secundario { + border-radius: 0.33em; + border: none; + padding: 0.5em 1em; + margin: 0.5em; + background-color: #a61930; + color: #ffffff; +} + +.boton-secundario:hover { + background-color: #7d1425; +} diff --git a/harvester-app/src/framework/vistas/paginas/analisis/generarReporte.ejs b/harvester-app/src/framework/vistas/paginas/analisis/generarReporte.ejs index 9e352dc6..60745d4a 100644 --- a/harvester-app/src/framework/vistas/paginas/analisis/generarReporte.ejs +++ b/harvester-app/src/framework/vistas/paginas/analisis/generarReporte.ejs @@ -6,11 +6,11 @@
- + + + +