From 00c5a7068cf8101e113becbe7378810aa3ac7f40 Mon Sep 17 00:00:00 2001 From: Marco Gallegos Date: Mon, 25 Aug 2025 08:36:33 -0600 Subject: [PATCH] =?UTF-8?q?feat:=20Estandarizar=20fechas,=20mejorar=20UI?= =?UTF-8?q?=20y=20a=C3=B1adir=20secci=C3=B3n=20de=20datos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Se realizan los siguientes cambios: - Se estandariza el formato de fecha a dd/mm/aaaa en toda la aplicación (tablas, reportes, tickets) para consistencia. - Se ajusta la versión de la aplicación a 1.3.0. - Se reduce el tamaño del logo principal para mejorar la proporción visual. - Se corrige el comportamiento de las pestañas de navegación para que en estado inactivo solo muestren el ícono. - Se añade una sección discreta para la ubicación y exportación de datos, visible solo para administradores, con instrucciones para acceder a la base de datos en el contenedor Docker. --- app.js | 12 ++++++++---- index.html | 21 +++++++++++++++------ styles.css | 12 ++++++++++++ 3 files changed, 35 insertions(+), 10 deletions(-) diff --git a/app.js b/app.js index 2f45655..dd98039 100644 --- a/app.js +++ b/app.js @@ -547,9 +547,6 @@ async function deleteProduct(id) { if (response.ok) { products = products.filter(p => p.id !== id); renderProductTables(); - } else { - const error = await response.json(); - alert(`Error: ${error.error}`); } } catch (error) { alert('Error de conexión al eliminar el producto.'); @@ -999,11 +996,13 @@ function setupUIForRole(role) { const settingsTab = document.querySelector('[data-tab="settings"]'); const userManagementSection = document.getElementById('user-management-section'); const staffInput = document.getElementById('m-staff'); + const dbInfoIcon = document.getElementById('db-info-icon'); if (role === 'admin') { if (dashboardTab) dashboardTab.style.display = 'block'; if (settingsTab) settingsTab.style.display = 'block'; if (userManagementSection) userManagementSection.style.display = 'block'; + if (dbInfoIcon) dbInfoIcon.style.display = 'inline-block'; fetch('/api/users') .then(res => { @@ -1019,6 +1018,7 @@ function setupUIForRole(role) { if (dashboardTab) dashboardTab.style.display = 'none'; if (settingsTab) settingsTab.style.display = 'none'; if (userManagementSection) userManagementSection.style.display = 'none'; + if (dbInfoIcon) dbInfoIcon.style.display = 'none'; } if (staffInput) { @@ -1070,6 +1070,7 @@ async function initializeApp() { const btnCancelEditUser = document.getElementById('btnCancelEditUser'); const tipoServicioSelect = document.getElementById('m-tipo'); const clientSubTabs = document.querySelector('#tab-clients .sub-tabs'); + const dbInfoIcon = document.getElementById('db-info-icon'); formSettings?.addEventListener('submit', handleSaveSettings); formCredentials?.addEventListener('submit', handleSaveCredentials); @@ -1089,6 +1090,9 @@ async function initializeApp() { if (currentUser.role === 'admin') { formAddUser?.addEventListener('submit', handleAddOrUpdateUser); tblUsersBody?.addEventListener('click', handleTableClick); + dbInfoIcon?.addEventListener('click', () => { + document.getElementById('db-instructions').classList.toggle('hidden'); + }); } btnLogout?.addEventListener('click', async () => { @@ -1227,4 +1231,4 @@ async function initializeApp() { }); } -document.addEventListener('DOMContentLoaded', initializeApp); \ No newline at end of file +document.addEventListener('DOMContentLoaded', initializeApp); diff --git a/index.html b/index.html index 93aeb1f..551fff2 100644 --- a/index.html +++ b/index.html @@ -20,7 +20,7 @@
-